Android.Hardware.Camera2.CaptureResult.ScalerCropRegion Property

Syntax

[Android.Runtime.Register("SCALER_CROP_REGION")]
public static CaptureResult.Key ScalerCropRegion { get; }

See Also

CameraCharacteristics.ScalerAvailableMaxDigitalZoom
CameraCharacteristics.SensorInfoActiveArraySize

Value

Documentation for this section has not yet been entered.

Remarks

The desired region of the sensor to read out for this capture.

This control can be used to implement digital zoom.

The crop region coordinate system is based off CameraCharacteristics.SensorInfoActiveArraySize, with (0, 0) being the top-left corner of the sensor 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 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.

The width and height of the crop region cannot be set to be smaller than floor( activeArraySize.width / CameraCharacteristics.ScalerAvailableMaxDigitalZoom ) and floor( activeArraySize.height / CameraCharacteristics.ScalerAvailableMaxDigitalZoom ), 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.

Units: Pixel coordinates relative to CameraCharacteristics.SensorInfoActiveArraySize

This key is available on all devices.

[Android Documentation]

Requirements

Namespace: Android.Hardware.Camera2
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0