casa
5.7.0-16
|
Abstract interface to underlying graphics library's colortable. More...
#include <PixelCanvasColorTable.h>
Public Member Functions | |
virtual casacore::Bool | staticSize () |
Is the hardware colormap resizeable? ie. More... | |
virtual casacore::Bool | resize (casacore::uInt newSize)=0 |
Resize the hardware colormap. More... | |
virtual casacore::Bool | resize (casacore::uInt nReds, casacore::uInt nGreens, casacore::uInt nBlues)=0 |
virtual casacore::Bool | installRGBColors (const casacore::Vector< casacore::Float > &r, const casacore::Vector< casacore::Float > &g, const casacore::Vector< casacore::Float > &b, const casacore::Vector< casacore::Float > &alpha, casacore::uInt offset=0)=0 |
Install colors into the color table. More... | |
virtual casacore::uInt | nColors () const =0 |
Return the number of colors used to make the map. More... | |
virtual void | nColors (casacore::uInt &n1, casacore::uInt &n2, casacore::uInt &n3) const =0 |
Return the number of colors per component used in the map. More... | |
virtual casacore::uInt | depth () const =0 |
Return the depth of the map in bits. More... | |
virtual casacore::uInt | nSpareColors () const =0 |
Return the number of colors that are still unallocated. More... | |
virtual | ~PixelCanvasColorTable () |
Virtual destructor. More... | |
void | addResizeCallback (PixelCanvasColorTableResizeCB cb, void *clientData) |
Add and remove resize callbacks PixelCanvasColorTableResizeCB is of type: void (*)(class PixelCanvasColorTable * pcctbl, casacore::uInt newSize, void * clientData, Display::RefreshReason reason) More... | |
void | removeResizeCallback (PixelCanvasColorTableResizeCB cb, void *clientData) |
void | doResizeCallbacks (const Display::RefreshReason &reason=Display::ColorTableChange) |
casacore::Function that issues resize callbacks More... | |
void | registerColormap (Colormap *cmap, casacore::Float weight=1.0) |
Register a colormap to be managed by the pixel canvas' color table. More... | |
void | registerColormap (Colormap *cmap, Colormap *cmapToReplace) |
Register the cmap Colormap on the PixelCanvasColorTable, replacing the cmapToReplace Colormap if possible. More... | |
void | unregisterColormap (Colormap *cmap) |
Unregister a data colormap reference previously added. More... | |
casacore::uInt | getColormapSize (const Colormap *cmap) const |
Return the allocation size of some Colormap. More... | |
virtual void | mapToColor (const Colormap *map, casacore::Array< casacore::uChar > &outArray, const casacore::Array< casacore::uChar > &inArray, casacore::Bool rangeCheck=true) const =0 |
map [0,N-1] into colorpixels, where N is the current colormap size The values are returned as unsigned integers in their respective array. More... | |
virtual void | mapToColor (const Colormap *map, casacore::Array< casacore::uShort > &outArray, const casacore::Array< casacore::uShort > &inArray, casacore::Bool rangeCheck=true) const =0 |
virtual void | mapToColor (const Colormap *map, casacore::Array< casacore::uInt > &outArray, const casacore::Array< casacore::uInt > &inArray, casacore::Bool rangeCheck=true) const =0 |
virtual void | mapToColor (const Colormap *map, casacore::Array< casacore::uLong > &outArray, const casacore::Array< casacore::uLong > &inArray, casacore::Bool rangeCheck=true) const =0 |
virtual void | mapToColorRGB (const Colormap *map, casacore::Array< casacore::uInt > &outArray, const casacore::Array< casacore::uInt > &inArrayRed, const casacore::Array< casacore::uInt > &inArrayGreen, const casacore::Array< casacore::uInt > &inArrayBlue) const |
virtual void | mapToColor (const Colormap *map, casacore::Array< casacore::uChar > &inOutArray, casacore::Bool rangeCheck=true) const =0 |
same as above except the matrix is operated on in place. More... | |
virtual void | mapToColor (const Colormap *map, casacore::Array< casacore::uShort > &inOutArray, casacore::Bool rangeCheck=true) const =0 |
virtual void | mapToColor (const Colormap *map, casacore::Array< casacore::uInt > &inOutArray, casacore::Bool rangeCheck=true) const =0 |
virtual void | mapToColor (const Colormap *map, casacore::Array< casacore::uLong > &inOutArray, casacore::Bool rangeCheck=true) const =0 |
virtual void | mapToColor3 (casacore::Array< casacore::uLong > &out, const casacore::Array< casacore::Float > &chan1in, const casacore::Array< casacore::Float > &chan2in, const casacore::Array< casacore::Float > &chan3in)=0 |
Functions for dealing with multi-channel mapping. More... | |
virtual void | mapToColor3 (casacore::Array< casacore::uLong > &out, const casacore::Array< casacore::Double > &chan1in, const casacore::Array< casacore::Double > &chan2in, const casacore::Array< casacore::Double > &chan3in)=0 |
virtual void | mapToColor3 (casacore::Array< casacore::uLong > &out, const casacore::Array< casacore::uShort > &chan1in, const casacore::Array< casacore::uShort > &chan2in, const casacore::Array< casacore::uShort > &chan3in)=0 |
This one maps values between 0 and the integer maximum value for each channel into a single output image suitable for PixelCanvas::drawImage(). More... | |
virtual void | mapToColor3 (casacore::Array< casacore::uLong > &out, const casacore::Array< casacore::uInt > &chan1in, const casacore::Array< casacore::uInt > &chan2in, const casacore::Array< casacore::uInt > &chan3in)=0 |
virtual casacore::Bool | colorSpaceMap (Display::ColorModel, const casacore::Array< casacore::Float > &chan1in, const casacore::Array< casacore::Float > &chan2in, const casacore::Array< casacore::Float > &chan3in, casacore::Array< casacore::Float > &chan1out, casacore::Array< casacore::Float > &chan2out, casacore::Array< casacore::Float > &chan3out)=0 |
(Multichannel Color) Transform arrays from the passed color model into the colormodel of the XPCCT. More... | |
casacore::Bool | member (const Colormap *cmap) const |
Return whether or not a data colormap is used by this pixel canvas. More... | |
void | setDefaultColormap (const Colormap *map) |
Return the default map. More... | |
ColormapManager & | colormapManager () |
Return the colormapManager used by this PCCT. More... | |
virtual Display::ColorModel | colorModel () const =0 |
Return the color model for multichannel color. More... | |
void | registerPixelCanvas (const class PixelCanvas *pc) |
void | doRefreshCallbacks () |
*Colormap * | defaultColormap () |
Protected Member Functions | |
casacore::uInt | getColormapOffset (const Colormap *map) const |
return the offset of a particular colormap. More... | |
PixelCanvasColorTable () | |
Abstract base class. More... | |
Private Member Functions | |
casacore::uInt | getColorAmount (const casacore::uInt *posMatrix, const casacore::uInt *endMatrix, int shiftAmount, int colorCount) const |
Private Attributes | |
Colormap * | defaultColormap_ |
Pointer to the default colormap. More... | |
ColormapManager | dcmapMgr_ |
The colormap manager. More... | |
std::list< void * > | resizeCBList_ |
casacore::List of resize callbacks More... | |
std::list< void * > | clientDataList_ |
casacore::List of client data for resize callbacks More... | |
std::list< void * > | pixelCanvasList_ |
casacore::List of pixelCanvases on this color table More... | |
Abstract interface to underlying graphics library's colortable.
PixelCanvas table of available colors. Note that there is still a table of colors in RGB mode.
This abstract class is communicated to by the PixelCanvas to perform color operations. The information in this file should not be needed to support applications programmers, and is provided for the future maintainer of the Display library.
A Major role of the PixelCanvasColorTable is to dynamically allocate space out of its own colortable allocation from the underlying graphics library for its registered Colormap s. It talks to its ColormapManager to return the Colormap information needed to properly scale data values to color. An application must know the size of the colormap to determine the color resolution available to value-related data.
The mapToColor functions will be needed by most image drawing and colored vector display drawing calls to transform quantized values into color indices.
The PixelCanvasColorTable is distinguished from the Colormap by its functionality. There is one and only one PixelCanvasColorTable for each PixelCanvas. It controls the allocation of containers for colors. It also will set the colors in the containers if the map is in HSV or RGB mode if necessary. If the map is in INDEX mode, you can install one or more Colormap s that control banks of colors in the color table because Colormaps define the colors that go into the containers of a PixelCanvasColorTable.
Needed to abstract the concepts involved in color resource allocation from the PixelCanvas user.
see the PixelCanvas test programs
Definition at line 105 of file PixelCanvasColorTable.h.
|
virtual |
Virtual destructor.
|
protected |
Abstract base class.
void casa::PixelCanvasColorTable::addResizeCallback | ( | PixelCanvasColorTableResizeCB | cb, |
void * | clientData | ||
) |
Add and remove resize callbacks PixelCanvasColorTableResizeCB is of type:
void (*)(class PixelCanvasColorTable * pcctbl, casacore::uInt newSize, void * clientData, Display::RefreshReason reason)
|
inline |
Return the colormapManager used by this PCCT.
Definition at line 264 of file PixelCanvasColorTable.h.
References dcmapMgr_.
|
pure virtual |
Return the color model for multichannel color.
Implemented in casa::GLPixelCanvasColorTable, casa::PSPixelCanvasColorTable, and casa::QtPCColorTable.
|
pure virtual |
(Multichannel Color) Transform arrays from the passed color model into the colormodel of the XPCCT.
Does nothing if colorModel is Display::Index. It is assumed that input arrays are in the range of [0,1]
Implemented in casa::PSPixelCanvasColorTable, casa::GLPixelCanvasColorTable, and casa::QtPCColorTable.
|
inline |
Definition at line 277 of file PixelCanvasColorTable.h.
References defaultColormap_.
|
pure virtual |
Return the depth of the map in bits.
Implemented in casa::GLPixelCanvasColorTable, casa::PSPixelCanvasColorTable, and casa::QtPCColorTable.
void casa::PixelCanvasColorTable::doRefreshCallbacks | ( | ) |
void casa::PixelCanvasColorTable::doResizeCallbacks | ( | const Display::RefreshReason & | reason = Display::ColorTableChange | ) |
casacore::Function that issues resize callbacks
|
private |
|
inlineprotected |
return the offset of a particular colormap.
This information is not made available to the outside caller. Rather a function to map values to color is made available.
Definition at line 286 of file PixelCanvasColorTable.h.
References dcmapMgr_, and casa::ColormapManager::getColormapOffset().
casacore::uInt casa::PixelCanvasColorTable::getColormapSize | ( | const Colormap * | cmap | ) | const |
Return the allocation size of some Colormap.
Referenced by casa::PixelCanvas::getColormapSize().
|
pure virtual |
Install colors into the color table.
Offset is zero-based. Colors are installed into the PixelCanvasColorTable until the vectors run out or until the end of the colortable is reached. This has no effect if in real/pseudo RGB/HSV modes. Values are clamped to [0.0,1.0].
Implemented in casa::PSPixelCanvasColorTable, and casa::QtPCColorTable.
|
pure virtual |
map [0,N-1] into colorpixels, where N is the current colormap size The values are returned as unsigned integers in their respective array.
Tip: The choice of what type to use should be guided by the number of graphics bitplanes available; For most systems with 8-bit color, casacore::uChar is optimal; Some systems with 12 bits per pixel with an alpha channel may require using the uLong;
Warning: casacore::uChar type may not have enough bits to hold the pixel index on some high-end graphics systems
Warning: casacore::uShort type may not have enough bits to hold the pixel index on some high-end graphics systems
Implemented in casa::GLPixelCanvasColorTable, casa::PSPixelCanvasColorTable, and casa::QtPCColorTable.
Referenced by casa::PixelCanvas::mapToColor().
|
pure virtual |
Implemented in casa::GLPixelCanvasColorTable, casa::PSPixelCanvasColorTable, and casa::QtPCColorTable.
|
pure virtual |
Implemented in casa::GLPixelCanvasColorTable, casa::PSPixelCanvasColorTable, and casa::QtPCColorTable.
|
pure virtual |
Implemented in casa::GLPixelCanvasColorTable, casa::PSPixelCanvasColorTable, and casa::QtPCColorTable.
|
pure virtual |
same as above except the matrix is operated on in place.
Only unsigned values make sense here. I don't really know what to include here. Maybe ask the code cop.
Implemented in casa::GLPixelCanvasColorTable, casa::PSPixelCanvasColorTable, and casa::QtPCColorTable.
|
pure virtual |
Implemented in casa::GLPixelCanvasColorTable, casa::PSPixelCanvasColorTable, and casa::QtPCColorTable.
|
pure virtual |
Implemented in casa::GLPixelCanvasColorTable, casa::PSPixelCanvasColorTable, and casa::QtPCColorTable.
|
pure virtual |
Implemented in casa::GLPixelCanvasColorTable, casa::PSPixelCanvasColorTable, and casa::QtPCColorTable.
|
pure virtual |
Functions for dealing with multi-channel mapping.
(Multichannel Color) Merge separate channel data into an output image. This function maps floating values between 0 and 1 into a output image suitable for PixelCanvas::drawImage().
Implemented in casa::PSPixelCanvasColorTable, casa::GLPixelCanvasColorTable, and casa::QtPCColorTable.
|
pure virtual |
Implemented in casa::PSPixelCanvasColorTable, casa::GLPixelCanvasColorTable, and casa::QtPCColorTable.
|
pure virtual |
This one maps values between 0 and the integer maximum value for each channel into a single output image suitable for PixelCanvas::drawImage().
Implemented in casa::PSPixelCanvasColorTable, casa::GLPixelCanvasColorTable, and casa::QtPCColorTable.
|
pure virtual |
Implemented in casa::PSPixelCanvasColorTable, casa::GLPixelCanvasColorTable, and casa::QtPCColorTable.
|
virtual |
Referenced by casa::PixelCanvas::mapToColor().
casacore::Bool casa::PixelCanvasColorTable::member | ( | const Colormap * | cmap | ) | const |
Return whether or not a data colormap is used by this pixel canvas.
Referenced by casa::PixelCanvas::colormapRegistered().
|
pure virtual |
Return the number of colors used to make the map.
Implemented in casa::GLPixelCanvasColorTable, casa::PSPixelCanvasColorTable, and casa::QtPCColorTable.
|
pure virtual |
Return the number of colors per component used in the map.
Fails for non-HSV/RGB modes.
Implemented in casa::GLPixelCanvasColorTable, casa::PSPixelCanvasColorTable, and casa::QtPCColorTable.
|
pure virtual |
Return the number of colors that are still unallocated.
Implemented in casa::GLPixelCanvasColorTable, casa::PSPixelCanvasColorTable, and casa::QtPCColorTable.
void casa::PixelCanvasColorTable::registerColormap | ( | Colormap * | cmap, |
casacore::Float | weight = 1.0 |
||
) |
Register a colormap to be managed by the pixel canvas' color table.
Register the cmap
Colormap on the PixelCanvasColorTable, replacing the cmapToReplace
Colormap if possible.
void casa::PixelCanvasColorTable::registerPixelCanvas | ( | const class PixelCanvas * | pc | ) |
void casa::PixelCanvasColorTable::removeResizeCallback | ( | PixelCanvasColorTableResizeCB | cb, |
void * | clientData | ||
) |
|
pure virtual |
Resize the hardware colormap.
Implemented in casa::GLPixelCanvasColorTable, casa::PSPixelCanvasColorTable, and casa::QtPCColorTable.
|
pure virtual |
Implemented in casa::GLPixelCanvasColorTable, casa::PSPixelCanvasColorTable, and casa::QtPCColorTable.
void casa::PixelCanvasColorTable::setDefaultColormap | ( | const Colormap * | map | ) |
Return the default map.
This map is only used if no other colormaps are registered AND if we're in INDEX mode. Colormap * defaultColormap() const { return defaultColormap_; }
Set the default colormap
|
inlinevirtual |
Is the hardware colormap resizeable? ie.
is it write-only? Default is to return true, and derived classes should generally override this function.
Reimplemented in casa::GLPixelCanvasColorTable, and casa::QtPCColorTable.
Definition at line 111 of file PixelCanvasColorTable.h.
void casa::PixelCanvasColorTable::unregisterColormap | ( | Colormap * | cmap | ) |
Unregister a data colormap reference previously added.
|
private |
casacore::List of client data for resize callbacks
Definition at line 305 of file PixelCanvasColorTable.h.
|
private |
The colormap manager.
Definition at line 300 of file PixelCanvasColorTable.h.
Referenced by colormapManager(), and getColormapOffset().
|
private |
Pointer to the default colormap.
Definition at line 297 of file PixelCanvasColorTable.h.
Referenced by defaultColormap().
|
private |
casacore::List of pixelCanvases on this color table
Definition at line 307 of file PixelCanvasColorTable.h.
|
private |
casacore::List of resize callbacks
Definition at line 303 of file PixelCanvasColorTable.h.