Android Guides | Samples

Android.Hardware.Camera2.Params.MeteringRectangle Class

An immutable class to represent a rectangle (x, y, width, height) with an additional weight component.

See Also: MeteringRectangle

Syntax

[Android.Runtime.Register("android/hardware/camera2/params/MeteringRectangle", DoNotGenerateAcw=true)]
public sealed class MeteringRectangle : Object

Remarks

An immutable class to represent a rectangle (x, y, width, height) with an additional weight component.

The rectangle is defined to be inclusive of the specified coordinates.

When used with a CaptureRequest, the coordinate system is based on the active pixel array, with (0,0) being the top-left pixel in the CameraCharacteristics.SensorInfoActiveArraySize, and (android.sensor.info.activeArraySize.width - 1, android.sensor.info.activeArraySize.height - 1) being the bottom-right pixel in the active pixel array.

The weight must range from MeteringRectangle.MeteringWeightMin to MeteringRectangle.MeteringWeightMax inclusively, and represents a weight for every pixel in the area. This means that a large metering area with the same weight as a smaller area will have more effect in the metering result. Metering areas can partially overlap and the camera device will add the weights in the overlap rectangle.

If all rectangles have 0 weight, then no specific metering area needs to be used by the camera device. If the metering rectangle is outside the used android.scaler.cropRegion returned in capture result metadata, the camera device will ignore the sections outside the rectangle and output the used sections in the result metadata.

[Android Documentation]

Requirements

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

The members of Android.Hardware.Camera2.Params.MeteringRectangle are listed below.

See Also: Object

Public Constructors

Create a new metering rectangle.
Create a new metering rectangle.
Create a new metering rectangle.

Public Fields

const
MeteringWeightDontCareInt32 (0). Weights set to this value will cause the camera device to ignore this rectangle.
const
MeteringWeightMaxInt32 (1000). The maximum value of valid metering weight.
const
MeteringWeightMinInt32 (0). The minimum value of valid metering weight.

Public Properties

[read-only]
HeightInt32. Return the height of the rectangle.
[read-only]
MeteringWeightInt32. Return the metering weight of the rectangle.
[read-only]
RectRect. Convenience method to create a Rect from this metering rectangle.
[read-only]
SizeSize. Convenience method to create the size from this metering rectangle.
[read-only]
UpperLeftPointPoint. Convenience method to create the upper-left (X,Y) coordinate as a Point.
[read-only]
WidthInt32. Return the width of the rectangle.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

Equals(MeteringRectangle) : Boolean
Compare two metering rectangles to see if they are equal.
GetX() : Int32
Return the X coordinate of the left side of the rectangle.
GetY() : Int32
Return the Y coordinate of the upper side of the rectangle.