android-Camera.Area

来源:互联网 发布:淘宝提交营业执照 编辑:程序博客网 时间:2024/04/30 20:18

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.找出多少同时给定相机支持领域,使用getMaxNumMeteringAreas()和getMaxNumFocusAreas()。如果计量或重点区域选择是不支持的,这些方法将返回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.每个区域由一个矩形指定范围,和重量决定了它的重要性。范围是相对于当前视场相机的。坐标映射,以便(-1000、-1000)总是左上角的当前的视野,和(1000、1000)总是当前视场的右下角。设置边界范围之外的地区是不允许的。地区零或消极的宽度或高度是不允许的。

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.重量必须从1到1000,代表了每个像素的重量。这意味着一个大计量领域相同的体重较小的区域计量结果将会有更多的影响。计量领域可以重叠,传感器将重叠区域的权重。

See also:

  • setFocusAreas(List)
  • getFocusAreas()
  • getMaxNumFocusAreas()
  • setMeteringAreas(List)
  • getMeteringAreas()
  • getMaxNumMeteringAreas()

Summary


Fields

publicRectrect

Bounds of the area.范围的区域。

public intweight

Weight of the area.区域的Weight

Public constructors

Camera.Area(Rect rect, int weight)

Create an area with specified rectangle and weight.创建一个与指定的矩形面积和权重。

Public methods

booleanequals(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:

  • getFocusAreas()
  • getMeteringAreas()

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:

  • getFocusAreas()
  • getMeteringAreas()

Public constructors


Camera.Area

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

Create an area with specified rectangle and weight.

ParametersrectRect: the bounds of the area.weightint: the weight of the area.

Public methods


equals

Added in API level 14
boolean equals (Object obj)

Compares obj to this area.

ParametersobjObject: the object to compare this area with.Returnsbooleantrue if the rectangle and weight of obj is the same as those of this area. false otherwise.可以参照这个理解:http://blog.csdn.net/think_soft/article/details/7998478
0 0
原创粉丝点击