pub struct CubeHelixParameter { /* private fields */ }
Expand description

Implements color palett from https://arxiv.org/abs/1108.5083

What’s so good about this palett? It is monotonically increasing in perceived brightness. That means, it is well suited for being printed in black and white.

use sampling::heatmap::*;
let mut params = CubeHelixParameter::default();
params.rotation(1.3)
        .gamma(1.1)
        .start_color(0.3)
        .reverse(true);

Implementations

Builder pattern - set start color

Will panic if the following is false: 0.0 <= s <= 1.0

Builder pattern - set gamma

|gamma| < 1 emphasises low intensity values, |gamma| > 1 high intensity ones

gamma has to be finite - will panic otherwise

Builder pattern - set reverse

reverse: Reverse the cbrange?

Builder pattern - set low and high value

default: low = 0.0, high = 1.0

Maps grayscale range from [0.0, 1.0] -> [low, high]. These are the brightness values used for calculating the palette later on.

Safety

will panic if

  • low >= high
  • low < 0
  • low >= 1
  • high <= 0
  • high > 1

#Set hue intensity. Builder pattern Valid values are 0.0 <= hue <= 1.0. Important Will panic on invalid hue values!

#Set rotation. Builder pattern Rotation in color space. The higher the value, the quicker the colors will change in the palett.

Normally the range used is -1.5 <= rotation <= 1.5. Invalid values are Nan, or ±Infinity Important Will panic on invalid rotation values!

Calculate color from gray value. Gray value should be in the interval [0.0,1.0].

Will return [red, green, blue], where red, green and blue are in [0.0, 1.0], will return [0,0,0] for NAN gray value.

  • Calculate color from gray value.
  • Gray value should be in the interval [0.0,1.0].
  • will return ColorRgb::new(0,0,0) for NAN gray value

will return corresponding (approximate) ColorRgb

Converts self into the corresponding enum of GnuplotPallet

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Deserialize this value from the given Serde deserializer. Read more
Converts to this type from the input type.
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Cast from Self to T
Try converting from Self to T
Cast to integer, truncating Read more
Cast to the nearest integer Read more
Cast the floor to an integer Read more
Cast the ceiling to an integer Read more
Try converting to integer with truncation Read more
Try converting to the nearest integer Read more
Try converting the floor to an integer Read more
Try convert the ceiling to an integer Read more
Convert from T to Self
Try converting from T to Self

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.