Color Lookup Tables¶
This page describes the classes LookUp, RainbowLookUp`, Rainbow2LookUp`, GeoLookUp`, Geo2LookUp`, TwoToneLookUp`, FadeOutLookUp`, FadeToLookUp`
All Lookup classes are derived from the abtract base class LookUp
,
which declares the methods getColor()
which translates a double
value to
a red value, a green value, a blue value, and an alpha value.
They all have a minimum level and a maximum level which are used to calculate the color for a value.
LookUp¶
constructor
¶
LookUp(double dMinLevel, double dMaxLevel) : m_dMinLevel(dMinLevel), m_dMaxLevel(dMaxLevel);
dMinLevel
Minimum level.
dMaxvel
Maximum level.
getColor
¶
virtual void getColor(double dValue, double &dRed, double &dGreen, double &dBlue, double &dAlpha)=0;
virtual void getColor(double dValue, unsigned char &uRed, unsigned char &uGreen, unsigned char &uBlue, unsigned char &uAlpha);
These virtual functions are implemented by the derived classes.
dValue
The value to be translated.
dRed
The resulting
red
value as double (in [0,1]).dGreen
The resulting
green
value as double (in [0,1]).dBlue
The resulting
blue
value as double (in [0,1]).dAlpha
The resulting
alpha
value as double (in [0,1]).uRed
The resulting
red
value as uchar (in [0,255]).uGreen
The resulting
green
value as uchar (in [0,255]).uBlue
The resulting
blue
value as uchar (in [0,255]).uAlpha
The resulting
blue
value as uchar (in [0,255]).
RainbowLookUp¶

constructor
¶
RainbowLookUp(double dMinLevel, double dMaxLevel);
Rainbow2LookUp¶

constructor
¶
Rainbow2LookUp(double dMinLevel, double dMaxLevel);
GeoLookUp¶

constructor
¶
GeoLookUp(double dMinLevel, double dSeaLevel, double dMaxLevel);
dSeaLevel
is the value where the color switches from bluish to greenish.
Geo2LookUp¶

constructor
¶
Geo2LookUp(double dMinLevel, double dSeaLevel, double dMaxLevel);
Like GeoLookUp
, with the exception that high values are colored whitish.
TwoToneLookUp¶

constructor
¶
TwoToneLookUp(double dSepLevel,
double dR1, double dG1, double dB1, double dA1,
double dR2, double dG2, double dB2, double dA2);
At the value dSepLevel
, the color changes from the first color to the second one.
FadeOutLookUp¶

constructor
¶
FadeOutLookUp(double dMin, double dMax,
double dR, double dG, double dB, double dA);
The color for low values is transparent and gradually changes to the specified color.
FadeToLookUp¶

constructor
¶
FadeToLookUp(double dMin, double dMax,
double dR0, double dG0, double dB0, double dA0,
double dR1, double dG1, double dB1, double dA1);
The color linearly morphs from (dR0, dG0, dB0. dA0) to (dR1, dG1, dB1, dA1) as the value increases.