# CAMERA_SetTrimmingParams

## Syntax

  `#include <twl/camera.h>`
  `void CAMERA_SetTrimmingParams(u16 x1, u16 y1, u16 x2, u16 y2);`

## Arguments

x1 | Start position for trimming (in pixels)
y1 | Start position for trimming (in pixels)
x2 | End position for trimming (in pixels)
y2 | End position for trimming (in pixels)

## Return Values

None.

## Description

Specifies the positions to use for trimming. Trimming includes the (x1, y1) pixel. Trimming does not include the (x2, y2) pixel.
To use this function, trimming must first be enabled by the `CAMERA_SetTrimming` function.
The start position (y1) and end position (y2) in the image specified with this function must be an even number.
The following behavior will result if the trimming range is not specified properly with this function.

- When the trimming start position is larger than the end position (x1 > x2 or y1 > y2), this function will do nothing and return.
- When the trimming end position is outside of the range of the camera's resolution, data is saved with the end of the original image used for the trimming range. For example, if the camera resolution is `CAMERA_SIZE_QVGA` (320, 240), specifying (160, 120) for (x1, y1) and (400, 200) for (x2, y2) results in a range from (160, 120) to (320, 200). In the same way, specifying (160, 120) for (x1, y1) and (240, 360) for (x2, y2) will result in a trimming range from (160, 120) to (240, 240).
- When the start position for trimming is not in the range of the camera resolution, data will not be saved.

## See Also

`CAMERA_SetTrimming`, `CAMERA_SetTrimmingParamsCenter`

## Revision History

2007/11/15 Added an explanation of behavior for illegal trimming ranges.
2007/10/23 Added descriptions.
2007/10/02 Initial version.

CONFIDENTIAL