#[repr(i32)]pub enum AfState {
Idle = 0,
Scanning = 1,
Focused = 2,
Failed = 3,
}
Expand description
Reports the current state of the AF algorithm in conjunction with the reported AfMode value and (in continuous AF mode) the AfPauseState value. The possible state changes are described below, though we note the following state transitions that occur when the AfMode is changed.
If the AfMode is set to AfModeManual, then the AfState will always report AfStateIdle (even if the lens is subsequently moved). Changing to the AfModeManual state does not initiate any lens movement.
If the AfMode is set to AfModeAuto then the AfState will report AfStateIdle. However, if AfModeAuto and AfTriggerStart are sent together then AfState will omit AfStateIdle and move straight to AfStateScanning (and start a scan).
If the AfMode is set to AfModeContinuous then the AfState will initially report AfStateScanning.
Variants§
Idle = 0
The AF algorithm is in manual mode (AfModeManual) or in auto mode (AfModeAuto) and a scan has not yet been triggered, or an in-progress scan was cancelled.
Scanning = 1
The AF algorithm is in auto mode (AfModeAuto), and a scan has been started using the AfTrigger control. The scan can be cancelled by sending AfTriggerCancel at which point the algorithm will either move back to AfStateIdle or, if the scan actually completes before the cancel request is processed, to one of AfStateFocused or AfStateFailed.
Alternatively the AF algorithm could be in continuous mode (AfModeContinuous) at which point it may enter this state spontaneously whenever it determines that a rescan is needed.
Focused = 2
The AF algorithm is in auto (AfModeAuto) or continuous (AfModeContinuous) mode and a scan has completed with the result that the algorithm believes the image is now in focus.
Failed = 3
The AF algorithm is in auto (AfModeAuto) or continuous (AfModeContinuous) mode and a scan has completed with the result that the algorithm did not find a good focus position.
Trait Implementations§
source§impl From<AfState> for ControlValue
impl From<AfState> for ControlValue
source§impl TryFrom<ControlValue> for AfState
impl TryFrom<ControlValue> for AfState
source§type Error = ControlValueError
type Error = ControlValueError
impl Control for AfState
impl Copy for AfState
impl Eq for AfState
impl StructuralPartialEq for AfState
Auto Trait Implementations§
impl Freeze for AfState
impl RefUnwindSafe for AfState
impl Send for AfState
impl Sync for AfState
impl Unpin for AfState
impl UnwindSafe for AfState
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
)