A toolkit for working with phylogenetic data.
v0.19.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ColorNormalizationLinear Class Reference

#include <genesis/utils/tools/color/norm_linear.hpp>

Inherits ColorNormalization.

Inherited by ColorNormalizationDiverging, and ColorNormalizationLogarithmic.

Detailed Description

Default Color normalization, using a sequential linear scaling in the range [ min, max ].

Definition at line 59 of file norm_linear.hpp.

Public Member Functions

 ColorNormalizationLinear ()=default
 Constructor that sets min == 0.0 and max == 1.0. More...
 
 ColorNormalizationLinear (double min, double max)
 Constructor that sets min() and max() to the provided values. More...
 
 ColorNormalizationLinear (std::vector< double > const &values)
 Constructor that sets min() and max() to the min and max of 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 (ColorNormalizationLinear const &)=default
 
 ColorNormalizationLinear (ColorNormalizationLinear &&)=default
 
virtual ~ColorNormalizationLinear ()=default
 
ColorNormalizationLinearautoscale (std::vector< double > const &values)
 
template<class ForwardIterator >
ColorNormalizationLinearautoscale (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...
 
ColorNormalizationLinearautoscale_max (std::vector< double > const &values)
 
template<class ForwardIterator >
ColorNormalizationLinearautoscale_max (ForwardIterator first, ForwardIterator last)
 Same as autoscale(), but only updates the max_value(). More...
 
ColorNormalizationLinearautoscale_min (std::vector< double > const &values)
 
template<class ForwardIterator >
ColorNormalizationLinearautoscale_min (ForwardIterator first, ForwardIterator last)
 Same as autoscale(), but only updates the min_value(). More...
 
virtual bool is_valid_ () const override
 Return whether the ranges are correct. More...
 
double max_value () const
 Minimum value, that is, where to end the color scale. More...
 
ColorNormalizationLinearmax_value (double value)
 
double min_value () const
 Minimum value, that is, where to begin the color scale. More...
 
ColorNormalizationLinearmin_value (double value)
 
ColorNormalizationLinearoperator= (ColorNormalizationLinear const &)=default
 
ColorNormalizationLinearoperator= (ColorNormalizationLinear &&)=default
 
ColorNormalizationLinearscale (double min, double max)
 
- Public Member Functions inherited from ColorNormalization
 ColorNormalization ()=default
 
 ColorNormalization (ColorNormalization const &)=default
 
 ColorNormalization (ColorNormalization &&)=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...
 
ColorNormalizationmask_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...
 
std::vector< double > operator() (std::vector< double > const &values) const
 Return the normalized values for a vector of values. More...
 
template<class ForwardIterator >
std::vector< double > operator() (ForwardIterator first, ForwardIterator last) const
 Return the normalized values for a range of values. More...
 
ColorNormalizationoperator= (ColorNormalization const &)=default
 
ColorNormalizationoperator= (ColorNormalization &&)=default
 

Protected Member Functions

virtual void is_valid_or_throw_ () const
 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)
 Called whenever the min and max are set automatically. Gives derived classes a chance to update their values. More...
 

Constructor & Destructor Documentation

Constructor that sets min == 0.0 and max == 1.0.

ColorNormalizationLinear ( double  min,
double  max 
)
inline

Constructor that sets min() and max() to the provided values.

Definition at line 76 of file norm_linear.hpp.

ColorNormalizationLinear ( std::vector< double > const &  values)
inline

Constructor that sets min() and max() to the min and max of the provided values.

Definition at line 86 of file norm_linear.hpp.

ColorNormalizationLinear ( ForwardIterator  first,
ForwardIterator  last 
)
inline

Constructor that sets min() and max() to the min and max of the provided range.

Definition at line 95 of file norm_linear.hpp.

virtual ~ColorNormalizationLinear ( )
virtualdefault

Member Function Documentation

ColorNormalizationLinear& autoscale ( std::vector< double > const &  values)
inline

Definition at line 146 of file norm_linear.hpp.

ColorNormalizationLinear& autoscale ( ForwardIterator  first,
ForwardIterator  last 
)
inline

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 ).

The provided iterator range needs to contain values that are convertible and comparable to double. Any non-finite values or values that are equal to the mask_value() are skipped. If then no value is found at all, the min and max are not changed.

In derived classes, other values might also be set from this. For example, ColorNormalizationLinearDiverging also sets the mid value accordingly.

Definition at line 179 of file norm_linear.hpp.

ColorNormalizationLinear& autoscale_max ( std::vector< double > const &  values)
inline

Definition at line 162 of file norm_linear.hpp.

ColorNormalizationLinear& autoscale_max ( ForwardIterator  first,
ForwardIterator  last 
)
inline

Same as autoscale(), but only updates the max_value().

Definition at line 233 of file norm_linear.hpp.

ColorNormalizationLinear& autoscale_min ( std::vector< double > const &  values)
inline

Definition at line 154 of file norm_linear.hpp.

ColorNormalizationLinear& autoscale_min ( ForwardIterator  first,
ForwardIterator  last 
)
inline

Same as autoscale(), but only updates the min_value().

Definition at line 220 of file norm_linear.hpp.

virtual bool is_valid_ ( ) const
inlineoverridevirtual

Return whether the ranges are correct.

Implements ColorNormalization.

Reimplemented in ColorNormalizationDiverging, and ColorNormalizationLogarithmic.

Definition at line 269 of file norm_linear.hpp.

virtual void is_valid_or_throw_ ( ) const
inlineprotectedvirtual

Throw if the ranges are incorrect.

Reimplemented in ColorNormalizationDiverging, and ColorNormalizationLogarithmic.

Definition at line 279 of file norm_linear.hpp.

double max_value ( ) const
inline

Minimum value, that is, where to end the color scale.

Definition at line 123 of file norm_linear.hpp.

ColorNormalizationLinear& max_value ( double  value)
inline

Definition at line 255 of file norm_linear.hpp.

double min_value ( ) const
inline

Minimum value, that is, where to begin the color scale.

Definition at line 115 of file norm_linear.hpp.

ColorNormalizationLinear& min_value ( double  value)
inline

Definition at line 245 of file norm_linear.hpp.

virtual double normalize_ ( double  value) const
inlineoverrideprotectedvirtual

Normalization function.

Return a value in range [ 0.0, 1.0 ]. Derived classes can override this to provide their specific normalization.

Implements ColorNormalization.

Reimplemented in ColorNormalizationDiverging, and ColorNormalizationLogarithmic.

Definition at line 292 of file norm_linear.hpp.

ColorNormalizationLinear& operator= ( ColorNormalizationLinear const &  )
default
ColorNormalizationLinear& scale ( double  min,
double  max 
)
inline

Definition at line 135 of file norm_linear.hpp.

virtual void update_hook_ ( double  min,
double  max 
)
inlineprotectedvirtual

Called whenever the min and max are set automatically. Gives derived classes a chance to update their values.

Reimplemented in ColorNormalizationDiverging.

Definition at line 315 of file norm_linear.hpp.


The documentation for this class was generated from the following file: