#[repr(C)]
pub struct GestureRecognizer<const RES_X: usize, const RES_Y: usize, const HISTORY_SIZE: usize> { /* private fields */ }
Expand description

The gesture recognizer.

Is initially configured through parameters and gets fed measurements and time and predicts gestures.

Implementations§

source§

impl<const RES_X: usize, const RES_Y: usize, const HISTORY_SIZE: usize> GestureRecognizer<RES_X, RES_Y, HISTORY_SIZE>

source

pub fn new(params: RecognizerParams, sensor_params: SensorParams) -> Self

A new gesture recognizer initialized with the given parameters.

The sensor parameters have preconfigured defaults for common TOF-Sensors such as the ST VL53L5CX.

source

pub fn reset( &mut self, params: RecognizerParams, sensor_params: SensorParams, now: u32 ) -> RecognizerStatus

Resets the gesture recognizer with the given parameters.

Clears the history, ongoing predictions and resets the internal state.

source

pub fn update( &mut self, measurement: SensorMeasurement<RES_X, RES_Y>, result: &mut RecognizerResult ) -> RecognizerStatus

Updates the gesture recognizer with a new measurement and time.

The time in the measurement must be monotonically increasing (usually coming from a systick timer).

source

pub fn sensor_params(&self) -> SensorParams

Gets the current configured sensor parameters.

source

pub fn params(&self) -> RecognizerParams

Gets the current configured gesture recognizer parameters.

Trait Implementations§

source§

impl<const RES_X: usize, const RES_Y: usize, const HISTORY_SIZE: usize> Clone for GestureRecognizer<RES_X, RES_Y, HISTORY_SIZE>

source§

fn clone(&self) -> GestureRecognizer<RES_X, RES_Y, HISTORY_SIZE>

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<const RES_X: usize, const RES_Y: usize, const HISTORY_SIZE: usize> Debug for GestureRecognizer<RES_X, RES_Y, HISTORY_SIZE>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<const RES_X: usize, const RES_Y: usize, const HISTORY_SIZE: usize> RefUnwindSafe for GestureRecognizer<RES_X, RES_Y, HISTORY_SIZE>

§

impl<const RES_X: usize, const RES_Y: usize, const HISTORY_SIZE: usize> Send for GestureRecognizer<RES_X, RES_Y, HISTORY_SIZE>

§

impl<const RES_X: usize, const RES_Y: usize, const HISTORY_SIZE: usize> Sync for GestureRecognizer<RES_X, RES_Y, HISTORY_SIZE>

§

impl<const RES_X: usize, const RES_Y: usize, const HISTORY_SIZE: usize> Unpin for GestureRecognizer<RES_X, RES_Y, HISTORY_SIZE>

§

impl<const RES_X: usize, const RES_Y: usize, const HISTORY_SIZE: usize> UnwindSafe for GestureRecognizer<RES_X, RES_Y, HISTORY_SIZE>

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<T, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.