[−][src]Struct normal_map::NormalMapF64
A mapper than maps a range of values to and from the normalized
f64
range [0.0, 1.0]
.
Fields
mapper: MapperF64
The current mapper in use
Implementations
impl NormalMapF64
[src]
pub fn linear(min: f64, max: f64, unit: Unit) -> Self
[src]
Create a new NormalMap
with linear mapping.
Please note if you use Unit::Decibels
, then the decibels
are what will be linearly mapped, not the raw amplitude.
Arguments
- min - the minimum of the range
- max - the maximum of the range
- unit - the type of unit
pub fn power(min: f64, max: f64, exponent: f64, unit: Unit) -> Self
[src]
Create a new NormalMap
with an exponential mapping where the
normalized value is raised to the supplied exponent.
Please note if you use Unit::Decibels
, then the decibels
are what will be mapped, not the raw amplitude.
Arguments
- min - the minimum of the range
- max - the maximum of the range
- exponent - the exponent to raise the normalized value to
- unit - the type of unit
Panics
- Panics when
exponent = 0.0
.
pub fn log2(min: f64, max: f64) -> Self
[src]
Create a new NormalMap
with a logarithmic mapping using log2
.
Arguments
- min - the minimum of the range, must be > 0.0
- max - the maximum of the range, must be > 0.0
Panics
- Panics when either
min
ormax
<= 0.0.
pub fn discrete<T>(min: T, max: T) -> Self where
T: From<isize> + Into<isize> + Copy + Clone,
[src]
T: From<isize> + Into<isize> + Copy + Clone,
Create a new NormalMap
with a discrete isize
integer range.
A supplied enum may be used as well as long
as it implements From<isize> + Into<isize> + Copy + Clone
.
Arguments
- min - the minimum of the range
- max - the maximum of the range
pub fn normalize(&self, value: f64) -> f64
[src]
Map an f64
value to the normalized range [0.0, 1.0]
.
pub fn normalize_array(&self, in_values: &[f64], out_normalized: &mut [f64])
[src]
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.
pub fn denormalize(&self, normalized: f64) -> f64
[src]
Un-map a normalized value to the corresponding f64
value.
pub fn denormalize_array(&self, in_normalized: &[f64], out_values: &mut [f64])
[src]
Un-map an array of normalized values to the corresponding f64
value.
Values will be processed up to the length of the shortest array.
Auto Trait Implementations
impl RefUnwindSafe for NormalMapF64
impl Send for NormalMapF64
impl Sync for NormalMapF64
impl Unpin for NormalMapF64
impl UnwindSafe for NormalMapF64
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,