droid_wrap::android::hardware

Struct Camera_CameraInfo

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

关于相机的信息

Implementations§

Source§

impl Camera_CameraInfo

Source

pub const CAMERA_FACING_BACK: i32 = 0i32

相机朝向与屏幕相反。

Source

pub const CAMERA_FACING_FRONT: i32 = 1i32

相机朝向与屏幕相同。

Source

pub fn get_facing(&self) -> i32

获取相机朝向。它应该是 CAMERA_FACING_BACK 或 CAMERA_FACING_FRONT。

Source

pub fn set_facing(&self, value: i32)

设置相机朝向。它应该是 CAMERA_FACING_BACK 或 CAMERA_FACING_FRONT。

Source

pub fn get_orientation(&self) -> i32

获取相机图像的旋转角度。该值表示相机图像需要顺时针旋转多少度,才能在其自然方向上正确显示在显示设备上。它应该是 0、90、180 或 270。 例如,假设一个设备的屏幕是自然竖直的。后置相机的传感器安装在横向。你正在看屏幕。如果相机传感器的顶部边缘与屏幕的自然方向上的右侧边缘对齐,则该值应为 90。如果前置相机的顶部边缘与屏幕的右侧对齐,则该值应为 270。

Source

pub fn set_orientation(&self, value: i32)

设置相机图像的旋转角度。该值表示相机图像需要顺时针旋转多少度,才能在其自然方向上正确显示在显示设备上。它应该是 0、90、180 或 270。 例如,假设一个设备的屏幕是自然竖直的。后置相机的传感器安装在横向。你正在看屏幕。如果相机传感器的顶部边缘与屏幕的自然方向上的右侧边缘对齐,则该值应为 90。如果前置相机的顶部边缘与屏幕的右侧对齐,则该值应为 270。

Source

pub fn get_can_disable_shutter_sound(&self) -> bool

获取是否可以禁用快门声音。 在某些设备上,无法通过 enableShutterSound 禁用相机快门声音。此字段可用于确定禁用快门声音的调用是否成功。 如果此字段设置为 true,则调用 enableShutterSound(false) 将成功。如果设置为 false,则该调用将失败,并且在调用 Camera#takePicture takePicture 时将播放快门声音。

Source

pub fn set_can_disable_shutter_sound(&self, value: bool)

设置是否可以禁用快门声音。 在某些设备上,无法通过 enableShutterSound 禁用相机快门声音。此字段可用于确定禁用快门声音的调用是否成功。 如果此字段设置为 true,则调用 enableShutterSound(false) 将成功。如果设置为 false,则该调用将失败,并且在调用 Camera#takePicture takePicture 时将播放快门声音。

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_CameraInfo

Source§

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

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

impl Deref for Camera_CameraInfo

Source§

type Target = GlobalRef

The resulting type after dereferencing.
Source§

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

Dereferences the value.
Source§

impl From<&GlobalRef> for Camera_CameraInfo

Source§

fn from(obj: &GlobalRef) -> Self

Converts to this type from the input type.
Source§

impl Into<GlobalRef> for &Camera_CameraInfo

Source§

fn into(self) -> GlobalRef

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

impl JObjNew for Camera_CameraInfo

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_CameraInfo

Source§

fn java_ref(&self) -> GlobalRef

获取java对象引用。
Source§

impl JType for Camera_CameraInfo

Source§

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

java类的名称。
Source§

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

对象的签名描述。
Source§

type Error = Error

错误类型。
Source§

const DIM: u8 = 0u8

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

impl PartialEq for Camera_CameraInfo

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_CameraInfo

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.