[][src]Struct normal_map::Log2MapF32

pub struct Log2MapF32 { /* fields omitted */ }

Logarithmic mapping using log2

Implementations

impl Log2MapF32[src]

pub fn new(min: f32, max: f32) -> Self[src]

Create a new LogMap for 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 or max <= 0.0.

pub fn normalize(&self, value: f32) -> f32[src]

Map an f32 value to the normalized range [0.0, 1.0].

pub fn normalize_array(&self, in_values: &[f32], out_normalized: &mut [f32])[src]

Map an array of f32 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: f32) -> f32[src]

Un-map a normalized value to the corresponding f32 value.

pub fn denormalize_array(&self, in_normalized: &[f32], out_values: &mut [f32])[src]

Un-map an array of normalized values to the corresponding f32 value.

Values will be processed up to the length of the shortest array.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.