pub struct LinearMapper { /* private fields */ }Expand description
Implementations§
Source§impl LinearMapper
impl LinearMapper
Sourcepub fn new(range: RangeInclusive<f64>) -> Self
pub fn new(range: RangeInclusive<f64>) -> Self
Create a new linear mapper with the given range.
Trait Implementations§
Source§impl Clone for LinearMapper
impl Clone for LinearMapper
Source§fn clone(&self) -> LinearMapper
fn clone(&self) -> LinearMapper
Returns a duplicate of the value. Read more
1.0.0 · 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 LinearMapper
impl Debug for LinearMapper
Source§impl RangeMapper for LinearMapper
impl RangeMapper for LinearMapper
Source§fn normalize(&self, plain: f64) -> f64
fn normalize(&self, plain: f64) -> f64
Convert a plain value to normalized (0.0-1.0). Read more
Source§fn denormalize(&self, normalized: f64) -> f64
fn denormalize(&self, normalized: f64) -> f64
Convert a normalized value (0.0-1.0) to plain. Read more
Source§fn default_normalized(&self, plain_default: f64) -> f64
fn default_normalized(&self, plain_default: f64) -> f64
Get the default normalized value for a given plain default.
Auto Trait Implementations§
impl Freeze for LinearMapper
impl RefUnwindSafe for LinearMapper
impl Send for LinearMapper
impl Sync for LinearMapper
impl Unpin for LinearMapper
impl UnwindSafe for LinearMapper
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