casa
$Rev:20696$
|
Class to manage registration of colormaps on PixelCanvasColorTables. More...
#include <ColormapManager.h>
Public Member Functions | |
ColormapManager (PixelCanvasColorTable *pcctbl) | |
Constructor requires pointer to the PixelCanvasColorTable which it will manage. | |
virtual | ~ColormapManager () |
Destructor. | |
void | registerColormap (Colormap *dcmap, Float weight=1.0) |
Register a Colormap with this ColormapManager, and optionally pass a weight - colormaps are distributed proportionally according to their weight. | |
void | registerColormap (Colormap *cmap, Colormap *cmapToReplace) |
Register the cmap Colormap with this manager, replacing the cmapToReplace Colormap if possible. | |
Bool | unregisterColormap (Colormap *dcmap) |
Unregister a Colormap with this ColormapManager. | |
uInt | getColormapSize (const Colormap *map) const |
Return the current size of the colormap. | |
uInt | getColormapOffset (const Colormap *map) const |
Return the current offset of the colormap. | |
void | redistributeColormaps () |
Redistribute the available colorcells to the registered colormaps. | |
void | reinstallColormaps () |
Reinstall the colorcell values. | |
Bool | member (const Colormap *map) const |
Is the given Colormap registered on this ColormapManager/PixelCanvasColorTable combination? | |
uInt | nMaps () const |
Return the number of registered Colormaps. | |
const Colormap * | getMap (const uInt mapnum) const |
Return a pointer to a Colormap by number. | |
Private Attributes | |
PixelCanvasColorTable * | itsPCColorTable |
Pointer to managed PixelCanvasColorTable. | |
SimpleOrderedMap< const Colormap *, ColormapInfo * > | itsInfoMap |
Map which associates Colormap pointers with ColormapInfo. | |
Friends | |
ostream & | operator<< (ostream &os, const ColormapManager &cm) |
Stream output operator. |
Class to manage registration of colormaps on PixelCanvasColorTables.
Internal
This class manages a set of colormaps and dynamically maintains both their allocation on the colortable and the colortable's colors.
The colormap manager is a management tool which facilitates the dynamic mapping of 1 or more Colormaps to a single PixelCanvasColorTable.
The colormap manager manages the assignment of data colormaps, which define the function that generates the color spectrum to use, to the hardware colormap which defines how many cells are available. As Colormaps are registerd and unregistered, the manager reorganizes the colors on the colormap and reinstalls the maps in response. The colormap manager also registers a resize callback with the pixel canvas colormap. This allows the application to resize the hardware colormap and have all colormaps adjusted as appropriate.
The calling program can at any time ask for the size of a given colormap and use that size to map real-world values into a range appropriate for display (see the PixelCanvas class' getColormapSize() and mapToColor() functions.
Because the colormap manager can control the distribution of its Colormaps, application code must issue a call to redistribute if it decides to change the size of the colortable on its own.
Needed to have tool available to help manage more than one colormap.
Definition at line 93 of file ColormapManager.h.
Constructor requires pointer to the PixelCanvasColorTable which it will manage.
virtual casa::ColormapManager::~ColormapManager | ( | ) | [virtual] |
Destructor.
uInt casa::ColormapManager::getColormapOffset | ( | const Colormap * | map | ) | const |
Return the current offset of the colormap.
Referenced by casa::PixelCanvasColorTable::getColormapOffset().
uInt casa::ColormapManager::getColormapSize | ( | const Colormap * | map | ) | const |
Return the current size of the colormap.
const Colormap* casa::ColormapManager::getMap | ( | const uInt | mapnum | ) | const |
Return a pointer to a Colormap by number.
Bool casa::ColormapManager::member | ( | const Colormap * | map | ) | const |
Is the given Colormap registered on this ColormapManager/PixelCanvasColorTable combination?
uInt casa::ColormapManager::nMaps | ( | ) | const [inline] |
Return the number of registered Colormaps.
Definition at line 134 of file ColormapManager.h.
References itsInfoMap, and casa::SimpleOrderedMap< K, V >::ndefined().
Redistribute the available colorcells to the registered colormaps.
void casa::ColormapManager::registerColormap | ( | Colormap * | dcmap, |
Float | weight = 1.0 |
||
) |
Register a Colormap with this ColormapManager, and optionally pass a weight - colormaps are distributed proportionally according to their weight.
void casa::ColormapManager::registerColormap | ( | Colormap * | cmap, |
Colormap * | cmapToReplace | ||
) |
Reinstall the colorcell values.
Unregister a Colormap with this ColormapManager.
ostream& operator<< | ( | ostream & | os, |
const ColormapManager & | cm | ||
) | [friend] |
Stream output operator.
SimpleOrderedMap<const Colormap *, ColormapInfo *> casa::ColormapManager::itsInfoMap [private] |
Map which associates Colormap pointers with ColormapInfo.
Definition at line 148 of file ColormapManager.h.
Referenced by nMaps().
Pointer to managed PixelCanvasColorTable.
Definition at line 145 of file ColormapManager.h.