diff --git a/core/java/android/hardware/camera2/CameraCharacteristics.java b/core/java/android/hardware/camera2/CameraCharacteristics.java index c47498d989246..4f9055bb3ecdd 100644 --- a/core/java/android/hardware/camera2/CameraCharacteristics.java +++ b/core/java/android/hardware/camera2/CameraCharacteristics.java @@ -1999,70 +1999,6 @@ public final class CameraCharacteristics extends CameraMetadata SENSOR_INFO_ACTIVE_ARRAY_SIZE = new Key("android.sensor.info.activeArraySize", android.graphics.Rect.class); - /** - *

The area of the image sensor which corresponds to active pixels prior to the - * application of any geometric distortion correction.

- *

This is the rectangle representing the size of the active region of the sensor (i.e. - * the region that actually receives light from the scene) before any geometric correction - * has been applied, and should be treated as the active region rectangle for any of the - * raw formats. All metadata associated with raw processing (e.g. the lens shading - * correction map, and radial distortion fields) treats the top, left of this rectangle as - * the origin, (0,0).

- *

The size of this region determines the maximum field of view and the maximum number of - * pixels that an image from this sensor can contain, prior to the application of - * geometric distortion correction. The effective maximum pixel dimensions of a - * post-distortion-corrected image is given by the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} - * field, and the effective maximum field of view for a post-distortion-corrected image - * can be calculated by applying the geometric distortion correction fields to this - * rectangle, and cropping to the rectangle given in {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.

- *

E.g. to calculate position of a pixel, (x,y), in a processed YUV output image with the - * dimensions in {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} given the position of a pixel, - * (x', y'), in the raw pixel array with dimensions give in - * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}:

- *
    - *
  1. Choose a pixel (x', y') within the active array region of the raw buffer given in - * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, otherwise this pixel is considered - * to be outside of the FOV, and will not be shown in the processed output image.
  2. - *
  3. Apply geometric distortion correction to get the post-distortion pixel coordinate, - * (x_i, y_i). When applying geometric correction metadata, note that metadata for raw - * buffers is defined relative to the top, left of the - * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} rectangle.
  4. - *
  5. If the resulting corrected pixel coordinate is within the region given in - * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, then the position of this pixel in the - * processed output image buffer is (x_i - activeArray.left, y_i - activeArray.top), - * when the top, left coordinate of that buffer is treated as (0, 0).
  6. - *
- *

Thus, for pixel x',y' = (25, 25) on a sensor where {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize} - * is (100,100), {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} is (10, 10, 100, 100), - * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} is (20, 20, 80, 80), and the geometric distortion - * correction doesn't change the pixel coordinate, the resulting pixel selected in - * pixel coordinates would be x,y = (25, 25) relative to the top,left of the raw buffer - * with dimensions given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}, and would be (5, 5) - * relative to the top,left of post-processed YUV output buffer with dimensions given in - * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.

- *

The currently supported fields that correct for geometric distortion are:

- *
    - *
  1. android.lens.radialDistortion.
  2. - *
- *

If all of the geometric distortion fields are no-ops, this rectangle will be the same - * as the post-distortion-corrected rectangle given in - * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.

- *

This rectangle is defined relative to the full pixel array; (0,0) is the top-left of - * the full pixel array, and the size of the full pixel array is given by - * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.

- *

The pre-correction active array may be smaller than the full pixel array, since the - * full array may include black calibration pixels or other inactive regions.

- *

Units: Pixel coordinates on the image sensor

- *

This key is available on all devices.

- * - * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE - * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE - * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE - */ - @PublicKey - public static final Key SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE = - new Key("android.sensor.info.preCorrectionActiveArraySize", android.graphics.Rect.class); - /** *

Range of sensitivities for {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} supported by this * camera device.

@@ -2251,6 +2187,70 @@ public final class CameraCharacteristics extends CameraMetadata SENSOR_INFO_LENS_SHADING_APPLIED = new Key("android.sensor.info.lensShadingApplied", boolean.class); + /** + *

The area of the image sensor which corresponds to active pixels prior to the + * application of any geometric distortion correction.

+ *

This is the rectangle representing the size of the active region of the sensor (i.e. + * the region that actually receives light from the scene) before any geometric correction + * has been applied, and should be treated as the active region rectangle for any of the + * raw formats. All metadata associated with raw processing (e.g. the lens shading + * correction map, and radial distortion fields) treats the top, left of this rectangle as + * the origin, (0,0).

+ *

The size of this region determines the maximum field of view and the maximum number of + * pixels that an image from this sensor can contain, prior to the application of + * geometric distortion correction. The effective maximum pixel dimensions of a + * post-distortion-corrected image is given by the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} + * field, and the effective maximum field of view for a post-distortion-corrected image + * can be calculated by applying the geometric distortion correction fields to this + * rectangle, and cropping to the rectangle given in {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.

+ *

E.g. to calculate position of a pixel, (x,y), in a processed YUV output image with the + * dimensions in {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} given the position of a pixel, + * (x', y'), in the raw pixel array with dimensions give in + * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}:

+ *
    + *
  1. Choose a pixel (x', y') within the active array region of the raw buffer given in + * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, otherwise this pixel is considered + * to be outside of the FOV, and will not be shown in the processed output image.
  2. + *
  3. Apply geometric distortion correction to get the post-distortion pixel coordinate, + * (x_i, y_i). When applying geometric correction metadata, note that metadata for raw + * buffers is defined relative to the top, left of the + * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} rectangle.
  4. + *
  5. If the resulting corrected pixel coordinate is within the region given in + * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, then the position of this pixel in the + * processed output image buffer is (x_i - activeArray.left, y_i - activeArray.top), + * when the top, left coordinate of that buffer is treated as (0, 0).
  6. + *
+ *

Thus, for pixel x',y' = (25, 25) on a sensor where {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize} + * is (100,100), {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} is (10, 10, 100, 100), + * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} is (20, 20, 80, 80), and the geometric distortion + * correction doesn't change the pixel coordinate, the resulting pixel selected in + * pixel coordinates would be x,y = (25, 25) relative to the top,left of the raw buffer + * with dimensions given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}, and would be (5, 5) + * relative to the top,left of post-processed YUV output buffer with dimensions given in + * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.

+ *

The currently supported fields that correct for geometric distortion are:

+ *
    + *
  1. android.lens.radialDistortion.
  2. + *
+ *

If all of the geometric distortion fields are no-ops, this rectangle will be the same + * as the post-distortion-corrected rectangle given in + * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.

+ *

This rectangle is defined relative to the full pixel array; (0,0) is the top-left of + * the full pixel array, and the size of the full pixel array is given by + * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.

+ *

The pre-correction active array may be smaller than the full pixel array, since the + * full array may include black calibration pixels or other inactive regions.

+ *

Units: Pixel coordinates on the image sensor

+ *

This key is available on all devices.

+ * + * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE + * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE + * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE + */ + @PublicKey + public static final Key SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE = + new Key("android.sensor.info.preCorrectionActiveArraySize", android.graphics.Rect.class); + /** *

The standard reference illuminant used as the scene light source when * calculating the {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM1 android.sensor.colorTransform1},