pub struct ScratchGestureMapper { /* private fields */ }Expand description
Converts pointer motion to physical hand setpoints.
Implementations§
Source§impl ScratchGestureMapper
impl ScratchGestureMapper
pub fn new(config: ScratchGestureConfig) -> Result<Self, ScratchGestureError>
pub const fn config(&self) -> ScratchGestureConfig
pub const fn active_pointer_id(&self) -> Option<u64>
pub const fn total_late_shift_frames(&self) -> u64
Sourcepub fn begin(
&mut self,
sample: ScratchPointerSample,
minimum_render_frame: u64,
record_angle_rad: f64,
) -> Result<ScheduledScratchHandControl, ScratchGestureError>
pub fn begin( &mut self, sample: ScratchPointerSample, minimum_render_frame: u64, record_angle_rad: f64, ) -> Result<ScheduledScratchHandControl, ScratchGestureError>
Starts a gesture without moving the record at contact time.
Sourcepub fn update(
&mut self,
sample: ScratchPointerSample,
minimum_render_frame: u64,
) -> Result<ScheduledScratchHandControl, ScratchGestureError>
pub fn update( &mut self, sample: ScratchPointerSample, minimum_render_frame: u64, ) -> Result<ScheduledScratchHandControl, ScratchGestureError>
Maps one move without low-pass filtering a reversal.
Sourcepub fn finish(
&mut self,
pointer_id: u64,
source_time_ns: u64,
minimum_render_frame: u64,
) -> Result<ScheduledScratchHandControl, ScratchGestureError>
pub fn finish( &mut self, pointer_id: u64, source_time_ns: u64, minimum_render_frame: u64, ) -> Result<ScheduledScratchHandControl, ScratchGestureError>
Schedules release and makes the mapper available for another pointer.
pub fn snapshot(&self) -> ScratchGestureSnapshot
pub fn restore( &mut self, snapshot: &ScratchGestureSnapshot, ) -> Result<(), ScratchGestureError>
Trait Implementations§
Source§impl Clone for ScratchGestureMapper
impl Clone for ScratchGestureMapper
Source§fn clone(&self) -> ScratchGestureMapper
fn clone(&self) -> ScratchGestureMapper
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ScratchGestureMapper
impl Debug for ScratchGestureMapper
Source§impl PartialEq for ScratchGestureMapper
impl PartialEq for ScratchGestureMapper
impl StructuralPartialEq for ScratchGestureMapper
Auto Trait Implementations§
impl Freeze for ScratchGestureMapper
impl RefUnwindSafe for ScratchGestureMapper
impl Send for ScratchGestureMapper
impl Sync for ScratchGestureMapper
impl Unpin for ScratchGestureMapper
impl UnsafeUnpin for ScratchGestureMapper
impl UnwindSafe for ScratchGestureMapper
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
Mutably borrows from an owned value. Read more