pub enum ParameterMapping {
Linear,
Exponential,
Logarithmic,
Inverted,
Custom(Arc<dyn Fn(f64) -> f64 + Send + Sync>),
}Expand description
Mapping type for a servo’s output value.
Variants§
Linear
Linear: min + value * (max - min).
Exponential
Exponential: min + value^exp * (max - min).
Logarithmic
Logarithmic: min + log(1 + value * (e - 1)) / log(e) * (max - min).
Inverted
Inverted linear: max - value * (max - min).
Custom(Arc<dyn Fn(f64) -> f64 + Send + Sync>)
Custom mapping function.
Implementations§
Trait Implementations§
Source§impl Clone for ParameterMapping
impl Clone for ParameterMapping
Source§fn clone(&self) -> ParameterMapping
fn clone(&self) -> ParameterMapping
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 moreAuto Trait Implementations§
impl Freeze for ParameterMapping
impl !RefUnwindSafe for ParameterMapping
impl Send for ParameterMapping
impl Sync for ParameterMapping
impl Unpin for ParameterMapping
impl UnsafeUnpin for ParameterMapping
impl !UnwindSafe for ParameterMapping
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