Compartilhar via


MeteringRectangle Class

Definition

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

[Android.Runtime.Register("android/hardware/camera2/params/MeteringRectangle", DoNotGenerateAcw=true)]
public sealed class MeteringRectangle : Java.Lang.Object
[<Android.Runtime.Register("android/hardware/camera2/params/MeteringRectangle", DoNotGenerateAcw=true)>]
type MeteringRectangle = class
    inherit Object
Inheritance
MeteringRectangle
Attributes

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#SENSOR_INFO_ACTIVE_ARRAY_SIZE active pixel array, 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 #METERING_WEIGHT_MIN to #METERING_WEIGHT_MAX 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.

Java documentation for android.hardware.camera2.params.MeteringRectangle.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

MeteringRectangle(Int32, Int32, Int32, Int32, Int32)

Create a new metering rectangle.

MeteringRectangle(Point, Size, Int32)

Create a new metering rectangle.

MeteringRectangle(Rect, Int32)

Create a new metering rectangle.

Fields

MeteringWeightDontCare

Weights set to this value will cause the camera device to ignore this rectangle.

MeteringWeightMax

The maximum value of valid metering weight.

MeteringWeightMin

The minimum value of valid metering weight.

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
Height

Return the height of the rectangle.

JniIdentityHashCode (Inherited from Object)
JniPeerMembers
MeteringWeight

Return the metering weight of the rectangle.

PeerReference (Inherited from Object)
Rect

Convenience method to create a Rect from this metering rectangle.

Size

Convenience method to create the size from this metering rectangle.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
UpperLeftPoint

Convenience method to create the upper-left (X,Y) coordinate as a Point.

Width

Return the width of the rectangle.

Methods

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(MeteringRectangle)

Compare two metering rectangles to see if they are equal.

Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetX()

Return the X coordinate of the left side of the rectangle.

GetY()

Return the Y coordinate of the upper side of the rectangle.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to