From 39dff6917f6a87ce0f9a5eb9e5868f266a65f8c1 Mon Sep 17 00:00:00 2001
From: Eino-Ville Talvala
For a logical multi-camera, bokeh may be implemented by stereo vision from sub-cameras * with different field of view. As a result, when bokeh mode is enabled, the camera device - * may override android.scaler.CropRegion, and the field of view will be smaller than when + * may override ACAMERA_SCALER_CROP_REGION, and the field of view will be smaller than when * bokeh mode is off.
+ * + * @see ACAMERA_SCALER_CROP_REGION */ ACAMERA_CONTROL_BOKEH_MODE = // byte (acamera_metadata_enum_android_control_bokeh_mode_t) ACAMERA_CONTROL_START + 45, @@ -1873,8 +1875,10 @@ typedef enum acamera_metadata_tag { * * *If the camera device supports zoom-out from 1x zoom, minZoom will be less than 1.0, and - * setting android.control.zoomRation to values less than 1.0 increases the camera's field + * setting ACAMERA_CONTROL_ZOOM_RATIO to values less than 1.0 increases the camera's field * of view.
+ * + * @see ACAMERA_CONTROL_ZOOM_RATIO */ ACAMERA_CONTROL_ZOOM_RATIO_RANGE = // float[2] ACAMERA_CONTROL_START + 46, @@ -3284,32 +3288,70 @@ typedef enum acamera_metadata_tag { *For devices not supporting ACAMERA_DISTORTION_CORRECTION_MODE control, the coordinate
* system always follows that of ACAMERA_SENSOR_INFO_ACTIVE_ARRAY_SIZE, with (0, 0)
being
* the top-left pixel of the active array.
For devices supporting ACAMERA_DISTORTION_CORRECTION_MODE control, the coordinate
- * system depends on the mode being set.
- * When the distortion correction mode is OFF, the coordinate system follows
- * ACAMERA_SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE, with
- * (0, 0)
being the top-left pixel of the pre-correction active array.
- * When the distortion correction mode is not OFF, the coordinate system follows
- * ACAMERA_SENSOR_INFO_ACTIVE_ARRAY_SIZE, with
- * (0, 0)
being the top-left pixel of the active array.
Output streams use this rectangle to produce their output, - * cropping to a smaller region if necessary to maintain the - * stream's aspect ratio, then scaling the sensor input to + *
For devices supporting ACAMERA_DISTORTION_CORRECTION_MODE control, the coordinate system
+ * depends on the mode being set. When the distortion correction mode is OFF, the
+ * coordinate system follows ACAMERA_SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE, with (0,
+ * 0)
being the top-left pixel of the pre-correction active array. When the distortion
+ * correction mode is not OFF, the coordinate system follows
+ * ACAMERA_SENSOR_INFO_ACTIVE_ARRAY_SIZE, with (0, 0)
being the top-left pixel of the
+ * active array.
Output streams use this rectangle to produce their output, cropping to a smaller region + * if necessary to maintain the stream's aspect ratio, then scaling the sensor input to * match the output's configured resolution.
- *The crop region is applied after the RAW to other color - * space (e.g. YUV) conversion. Since raw streams - * (e.g. RAW16) don't have the conversion stage, they are not + *
The crop region is applied after the RAW to other color space (e.g. YUV) + * conversion. Since raw streams (e.g. RAW16) don't have the conversion stage, they are not * croppable. The crop region will be ignored by raw streams.
- *For non-raw streams, any additional per-stream cropping will - * be done to maximize the final pixel area of the stream.
- *For example, if the crop region is set to a 4:3 aspect - * ratio, then 4:3 streams will use the exact crop - * region. 16:9 streams will further crop vertically - * (letterbox).
- *Conversely, if the crop region is set to a 16:9, then 4:3 - * outputs will crop horizontally (pillarbox), and 16:9 - * streams will match exactly. These additional crops will - * be centered within the crop region.
+ *For non-raw streams, any additional per-stream cropping will be done to maximize the + * final pixel area of the stream.
+ *For example, if the crop region is set to a 4:3 aspect ratio, then 4:3 streams will use + * the exact crop region. 16:9 streams will further crop vertically (letterbox).
+ *Conversely, if the crop region is set to a 16:9, then 4:3 outputs will crop horizontally + * (pillarbox), and 16:9 streams will match exactly. These additional crops will be + * centered within the crop region.
+ *To illustrate, here are several scenarios of different crop regions and output streams,
+ * for a hypothetical camera device with an active array of size (2000,1500)
. Note that
+ * several of these examples use non-centered crop regions for ease of illustration; such
+ * regions are only supported on devices with FREEFORM capability
+ * (ACAMERA_SCALER_CROPPING_TYPE == FREEFORM
), but this does not affect the way the crop
+ * rules work otherwise.
2000x1500
(3 MP, 4:3 aspect ratio)640x480
(VGA, 4:3 aspect ratio)1280x720
(720p, 16:9 aspect ratio)Rect(500, 375, 1500, 1125) // (left, top, right, bottom)
640x480
stream source area: (500, 375, 1500, 1125)
(equal to crop region)1280x720
stream source area: (500, 469, 1500, 1031)
(letterboxed)Rect(500, 375, 1833, 1125)
640x480
stream source area: (666, 375, 1666, 1125)
(pillarboxed)1280x720
stream source area: (500, 375, 1833, 1125)
(equal to crop region)Rect(500, 375, 1250, 1125)
640x480
stream source area: (500, 469, 1250, 1031)
(letterboxed)1280x720
stream source area: (500, 543, 1250, 957)
(letterboxed)640x480
stream with 1024x1024
stream, with 4:3 crop region:Rect(500, 375, 1500, 1125)
1024x1024
stream source area: (625, 375, 1375, 1125)
(pillarboxed)1280x720
stream source area: (500, 469, 1500, 1031)
(letterboxed)If the coordinate system is ACAMERA_SENSOR_INFO_ACTIVE_ARRAY_SIZE, the width and height
* of the crop region cannot be set to be smaller than
* floor( activeArraySize.width / ACAMERA_SCALER_AVAILABLE_MAX_DIGITAL_ZOOM )
and
@@ -3320,23 +3362,22 @@ typedef enum acamera_metadata_tag {
* and
* floor( preCorrectionActiveArraySize.height / ACAMERA_SCALER_AVAILABLE_MAX_DIGITAL_ZOOM )
,
* respectively.
The camera device may adjust the crop region to account - * for rounding and other hardware requirements; the final - * crop region used will be included in the output capture - * result.
+ *The camera device may adjust the crop region to account for rounding and other hardware + * requirements; the final crop region used will be included in the output capture result.
*Starting from API level 30, it's strongly recommended to use ACAMERA_CONTROL_ZOOM_RATIO * to take advantage of better support for zoom with logical multi-camera. The benefits * include better precision with optical-digital zoom combination, and ability to do * zoom-out from 1.0x. When using ACAMERA_CONTROL_ZOOM_RATIO for zoom, the crop region in * the capture request must be either letterboxing or pillarboxing (but not both). The * coordinate system is post-zoom, meaning that the activeArraySize or - * preCorrectionActiveArraySize covers the camera device's field of view "after" zoom. - * See ACAMERA_CONTROL_ZOOM_RATIO for details.
+ * preCorrectionActiveArraySize covers the camera device's field of view "after" zoom. See + * ACAMERA_CONTROL_ZOOM_RATIO for details. *The data representation is int[4], which maps to (left, top, width, height).
* * @see ACAMERA_CONTROL_ZOOM_RATIO * @see ACAMERA_DISTORTION_CORRECTION_MODE * @see ACAMERA_SCALER_AVAILABLE_MAX_DIGITAL_ZOOM + * @see ACAMERA_SCALER_CROPPING_TYPE * @see ACAMERA_SENSOR_INFO_ACTIVE_ARRAY_SIZE * @see ACAMERA_SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE */