![]() |
PhoenixPNG
0.1.0
Set of tools to ease use of png file
|
Describe a color map to adapt color with input value. More...
#include <PColorMap.h>
Public Member Functions | |
void | addColor (float value, color_t red, color_t green, color_t blue, color_t alpha=255) |
Add a color in the PColorMap. | |
void | addColor (float value, const PString &color) |
Add a color in the PColorMap. | |
void | interpolate (color_t &red, color_t &green, color_t &blue, color_t &alpha, float value) const |
Interpolate color by respect to the given value. | |
void | interpolate (color_t &red, color_t &green, color_t &blue, float value) const |
Interpolate color by respect to the given value. | |
void | interpolate (PColorValue &output, float value) const |
Interpolate color by respect to the given value. | |
PColorMap & | operator= (const PColorMap &other) |
Definition of equal operator of PColorMap. | |
PColorMap () | |
Default constructor of PColorMap. | |
PColorMap (const PColorMap &other) | |
Copy constructor of PColorMap. | |
virtual | ~PColorMap () |
Destructor of PColorMap. | |
Protected Member Functions | |
void | copyPColorMap (const PColorMap &other) |
Copy function of PColorMap. | |
Private Member Functions | |
void | initialisationPColorMap () |
Initialisation function of the class PColorMap. | |
Private Attributes | |
PMapColorValue | p_mapColor |
Vector of the value. | |
Describe a color map to adapt color with input value.
Definition at line 38 of file PColorMap.h.
PColorMap::PColorMap | ( | ) |
Default constructor of PColorMap.
Definition at line 97 of file PColorMap.cpp.
References initialisationPColorMap().
Referenced by copyPColorMap(), operator=(), and PColorMap().
PColorMap::PColorMap | ( | const PColorMap & | other | ) |
Copy constructor of PColorMap.
other | : class to copy |
Definition at line 104 of file PColorMap.cpp.
References copyPColorMap(), and PColorMap().
|
virtual |
void PColorMap::addColor | ( | float | value, |
color_t | red, | ||
color_t | green, | ||
color_t | blue, | ||
color_t | alpha = 255 ) |
Add a color in the PColorMap.
value | : associated value with the given color |
red | : red proportion |
green | : green proportion |
blue | : blue proportion |
alpha | : transparent proportion |
Definition at line 138 of file PColorMap.cpp.
References createColorValue(), and p_mapColor.
void PColorMap::addColor | ( | float | value, |
const PString & | color ) |
Add a color in the PColorMap.
value | : associated value with the given color |
color | : hexadecimal color associated to the given value (FF000000, 00FF0000, 0000FF00, 000000FF, etc) |
Definition at line 126 of file PColorMap.cpp.
References createColorValue(), and p_mapColor.
|
protected |
Copy function of PColorMap.
other | : class to copy |
Definition at line 204 of file PColorMap.cpp.
References p_mapColor, and PColorMap().
Referenced by operator=(), and PColorMap().
|
private |
Initialisation function of the class PColorMap.
Definition at line 209 of file PColorMap.cpp.
Referenced by PColorMap().
void PColorMap::interpolate | ( | color_t & | red, |
color_t & | green, | ||
color_t & | blue, | ||
color_t & | alpha, | ||
float | value ) const |
Interpolate color by respect to the given value.
[out] | red | : red proportion |
[out] | green | : green proportion |
[out] | blue | : blue proportion |
[out] | alpha | : transparent proportion |
value | : given value |
Definition at line 164 of file PColorMap.cpp.
References PColorValue::a, PColorValue::b, PColorValue::g, interpolate(), and PColorValue::r.
Interpolate color by respect to the given value.
[out] | red | : red proportion |
[out] | green | : green proportion |
[out] | blue | : blue proportion |
value | : given value |
Definition at line 149 of file PColorMap.cpp.
References PColorValue::b, PColorValue::g, interpolate(), and PColorValue::r.
Referenced by interpolate(), interpolate(), and PImagePng::setColor().
void PColorMap::interpolate | ( | PColorValue & | output, |
float | value ) const |
Interpolate color by respect to the given value.
[out] | output | : output color |
value | : given value |
Definition at line 177 of file PColorMap.cpp.
References p_mapColor, and phoenix_interpolateColor().
Definition of equal operator of PColorMap.
other | : class to copy |
Definition at line 117 of file PColorMap.cpp.
References copyPColorMap(), and PColorMap().
|
private |
Vector of the value.
Definition at line 58 of file PColorMap.h.
Referenced by addColor(), addColor(), copyPColorMap(), and interpolate().