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
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.
Destructor.
Register a Colormap with this ColormapManager, and optionally
pass a weight - colormaps are distributed proportionally
according to their weight.
Register the cmap Colormap with this manager,
replacing the cmapToReplace<src> Colormap if possible.
Unregister a Colormap with this ColormapManager.
Return the current size of the colormap.
Return the current offset of the colormap.
Redistribute the available colorcells to the registered
colormaps.
Reinstall the colorcell values.
Is the given Colormap registered on this
ColormapManager/PixelCanvasColorTable combination?
Return the number of registered Colormaps.
Return a pointer to a Colormap by number.
Stream output operator.
Motivation
Needed to have tool available to help manage more than one colormap.
Member Description
ColormapManager(PixelCanvasColorTable *pcctbl)
Constructor requires pointer to the PixelCanvasColorTable which it
will manage.
virtual ~ColormapManager()
void registerColormap(Colormap * dcmap, Float weight = 1.0)
void registerColormap(Colormap *cmap, Colormap *cmapToReplace)
Bool unregisterColormap(Colormap * dcmap)
uInt getColormapSize(const Colormap * map) const
uInt getColormapOffset(const Colormap * map) const
void redistributeColormaps()
void reinstallColormaps()
Bool member(const Colormap * map) const
uInt nMaps() const
const Colormap *getMap(const uInt mapnum) const
friend ostream & operator << (ostream & os, const ColormapManager & cm)