#include <genesis/utils/color/norm_diverging.hpp>
Inherits ColorNormalizationLinear.
Color normalization for a diverging scale.
The min() and max() values determine the boundaries of the range of allowed values; they map to the first and last entry of the palette, respectively. The mid() value is used as the "neutral" value in the range of allowed values, that is, it maps to the central color of the palette.
In other words, values in [ min, mid ]
are mapped to the first half of the palette, and values in [ mid, max ]
to the second half:
palette |----|----| / \ \ / \ \ |---------|---| min mid max
Values outside of the allowed range [ min, max ]
, as well as non-finite values, are treated according to the settings clip_under(), clip_over(), mask_value(), mask_color(), under_color(), over_color().
Definition at line 71 of file norm_diverging.hpp.
Public Member Functions | |
ColorNormalizationDiverging () | |
Constructor that sets min == -1.0 , mid = 0.0 and max == 1.0 . More... | |
ColorNormalizationDiverging (ColorNormalizationDiverging &&)=default | |
ColorNormalizationDiverging (ColorNormalizationDiverging const &)=default | |
ColorNormalizationDiverging (double min, double max) | |
Constructor that sets min() and max() to the provided values, and mid() to their midpoint. More... | |
ColorNormalizationDiverging (double min, double mid, double max) | |
Constructor that sets min(), mid() and max() to the provided values, in that order. More... | |
template<class ForwardIterator > | |
ColorNormalizationDiverging (ForwardIterator first, ForwardIterator last) | |
Constructor that sets min() and max() to the min and max of the provided range, and mid() to their midpoint. More... | |
ColorNormalizationDiverging (std::vector< double > const &values) | |
Constructor that sets min() and max() to the min and max of the provided values , and mid() to their midpoint. More... | |
virtual | ~ColorNormalizationDiverging () override=default |
ColorNormalizationDiverging & | make_centric (double center=0.0) |
Make the range symmetric around a center value. More... | |
double | mid_value () const |
Mid-point value, that is, where the middle value of a diverging_color() is. More... | |
ColorNormalizationDiverging & | mid_value (double value) |
Mid-point value, that is, where the middle value of a diverging_color() is. More... | |
ColorNormalizationDiverging & | operator= (ColorNormalizationDiverging &&)=default |
ColorNormalizationDiverging & | operator= (ColorNormalizationDiverging const &)=default |
Public Member Functions inherited from ColorNormalizationLinear | |
ColorNormalizationLinear ()=default | |
Constructor that sets min == 0.0 and max == 1.0 . More... | |
ColorNormalizationLinear (ColorNormalizationLinear &&)=default | |
ColorNormalizationLinear (ColorNormalizationLinear const &)=default | |
ColorNormalizationLinear (double min, double max) | |
Constructor that sets min() and max() to the provided values. More... | |
template<class ForwardIterator > | |
ColorNormalizationLinear (ForwardIterator first, ForwardIterator last) | |
Constructor that sets min() and max() to the min and max of the provided range. More... | |
ColorNormalizationLinear (std::vector< double > const &values) | |
Constructor that sets min() and max() to the min and max of the provided values . More... | |
virtual | ~ColorNormalizationLinear () override=default |
template<class ForwardIterator > | |
ColorNormalizationLinear & | autoscale (ForwardIterator first, ForwardIterator last) |
Set the min and max of the Palette so that they reflect the min and max valid values that are found in the range [ first, last ) . More... | |
ColorNormalizationLinear & | autoscale (std::vector< double > const &values) |
template<class ForwardIterator > | |
ColorNormalizationLinear & | autoscale_max (ForwardIterator first, ForwardIterator last) |
Same as autoscale(), but only updates the max_value(). More... | |
ColorNormalizationLinear & | autoscale_max (std::vector< double > const &values) |
template<class ForwardIterator > | |
ColorNormalizationLinear & | autoscale_min (ForwardIterator first, ForwardIterator last) |
Same as autoscale(), but only updates the min_value(). More... | |
ColorNormalizationLinear & | autoscale_min (std::vector< double > const &values) |
double | max_value () const |
Minimum value, that is, where to end the color scale. More... | |
ColorNormalizationLinear & | max_value (double value) |
Minimum value, that is, where to end the color scale. More... | |
double | min_value () const |
Minimum value, that is, where to begin the color scale. More... | |
ColorNormalizationLinear & | min_value (double value) |
Minimum value, that is, where to begin the color scale. More... | |
ColorNormalizationLinear & | operator= (ColorNormalizationLinear &&)=default |
ColorNormalizationLinear & | operator= (ColorNormalizationLinear const &)=default |
ColorNormalizationLinear & | scale (double min, double max) |
Public Member Functions inherited from ColorNormalization | |
ColorNormalization ()=default | |
ColorNormalization (ColorNormalization &&)=default | |
ColorNormalization (ColorNormalization const &)=default | |
virtual | ~ColorNormalization ()=default |
bool | is_valid () const |
Return whether ranges and other values are correct. More... | |
double | mask_value () const |
Mask value that identifies invalid values. More... | |
ColorNormalization & | mask_value (double value) |
Mask value that identifies invalid values. More... | |
double | operator() (double value) const |
Normalize a value into range [ 0.0, 1.0 ] . More... | |
template<class ForwardIterator > | |
std::vector< double > | operator() (ForwardIterator first, ForwardIterator last) const |
Return the normalized values for a range of values. More... | |
std::vector< double > | operator() (std::vector< double > const &values) const |
Return the normalized values for a vector of values . More... | |
ColorNormalization & | operator= (ColorNormalization &&)=default |
ColorNormalization & | operator= (ColorNormalization const &)=default |
Protected Member Functions | |
virtual bool | is_valid_ () const override |
Return whether the ranges are correct. More... | |
virtual void | is_valid_or_throw_ () const override |
Throw if the ranges are incorrect. More... | |
virtual double | normalize_ (double value) const override |
Normalization function. More... | |
virtual void | update_hook_ (double min, double max) override |
Called whenever the min and max are set automatically. Gives derived classes a chance to update their values. More... | |
Protected Member Functions inherited from ColorNormalizationLinear | |
template<class ForwardIterator > | |
ColorNormalizationLinear & | autoscale_ (ForwardIterator first, ForwardIterator last, bool set_min, bool set_max) |
|
inline |
Constructor that sets min == -1.0
, mid = 0.0
and max == 1.0
.
Definition at line 83 of file norm_diverging.hpp.
|
inline |
Constructor that sets min() and max() to the provided values, and mid() to their midpoint.
Definition at line 92 of file norm_diverging.hpp.
|
inline |
Constructor that sets min(), mid() and max() to the provided values, in that order.
Definition at line 99 of file norm_diverging.hpp.
|
inlineexplicit |
Constructor that sets min() and max() to the min and max of the provided values
, and mid() to their midpoint.
Definition at line 110 of file norm_diverging.hpp.
|
inline |
Constructor that sets min() and max() to the min and max of the provided range, and mid() to their midpoint.
Definition at line 120 of file norm_diverging.hpp.
|
overridevirtualdefault |
|
default |
|
default |
|
inlineoverrideprotectedvirtual |
Return whether the ranges are correct.
Reimplemented from ColorNormalizationLinear.
Definition at line 187 of file norm_diverging.hpp.
|
inlineoverrideprotectedvirtual |
Throw if the ranges are incorrect.
Reimplemented from ColorNormalizationLinear.
Definition at line 195 of file norm_diverging.hpp.
|
inline |
Make the range symmetric around a center value.
For example, if autoscale() yielded min == -0.89
and max == 0.95
, then calling this function with center == 0.0
sets min == -0.95
and mid == 0.0
;
Definition at line 155 of file norm_diverging.hpp.
|
inline |
Mid-point value, that is, where the middle value of a diverging_color() is.
Definition at line 140 of file norm_diverging.hpp.
|
inline |
Mid-point value, that is, where the middle value of a diverging_color() is.
Definition at line 172 of file norm_diverging.hpp.
|
inlineoverrideprotectedvirtual |
Normalization function.
Return a value in range [ 0.0, 1.0 ]
. Derived classes can override this to provide their specific normalization.
Reimplemented from ColorNormalizationLinear.
Definition at line 208 of file norm_diverging.hpp.
|
default |
|
default |
|
inlineoverrideprotectedvirtual |
Called whenever the min and max are set automatically. Gives derived classes a chance to update their values.
Reimplemented from ColorNormalizationLinear.
Definition at line 227 of file norm_diverging.hpp.