casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | Friends | List of all members
casa::ColormapManager Class Reference

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. More...
 
virtual ~ColormapManager ()
 Destructor. More...
 
void registerColormap (Colormap *dcmap, casacore::Float weight=1.0)
 Register a Colormap with this ColormapManager, and optionally pass a weight - colormaps are distributed proportionally according to their weight. More...
 
void registerColormap (Colormap *cmap, Colormap *cmapToReplace)
 Register the cmap Colormap with this manager, replacing the cmapToReplace Colormap if possible. More...
 
casacore::Bool unregisterColormap (Colormap *dcmap)
 Unregister a Colormap with this ColormapManager. More...
 
casacore::uInt getColormapSize (const Colormap *map) const
 Return the current size of the colormap. More...
 
casacore::uInt getColormapOffset (const Colormap *map) const
 Return the current offset of the colormap. More...
 
void redistributeColormaps ()
 Redistribute the available colorcells to the registered colormaps. More...
 
void reinstallColormaps ()
 Reinstall the colorcell values. More...
 
casacore::Bool member (const Colormap *map) const
 Is the given Colormap registered on this ColormapManager/PixelCanvasColorTable combination? More...
 
casacore::uInt nMaps () const
 Return the number of registered Colormaps. More...
 
const ColormapgetMap (const casacore::uInt mapnum) const
 Return a pointer to a Colormap by number. More...
 

Private Attributes

PixelCanvasColorTableitsPCColorTable
 Pointer to managed PixelCanvasColorTable. More...
 
std::map< const Colormap
*, ColormapInfo * > 
itsInfoMap
 casacore::Map which associates Colormap pointers with ColormapInfo. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const ColormapManager &cm)
 Stream output operator. More...
 

Detailed Description

Class to manage registration of colormaps on PixelCanvasColorTables.

Intended use:

Internal

Review Status

Reviewed By:
None yet
Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

This class manages a set of colormaps and dynamically maintains both their allocation on the colortable and the colortable's colors.

Synopsis

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.

Motivation

Needed to have tool available to help manage more than one colormap.

Definition at line 93 of file ColormapManager.h.

Constructor & Destructor Documentation

casa::ColormapManager::ColormapManager ( PixelCanvasColorTable pcctbl)

Constructor requires pointer to the PixelCanvasColorTable which it will manage.

virtual casa::ColormapManager::~ColormapManager ( )
virtual

Destructor.

Member Function Documentation

casacore::uInt casa::ColormapManager::getColormapOffset ( const Colormap map) const

Return the current offset of the colormap.

Referenced by casa::PixelCanvasColorTable::getColormapOffset().

casacore::uInt casa::ColormapManager::getColormapSize ( const Colormap map) const

Return the current size of the colormap.

const Colormap* casa::ColormapManager::getMap ( const casacore::uInt  mapnum) const

Return a pointer to a Colormap by number.

casacore::Bool casa::ColormapManager::member ( const Colormap map) const

Is the given Colormap registered on this ColormapManager/PixelCanvasColorTable combination?

casacore::uInt casa::ColormapManager::nMaps ( ) const
inline

Return the number of registered Colormaps.

Definition at line 134 of file ColormapManager.h.

References itsInfoMap.

void casa::ColormapManager::redistributeColormaps ( )

Redistribute the available colorcells to the registered colormaps.

void casa::ColormapManager::registerColormap ( Colormap dcmap,
casacore::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 
)

Register the cmap Colormap with this manager, replacing the cmapToReplace Colormap if possible.

void casa::ColormapManager::reinstallColormaps ( )

Reinstall the colorcell values.

casacore::Bool casa::ColormapManager::unregisterColormap ( Colormap dcmap)

Unregister a Colormap with this ColormapManager.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const ColormapManager cm 
)
friend

Stream output operator.

Member Data Documentation

std::map<const Colormap *, ColormapInfo *> casa::ColormapManager::itsInfoMap
private

casacore::Map which associates Colormap pointers with ColormapInfo.

Definition at line 150 of file ColormapManager.h.

Referenced by nMaps().

PixelCanvasColorTable* casa::ColormapManager::itsPCColorTable
private

Pointer to managed PixelCanvasColorTable.

Definition at line 147 of file ColormapManager.h.


The documentation for this class was generated from the following file: