#[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 From<AfMode> for ControlValue
impl From<AfMode> for ControlValue
source§impl TryFrom<ControlValue> for AfMode
impl TryFrom<ControlValue> for AfMode
source§type Error = ControlValueError
type Error = ControlValueError
impl Control for AfMode
impl Copy for AfMode
impl Eq for AfMode
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)