PixelCanvasColorTable.h

Classes

PixelCanvasColorTable -- Abstract interface to underlying graphics library's colortable (full description)

class PixelCanvasColorTable

Interface

Public Members
virtual Bool staticSize()
virtual Bool resize(uInt newSize) = 0
virtual Bool resize(uInt nReds, uInt nGreens, uInt nBlues) = 0
virtual Bool installRGBColors(const Vector<Float> & r, const Vector<Float> & g, const Vector<Float> & b, uInt offset = 0) = 0
virtual uInt nColors() const = 0
virtual void nColors(uInt &n1, uInt &n2, uInt &n3) const = 0
virtual uInt depth() const = 0
virtual uInt nSpareColors() const = 0
virtual ~PixelCanvasColorTable()
void addResizeCallback(PixelCanvasColorTableResizeCB cb, void * clientData)
void removeResizeCallback(PixelCanvasColorTableResizeCB cb, void * clientData)
void doResizeCallbacks(const Display::RefreshReason &reason = Display::ColorTableChange)
void registerColormap(Colormap * cmap, Float weight = 1.0)
void registerColormap(Colormap *cmap, Colormap *cmapToReplace)
void unregisterColormap(Colormap * cmap)
uInt getColormapSize(const Colormap * cmap) const
virtual void mapToColor(const Colormap * map, Array<uChar> & outArray, const Array<uChar> & inArray, Bool rangeCheck = True) const = 0
virtual void mapToColor(const Colormap * map, Array<uShort> & outArray, const Array<uShort> & inArray, Bool rangeCheck = True) const = 0
virtual void mapToColor(const Colormap * map, Array<uInt> & outArray, const Array<uInt> & inArray, Bool rangeCheck = True) const = 0
virtual void mapToColor(const Colormap * map, Array<uLong> & outArray, const Array<uLong> & inArray, Bool rangeCheck = True) const = 0
virtual void mapToColor(const Colormap * map, Array<uChar> & inOutArray, Bool rangeCheck = True) const = 0
virtual void mapToColor(const Colormap * map, Array<uShort> & inOutArray, Bool rangeCheck = True) const = 0
virtual void mapToColor(const Colormap * map, Array<uInt> & inOutArray, Bool rangeCheck = True) const = 0
virtual void mapToColor(const Colormap * map, Array<uLong> & inOutArray, Bool rangeCheck = True) const = 0
virtual void mapToColor3(Array<uLong> & out, const Array<Float> & chan1in, const Array<Float> & chan2in, const Array<Float> & chan3in) = 0
virtual void mapToColor3(Array<uLong> & out, const Array<Double> & chan1in, const Array<Double> & chan2in, const Array<Double> & chan3in) = 0
virtual void mapToColor3(Array<uLong> & out, const Array<uShort> & chan1in, const Array<uShort> & chan2in, const Array<uShort> & chan3in) = 0
virtual void mapToColor3(Array<uLong> & out, const Array<uInt> & chan1in, const Array<uInt> & chan2in, const Array<uInt> & chan3in) = 0
virtual Bool colorSpaceMap(Display::ColorModel, const Array<Float> & chan1in, const Array<Float> & chan2in, const Array<Float> & chan3in, Array<Float> & chan1out, Array<Float> & chan2out, Array<Float> & chan3out) = 0
Bool member(const Colormap * cmap) const
void setDefaultColormap(const Colormap * map)
ColormapManager & colormapManager()
virtual Display::ColorModel colorModel() const = 0
void registerPixelCanvas(const class PixelCanvas * pc)
void doRefreshCallbacks()
Colormap* defaultColormap()
Protected Members
uInt getColormapOffset(const Colormap * map) const
PixelCanvasColorTable()

Description

Prerequisite

Etymology

PixelCanvas table of available colors. Note that there is still a table of colors in RGB mode.

Synopsis

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 Colormaps. 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 Colormaps that control banks of colors in the color table because Colormaps define the colors that go into the containers of a PixelCanvasColorTable.

Motivation

Needed to abstract the concepts involved in color resource allocation from the PixelCanvas user.

Example

see the PixelCanvas test programs

To Do