Enum libcamera::controls::AfMode

source ·
#[repr(i32)]
pub enum AfMode { Manual = 0, Auto = 1, Continuous = 2, }
Expand description

Control to set the mode of the AF (autofocus) algorithm.

An implementation may choose not to implement all the modes.

Variants§

§

Manual = 0

The AF algorithm is in manual mode. In this mode it will never perform any action nor move the lens of its own accord, but an application can specify the desired lens position using the LensPosition control.

In this mode the AfState will always report AfStateIdle.

If the camera is started in AfModeManual, it will move the focus lens to the position specified by the LensPosition control.

This mode is the recommended default value for the AfMode control. External cameras (as reported by the Location property set to CameraLocationExternal) may use a different default value.

§

Auto = 1

The AF algorithm is in auto mode. This means that the algorithm will never move the lens or change state unless the AfTrigger control is used. The AfTrigger control can be used to initiate a focus scan, the results of which will be reported by AfState.

If the autofocus algorithm is moved from AfModeAuto to another mode while a scan is in progress, the scan is cancelled immediately, without waiting for the scan to finish.

When first entering this mode the AfState will report AfStateIdle. When a trigger control is sent, AfState will report AfStateScanning for a period before spontaneously changing to AfStateFocused or AfStateFailed, depending on the outcome of the scan. It will remain in this state until another scan is initiated by the AfTrigger control. If a scan is cancelled (without changing to another mode), AfState will return to AfStateIdle.

§

Continuous = 2

The AF algorithm is in continuous mode. This means that the lens can re-start a scan spontaneously at any moment, without any user intervention. The AfState still reports whether the algorithm is currently scanning or not, though the application has no ability to initiate or cancel scans, nor to move the lens for itself.

However, applications can pause the AF algorithm from continuously scanning by using the AfPause control. This allows video or still images to be captured whilst guaranteeing that the focus is fixed.

When set to AfModeContinuous, the system will immediately initiate a scan so AfState will report AfStateScanning, and will settle on one of AfStateFocused or AfStateFailed, depending on the scan result.

Trait Implementations§

source§

impl Clone for AfMode

source§

fn clone(&self) -> AfMode

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl ControlEntry for AfMode

source§

const ID: u32 = 28u32

source§

impl Debug for AfMode

source§

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

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

impl From<AfMode> for ControlValue

source§

fn from(val: AfMode) -> Self

Converts to this type from the input type.
source§

impl From<AfMode> for i32

source§

fn from(enum_value: AfMode) -> Self

Converts to this type from the input type.
source§

impl PartialEq for AfMode

source§

fn eq(&self, other: &AfMode) -> 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 TryFrom<ControlValue> for AfMode

source§

type Error = ControlValueError

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

fn try_from(value: ControlValue) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<i32> for AfMode

source§

type Error = TryFromPrimitiveError<AfMode>

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

fn try_from(number: i32) -> Result<Self, TryFromPrimitiveError<Self>>

Performs the conversion.
source§

impl TryFromPrimitive for AfMode

source§

type Primitive = i32

source§

const NAME: &'static str = "AfMode"

source§

fn try_from_primitive( number: Self::Primitive, ) -> Result<Self, TryFromPrimitiveError<Self>>

source§

impl Control for AfMode

source§

impl Copy for AfMode

source§

impl Eq for AfMode

source§

impl StructuralPartialEq for AfMode

Auto Trait Implementations§

§

impl Freeze for AfMode

§

impl RefUnwindSafe for AfMode

§

impl Send for AfMode

§

impl Sync for AfMode

§

impl Unpin for AfMode

§

impl UnwindSafe for AfMode

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> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> DynControlEntry for T
where T: ControlEntry,

source§

fn id(&self) -> u32

source§

fn value(&self) -> ControlValue

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<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.