Most visited

Recently visited

Added in API level 14
Deprecated since API level 21

Camera.Area

public static class Camera.Area
extends Object

java.lang.Object
   ↳ android.hardware.Camera.Area


This class was deprecated in API level 21.
We recommend using the new android.hardware.camera2 API for new applications.

The Area class is used for choosing specific metering and focus areas for the camera to use when calculating auto-exposure, auto-white balance, and auto-focus.

To find out how many simultaneous areas a given camera supports, use getMaxNumMeteringAreas() and getMaxNumFocusAreas(). If metering or focusing area selection is unsupported, these methods will return 0.

Each Area consists of a rectangle specifying its bounds, and a weight that determines its importance. The bounds are relative to the camera's current field of view. The coordinates are mapped so that (-1000, -1000) is always the top-left corner of the current field of view, and (1000, 1000) is always the bottom-right corner of the current field of view. Setting Areas with bounds outside that range is not allowed. Areas with zero or negative width or height are not allowed.

The weight must range from 1 to 1000, 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 overlap and the driver will add the weights in the overlap region.

See also:

Summary

Fields

public Rect rect

Bounds of the area.

public int weight

Weight of the area.

Public constructors

Camera.Area(Rect rect, int weight)

Create an area with specified rectangle and weight.

Public methods

boolean equals(Object obj)

Compares obj to this area.

Inherited methods

From class java.lang.Object

Fields

rect

Added in API level 14
Rect rect

Bounds of the area. (-1000, -1000) represents the top-left of the camera field of view, and (1000, 1000) represents the bottom-right of the field of view. Setting bounds outside that range is not allowed. Bounds with zero or negative width or height are not allowed.

See also:

weight

Added in API level 14
int weight

Weight of the area. The weight must range from 1 to 1000, 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 overlap and the driver will add the weights in the overlap region.

See also:

Public constructors

Camera.Area

Added in API level 14
Camera.Area (Rect rect, 
                int weight)

Create an area with specified rectangle and weight.

Parameters
rect Rect: the bounds of the area.
weight int: the weight of the area.

Public methods

equals

Added in API level 14
boolean equals (Object obj)

Compares obj to this area.

Parameters
obj Object: the object to compare this area with.
Returns
boolean true if the rectangle and weight of obj is the same as those of this area. false otherwise.

Hooray!