Describes a method of generating a table of colors. More...
#include <Colormap.h>
Public Member Functions | |
Colormap () | |
Default Constructor Required. | |
Colormap (const String &name) | |
User Constructor. | |
virtual | ~Colormap () |
Destructor. | |
Bool | rigid () const |
If rigid is True, the colormap must be installed at a specific size. | |
void | setRigid (Bool b) |
uInt | rigidSize () const |
What is the size enforced by the rigid requirement? | |
void | setRigidSize (uInt s) |
virtual Bool | calcRGBMaps (uInt reqSize, Vector< Float > &redMap, Vector< Float > &greenMap, Vector< Float > &blueMap, Vector< Float > &alphaMap) const |
Compute RGB values using the definition and shape function. | |
const String & | name () const |
return the name of the map | |
void | setName (const String &mapName) |
void | registerPCColorTable (PixelCanvasColorTable *pcctbl) |
Register/Unregister a PixelCanvasColorTable that uses this Colormap. | |
void | unregisterPCColorTable (PixelCanvasColorTable *pcctbl) |
void | setBrightness (const Float &brightness, const Bool &doReinstall=True) |
set/get the colormap brightness level in range 0 to 1 | |
Float | getBrightness () const |
void | setAlpha (const Float &brightness, const Bool &doReinstall=True) |
set/get the colormap alpha level in range 0 to 1 | |
Float | getAlpha () const |
void | setContrast (const Float &contrast, const Bool &doReinstall=True) |
set/get the colormap contrast level | |
Float | getContrast () const |
void | setInvertFlags (const Bool &red, const Bool &green, const Bool &blue, const Bool &doReinstall=True) |
set/get the inverse flags | |
void | getInvertFlags (Bool &red, Bool &green, Bool &blue) const |
void | setLogScale (const Int &logScale, const Bool &doReinstall=True) |
Set whether or not the colormap should use a log scale. | |
void | doResizeCallbacks () |
Do resizeCallbacks on the PixelCanvasColorTables that use this Colormap. | |
void | setShapingFunction (Function1D< Float, Float > *shapingfunc=0) |
Set the Colormap shaping function. | |
void | setShapingCoefficients (const Vector< Float > ¶ms, const Bool &doReinstall=True) |
Set and retrieve the coefficients of the shaping function. | |
const Vector< Float > | getShapingCoefficients () const |
ColormapDefinition * | definition () |
Provide access to the colormap definition. | |
void | setColormapDefinition (ColormapDefinition *definition) |
Protected Member Functions | |
void | reinstall () |
reinstall this Colormap on the registered PixelCanvasColorTables | |
Private Types | |
enum | { ColormapVersion } |
Private Attributes | |
String | itsName |
name of this Colormap. | |
Bool | itsIsRigid |
is this Colormap rigid? | |
uInt | itsRigidSize |
what is its rigid size? | |
Float | itsAlpha |
Transparency. | |
Float | itsBrightness |
levels | |
Float | itsBrightnessScale |
Float | itsContrast |
Float | itsContrastScale |
Bool | itsInvertRed |
invert flags | |
Bool | itsInvertGreen |
Bool | itsInvertBlue |
Int | itsLogScale |
ColormapDefinition * | itsColormapDefinition |
Function1D< Float, Float > * | itsShapingFunction |
function for shaping the colormap | |
Bool | itsOwnShapingFunction |
SimpleOrderedMap < PixelCanvasColorTable *, uInt > | itsPCColorTables |
Friends | |
ostream & | operator<< (ostream &os, const Colormap &c) |
Write a Colormap to an ostream in a simple text form. | |
AipsIO & | operator<< (AipsIO &aio, const Colormap &c) |
Write a Colormap to an AipsIO stream in a binary format. | |
LogIO & | operator<< (LogIO &lio, const Colormap &c) |
Write a Colormap to a LogIO stream. | |
AipsIO & | operator>> (AipsIO &aio, Colormap &c) |
Read a Colormap from an AipsIO stream in a binary format. |
Describes a method of generating a table of colors.
The name of Colormap comes from ..\.
A Colormap is a class which is capable of generating a table of colormaps for the ColormapManager. The Colormap's duties are to fill a Vector of colors of a specific size.
A Colormap can operate in two modes:
Dynamic - The Colormap is treated as a function which can be arbitrarily descretized into some number of cells. Static - The Colormap is treated as a rigid table of colors and may not be resized by, for example, the ColormapManager.
The Colormap generates colors by composing a ColormapShapeFunc with a ColormapDefinition to provide the colors for the ColormapManager.
Typically the ColormapDefinition is selected from a menu, and the ColormapShapeFunc what is changed by a gui.
The ColormapDefinition and ColormapShapeFunc may be derived from to provide specialized colortable treatment.
Needed to satisfy many simultaneous wishes:
see the Display test directory
Definition at line 100 of file Colormap.h.
anonymous enum [private] |
Definition at line 259 of file Colormap.h.
casa::Colormap::Colormap | ( | ) |
Default Constructor Required.
casa::Colormap::Colormap | ( | const String & | name | ) | [explicit] |
User Constructor.
virtual casa::Colormap::~Colormap | ( | ) | [virtual] |
Destructor.
virtual Bool casa::Colormap::calcRGBMaps | ( | uInt | reqSize, | |
Vector< Float > & | redMap, | |||
Vector< Float > & | greenMap, | |||
Vector< Float > & | blueMap, | |||
Vector< Float > & | alphaMap | |||
) | const [virtual] |
Compute RGB values using the definition and shape function.
ColormapDefinition* casa::Colormap::definition | ( | ) | [inline] |
Provide access to the colormap definition.
Definition at line 221 of file Colormap.h.
References itsColormapDefinition.
void casa::Colormap::doResizeCallbacks | ( | ) |
Float casa::Colormap::getAlpha | ( | ) | const [inline] |
Definition at line 167 of file Colormap.h.
References itsAlpha.
Float casa::Colormap::getBrightness | ( | ) | const [inline] |
Definition at line 159 of file Colormap.h.
References itsBrightness.
Float casa::Colormap::getContrast | ( | ) | const [inline] |
Definition at line 175 of file Colormap.h.
References itsContrast.
void casa::Colormap::getInvertFlags | ( | Bool & | red, | |
Bool & | green, | |||
Bool & | blue | |||
) | const |
const Vector<Float> casa::Colormap::getShapingCoefficients | ( | ) | const |
const String& casa::Colormap::name | ( | ) | const [inline] |
void casa::Colormap::registerPCColorTable | ( | PixelCanvasColorTable * | pcctbl | ) |
Register/Unregister a PixelCanvasColorTable that uses this Colormap.
void casa::Colormap::reinstall | ( | ) | [protected] |
reinstall this Colormap on the registered PixelCanvasColorTables
Bool casa::Colormap::rigid | ( | ) | const [inline] |
If rigid is True, the colormap must be installed at a specific size.
Definition at line 116 of file Colormap.h.
References itsIsRigid.
uInt casa::Colormap::rigidSize | ( | ) | const [inline] |
What is the size enforced by the rigid requirement?
Definition at line 126 of file Colormap.h.
References itsRigidSize.
void casa::Colormap::setAlpha | ( | const Float & | brightness, | |
const Bool & | doReinstall = True | |||
) |
set/get the colormap alpha level in range 0 to 1
void casa::Colormap::setBrightness | ( | const Float & | brightness, | |
const Bool & | doReinstall = True | |||
) |
set/get the colormap brightness level in range 0 to 1
void casa::Colormap::setColormapDefinition | ( | ColormapDefinition * | definition | ) |
void casa::Colormap::setContrast | ( | const Float & | contrast, | |
const Bool & | doReinstall = True | |||
) |
set/get the colormap contrast level
void casa::Colormap::setInvertFlags | ( | const Bool & | red, | |
const Bool & | green, | |||
const Bool & | blue, | |||
const Bool & | doReinstall = True | |||
) |
set/get the inverse flags
void casa::Colormap::setLogScale | ( | const Int & | logScale, | |
const Bool & | doReinstall = True | |||
) |
Set whether or not the colormap should use a log scale.
void casa::Colormap::setName | ( | const String & | mapName | ) | [inline] |
Definition at line 146 of file Colormap.h.
References itsName.
void casa::Colormap::setRigid | ( | Bool | b | ) | [inline] |
Definition at line 119 of file Colormap.h.
References itsIsRigid.
void casa::Colormap::setRigidSize | ( | uInt | s | ) | [inline] |
Definition at line 130 of file Colormap.h.
References itsRigidSize.
void casa::Colormap::setShapingCoefficients | ( | const Vector< Float > & | params, | |
const Bool & | doReinstall = True | |||
) |
Set and retrieve the coefficients of the shaping function.
void casa::Colormap::setShapingFunction | ( | Function1D< Float, Float > * | shapingfunc = 0 |
) |
Set the Colormap shaping function.
If the argument is 0, then resort to using the default shaping function, which happens to be a polynomial of order 1.
void casa::Colormap::unregisterPCColorTable | ( | PixelCanvasColorTable * | pcctbl | ) |
AipsIO& operator<< | ( | AipsIO & | aio, | |
const Colormap & | c | |||
) | [friend] |
Write a Colormap to an AipsIO stream in a binary format.
ostream& operator<< | ( | ostream & | os, | |
const Colormap & | c | |||
) | [friend] |
Write a Colormap to an ostream in a simple text form.
AipsIO& operator>> | ( | AipsIO & | aio, | |
Colormap & | c | |||
) | [friend] |
Float casa::Colormap::itsAlpha [private] |
Float casa::Colormap::itsBrightness [private] |
Float casa::Colormap::itsBrightnessScale [private] |
Definition at line 245 of file Colormap.h.
Definition at line 251 of file Colormap.h.
Referenced by definition().
Float casa::Colormap::itsContrast [private] |
Definition at line 246 of file Colormap.h.
Referenced by getContrast().
Float casa::Colormap::itsContrastScale [private] |
Definition at line 246 of file Colormap.h.
Bool casa::Colormap::itsInvertBlue [private] |
Definition at line 248 of file Colormap.h.
Bool casa::Colormap::itsInvertGreen [private] |
Definition at line 248 of file Colormap.h.
Bool casa::Colormap::itsInvertRed [private] |
invert flags
Definition at line 248 of file Colormap.h.
Bool casa::Colormap::itsIsRigid [private] |
is this Colormap rigid?
Definition at line 237 of file Colormap.h.
Referenced by rigid(), and setRigid().
Int casa::Colormap::itsLogScale [private] |
Definition at line 249 of file Colormap.h.
String casa::Colormap::itsName [private] |
name of this Colormap.
Definition at line 234 of file Colormap.h.
Bool casa::Colormap::itsOwnShapingFunction [private] |
Definition at line 255 of file Colormap.h.
SimpleOrderedMap<PixelCanvasColorTable *, uInt> casa::Colormap::itsPCColorTables [private] |
Definition at line 257 of file Colormap.h.
uInt casa::Colormap::itsRigidSize [private] |
what is its rigid size?
Definition at line 240 of file Colormap.h.
Referenced by rigidSize(), and setRigidSize().
Function1D<Float, Float>* casa::Colormap::itsShapingFunction [private] |
function for shaping the colormap
Definition at line 254 of file Colormap.h.