pub struct Log2Map { /* private fields */ }Expand description
Logarithmic mapping using log2. This is useful for frequency (Hz) values.
Implementations§
Source§impl Log2Map
impl Log2Map
Sourcepub fn normalize(&self, value: f64) -> f64
pub fn normalize(&self, value: f64) -> f64
Map an f64 value to the normalized range [0.0, 1.0].
Sourcepub fn normalize_array(&self, in_values: &[f64], out_normalized: &mut [f64])
pub fn normalize_array(&self, in_values: &[f64], out_normalized: &mut [f64])
Map an array of f64 values to the normalized range [0.0, 1.0].
Values will be processed up to the length of the shortest array.
Sourcepub fn denormalize(&self, normalized: f64) -> f64
pub fn denormalize(&self, normalized: f64) -> f64
Un-map a normalized value to the corresponding f64 value.
Sourcepub fn denormalize_array(&self, in_normalized: &[f64], out_values: &mut [f64])
pub fn denormalize_array(&self, in_normalized: &[f64], out_values: &mut [f64])
Un-map an array of normalized values to the corresponding f64 value.
Values will be processed up to the length of the shortest array.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Log2Map
impl RefUnwindSafe for Log2Map
impl Send for Log2Map
impl Sync for Log2Map
impl Unpin for Log2Map
impl UnsafeUnpin for Log2Map
impl UnwindSafe for Log2Map
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