Enum scarlet::colormap::NormalizeMapping [] [src]

pub enum NormalizeMapping {
    Linear,
    Cbrt,
    Generic(fn(_: f64) -> f64),
}

A struct that describes different transformations of the numbers between 0 and 1 to themselves, used for controlling the linearity or nonlinearity of gradients.

Variants

A normal linear mapping: each number maps to itself.

A cube root mapping: 1/8 would map to 1/2, for example. This has the effect of emphasizing the differences in the low end of the range, which is useful for some data like sound intensity that isn't perceived linearly.

A generic mapping, taking as a value any function or closure that maps the integers from 0-1 to the same range. This should never fail.

Methods

impl NormalizeMapping
[src]

[src]

Performs the given mapping on an input number, with undefined behavior or panics if the given number is outside of the range (0, 1). Given an input between 0 and 1, should always output another number in the same range.

Trait Implementations

impl Debug for NormalizeMapping
[src]

[src]

Formats the value using the given formatter.

impl PartialEq for NormalizeMapping
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Clone for NormalizeMapping
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more