droid_wrap::android::hardware

Struct Camera_Area

Source
pub struct Camera_Area { /* private fields */ }
👎Deprecated: 我们建议对新应用程序使用新的 android.hardware.camera2 API。
Expand description

Area 类用于选择相机在计算自动曝光、自动白平衡和自动对焦时使用的特定测光和对焦区域。 要了解给定相机支持多少个同时区域,请使用 Camera.Parameters.getMaxNumMeteringAreas() 和 Camera.Parameters.getMaxNumFocusAreas()。 如果不支持测光或对焦区域选择,这些方法将返回 0。每个 Area 都由一个指定其边界的矩形和一个确定其重要性的权重组成。 边界与相机的当前视野有关。坐标的映射方式是 (-1000, -1000) 始终是当前视野的左上角,而 (1000, 1000) 始终是当前视野的右下角。 不允许设置边界超出该范围的区域。不允许设置宽度或高度为零或负数的区域。权重必须在 1 到 1000 之间,表示区域中每个像素的权重。 这意味着具有相同权重的较大测光区域与较小区域的测光区域对测光结果的影响更大。测光区域可以重叠,驱动程序将在重叠区域添加权重。

Implementations§

Source§

impl Camera_Area

Source

pub fn new(rect: &Rect, weight: i32) -> Self

创建一个具有指定矩形和权重的区域。 rect 区域的边界。 weight 区域的权重。

Source

pub fn get_rect(&self) -> Rect

获取区域的边界。(-1000, -1000) 表示摄像头视野的左上角,(1000, 1000) 表示视野的右下角。不允许设置超出该范围的边界。不允许使用宽度或高度为零或负值的边界。

Source

pub fn set_rect(&self, value: &Rect)

设置区域的边界。(-1000, -1000) 表示摄像头视野的左上角,(1000, 1000) 表示视野的右下角。不允许设置超出该范围的边界。不允许使用宽度或高度为零或负值的边界。

Source

pub fn get_weight(&self) -> i32

获取区域的权重。权重必须在 1 到 1000 之间,表示区域中每个像素的权重。这意味着,具有相同权重的较大测光区域与较小区域的测光区域对测光结果的影响更大。测光区域可以重叠,驱动程序将在重叠区域添加权重。

Source

pub fn set_weight(&self, value: i32)

设置区域的权重。权重必须在 1 到 1000 之间,表示区域中每个像素的权重。这意味着,具有相同权重的较大测光区域与较小区域的测光区域对测光结果的影响更大。测光区域可以重叠,驱动程序将在重叠区域添加权重。

Methods from Deref<Target = GlobalRef>§

Source

pub fn as_obj(&self) -> &JObject<'static>

Get the object from the global ref

This borrows the ref and prevents it from being dropped as long as the JObject sticks around.

Methods from Deref<Target = JObject<'static>>§

Source

pub fn as_raw(&self) -> *mut _jobject

Returns the raw JNI pointer.

Trait Implementations§

Source§

impl Debug for Camera_Area

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Deref for Camera_Area

Source§

type Target = GlobalRef

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl From<&GlobalRef> for Camera_Area

Source§

fn from(obj: &GlobalRef) -> Self

Converts to this type from the input type.
Source§

impl Into<GlobalRef> for &Camera_Area

Source§

fn into(self) -> GlobalRef

Converts this type into the (usually inferred) input type.
Source§

impl JObjNew for Camera_Area

Source§

type Fields = ()

字段类型
Source§

fn _new(this: &GlobalRef, fields: Self::Fields) -> Self

从java对象创建本地对象。 this java对象引用。
Source§

fn null() -> Self
where Self: Sized, Self::Fields: Default,

创建空对象。
Source§

impl JObjRef for Camera_Area

Source§

fn java_ref(&self) -> GlobalRef

获取java对象引用。
Source§

impl JType for Camera_Area

Source§

const CLASS: &'static str = "android/hardware/Camera$Area"

java类的名称。
Source§

const OBJECT_SIG: &'static str = "Landroid/hardware/Camera$Area;"

对象的签名描述。
Source§

type Error = Error

错误类型。
Source§

const DIM: u8 = 0u8

数组维度,0表示不是数组
Source§

impl PartialEq for Camera_Area

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl ToString for Camera_Area

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.