From 878f9df9e6877e73bee4f510833fc74a4bd3d2fc Mon Sep 17 00:00:00 2001
From: Shuzhen Wang
By using this control, the application gains a simpler way to control zoom, which can - * be a combination of optical and digital zoom. More specifically, for a logical - * multi-camera with more than one focal length, using a floating point zoom ratio offers - * more zoom precision when a telephoto lens is used, as well as allowing zoom ratio of - * less than 1.0 to zoom out to a wide field of view.
- *Note that the coordinate system of cropRegion, AE/AWB/AF regions, and faces now changes - * to the effective after-zoom field-of-view represented by rectangle of (0, 0, - * activeArrayWidth, activeArrayHeight).
- *For example, if ACAMERA_SENSOR_INFO_ACTIVE_ARRAY_SIZE is 4032*3024, and the preview stream - * is configured to the same 4:3 aspect ratio, the application can achieve 2.0x zoom in - * one of two ways:
- *To illustrate, here are several scenarios of different zoom ratios, crop regions,
+ * and output streams, for a hypothetical camera device with an active array of size
+ * (2000,1500)
.
2000x1500
(3 MP, 4:3 aspect ratio)640x480
(VGA, 4:3 aspect ratio)1280x720
(720p, 16:9 aspect ratio)Rect(0, 0, 2000, 1500) // (left, top, right, bottom)
(post zoom)640x480
stream source area: (0, 0, 2000, 1500)
(equal to crop region)1280x720
stream source area: (0, 187, 2000, 1312)
(letterboxed)If the application intends to set aeRegions to be top-left quarter of the preview - * field-of-view, the ACAMERA_CONTROL_AE_REGIONS should be set to (0, 0, 2016, 1512) with + *
Rect(0, 187, 2000, 1312)
640x480
stream source area: (250, 187, 1750, 1312)
(pillarboxed)1280x720
stream source area: (0, 187, 2000, 1312)
(equal to crop region)Rect(250, 0, 1750, 1500)
640x480
stream source area: (250, 187, 1750, 1312)
(letterboxed)1280x720
stream source area: (250, 328, 1750, 1172)
(letterboxed)As seen from the graphs above, the coordinate system of cropRegion now changes to the + * effective after-zoom field-of-view, and is represented by the rectangle of (0, 0, + * activeArrayWith, activeArrayHeight). The same applies to AE/AWB/AF regions, and faces. + * This coordinate system change isn't applicable to RAW capture and its related + * metadata such as intrinsicCalibration and lensShadingMap.
+ *Using the same hypothetical example above, and assuming output stream #1 (640x480) is + * the viewfinder stream, the application can achieve 2.0x zoom in one of two ways:
+ *If the application intends to set aeRegions to be top-left quarter of the viewfinder + * field-of-view, the ACAMERA_CONTROL_AE_REGIONS should be set to (0, 0, 1000, 750) with * zoomRatio set to 2.0. Alternatively, the application can set aeRegions to the equivalent - * region of (1008, 756, 2016, 1512) for zoomRatio of 1.0. If the application doesn't + * region of (500, 375, 1000, 750) for zoomRatio of 1.0. If the application doesn't * explicitly set ACAMERA_CONTROL_ZOOM_RATIO, its value defaults to 1.0.
- *This coordinate system change isn't applicable to RAW capture and its related metadata - * such as intrinsicCalibration and lensShadingMap.
*One limitation of controlling zoom using zoomRatio is that the ACAMERA_SCALER_CROP_REGION * must only be used for letterboxing or pillarboxing of the sensor active array, and no * FREEFORM cropping can be used with ACAMERA_CONTROL_ZOOM_RATIO other than 1.0.
@@ -1923,7 +1962,6 @@ typedef enum acamera_metadata_tag { * @see ACAMERA_CONTROL_AE_REGIONS * @see ACAMERA_CONTROL_ZOOM_RATIO * @see ACAMERA_SCALER_CROP_REGION - * @see ACAMERA_SENSOR_INFO_ACTIVE_ARRAY_SIZE */ ACAMERA_CONTROL_ZOOM_RATIO = // float ACAMERA_CONTROL_START + 47, @@ -2395,8 +2433,11 @@ typedef enum acamera_metadata_tag { * frames before the lens can change to the requested focal length. * While the focal length is still changing, ACAMERA_LENS_STATE will * be set to MOVING. - *Optical zoom will not be supported on most devices.
+ *Optical zoom via this control will not be supported on most devices. Starting from API + * level 30, the camera device may combine optical and digital zoom through the + * ACAMERA_CONTROL_ZOOM_RATIO control.
* + * @see ACAMERA_CONTROL_ZOOM_RATIO * @see ACAMERA_LENS_APERTURE * @see ACAMERA_LENS_FOCUS_DISTANCE * @see ACAMERA_LENS_STATE