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
< 0low
>= 1high
<= 0high
> 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 the “default value” for a type. Read more
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<CubeHelixParameter, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<CubeHelixParameter, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Performs the conversion.
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for CubeHelixParameter
impl Send for CubeHelixParameter
impl Sync for CubeHelixParameter
impl Unpin for CubeHelixParameter
impl UnwindSafe for CubeHelixParameter
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn cast_trunc(self) -> T
pub fn cast_trunc(self) -> T
Cast to integer, truncating Read more
pub fn cast_nearest(self) -> T
pub fn cast_nearest(self) -> T
Cast to the nearest integer Read more
pub fn cast_floor(self) -> T
pub fn cast_floor(self) -> T
Cast the floor to an integer Read more
pub fn try_cast_trunc(self) -> Result<T, Error>
pub fn try_cast_trunc(self) -> Result<T, Error>
Try converting to integer with truncation Read more
pub fn try_cast_nearest(self) -> Result<T, Error>
pub fn try_cast_nearest(self) -> Result<T, Error>
Try converting to the nearest integer Read more
pub fn try_cast_floor(self) -> Result<T, Error>
pub fn try_cast_floor(self) -> Result<T, Error>
Try converting the floor to an integer Read more
pub fn try_cast_ceil(self) -> Result<T, Error>
pub fn try_cast_ceil(self) -> Result<T, Error>
Try convert the ceiling to an integer Read more