nn::camera::CTR::SetDetailSize Function

Syntax

nn::Result SetDetailSize(
     CameraSelect select,
     s16 width,
     s16 height,
     s16 cropX0 = 0,
     s16 cropY0 = 0,
     s16 cropX1 = 639,
     s16 cropY1 = 479,
     Context context = CONTEXT_BOTH
);

Parameters

Name Description
in select Specifies which camera to change settings for.
in width Specifies the width of the output image.
in height Specifies the height of the output image.
in cropX0 Specifies the x-coordinate of the upper-left corner of the crop region when the original 640x480 image is cropped internally by the camera module. Must be specified in the range [0, 639], regardless of the output size of the image. Specify a width for the crop region that is greater than or equal to the width of the output image. Specify an even value. Specify a value so that the value of cropX1 - cropX0 + 1 is a multiple of 4. If omitted, the default value of 0 will be used.
in cropY0 Specifies the y-coordinate of the upper-left corner of the crop region when the original 640x480 image is cropped internally by the camera module. Must be specified in the range [0, 479], regardless of the output size of the image. Specify a height for the crop region that is greater than or equal to the height of the output image. If omitted, the default value of 0 is used.
in cropX1 Specifies the x-coordinate of the lower-right corner of the crop region when the original 640x480 image is cropped internally by the camera module. The specified value must be in the range from 0 to 639, regardless of the output size of the image. Specify a width for the crop region that is greater than or equal to the width of the output image. Specify a value so that the value of cropX1 - cropX0 + 1 is a multiple of 4. If omitted, the default value of 639 will be used.
in cropY1 Specifies the y-coordinate of the lower-right corner of the crop region when the original 640x480 image is cropped internally by the camera module. The specified value must be in the range from 0 to 479, regardless of the output size of the image. Specify a height for the crop region that is greater than or equal to the height of the output image. If omitted, the default value of 479 will be used.
in context Specifies which context to change settings for. If omitted, the settings will be applied both to context A and context B.

Return Values

Returns the function's execution result. Returns one of the Result values listed below.
Value Description
Result::IsSuccess Process was successful.
ResultIsSleeping This function is unusable because the system cover is closed.
ResultFatalError There may be something physically wrong with the camera.

Description

Sets the resolution (in pixels).

This function can be used to specify the cropping region. The cropping region is the region to be output from within the 640 x 480 image captured by the camera module. For example, if an image size of 320 x 240 is specified, and the cropping region is specified as the full 640 x 480, the output image will be the 640 x 480 image resized to 320 x 240. Meanwhile, if an image size of 320 x 240 is specified, and the cropping region is specified as the 320 x 240 region in the center of the image, the cropping region will be output at the full size without shrinking. Consequently, change the cropping region size without changing the image size to produce a digital zoom effect. Or, move the cropping region to produce a pan or tilt effect. The cropping region size must be at least as big as the image size. You cannot produce a zoom effect by specifying an image size larger than the cropping region size. Doing so will cause this function to fail.

When the image size aspect ratio is not 4:3 and the cropping region is left as the default, the 640 x 480 image will be reduced to match the specified image size, causing distortions on output. We therefore recommend using the same aspect ratios for the cropping region and the image size.

Note: This function may block for an extended period if a camera is restarting.

Revision History

2012/07/18
Added the horizontal coordinate limitation for the crop region
2010/09/24
Added description of the cropping region.
2010/07/17
Added explanation about operation during restart.
2010/02/02
Initial version.

CONFIDENTIAL