Struct net_ensembles::sampling::CubeHelixParameter[][src]

pub struct CubeHelixParameter { /* fields omitted */ }
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

Performs the conversion.

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

Performs the conversion.

Performs the conversion.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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.