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

#include <GLPixelCanvasColorTable.h>

Inheritance diagram for casa::GLPixelCanvasColorTable:
casa::PixelCanvasColorTable

Public Types

enum  FILLMODE {
  FILLRGB,
  FILLRBG,
  FILLGRB,
  FILLGBR,
  FILLBRG,
  FILLBGR
}
 

Public Member Functions

 GLPixelCanvasColorTable ()
 
 ~GLPixelCanvasColorTable ()
 
 GLPixelCanvasColorTable (::XDisplay *dpy, Display::ColorModel mapType=Display::RGB, casacore::Float percent=90.0, XVisualInfo *visInfo=NULL)
 
casacore::Bool allocCells (casacore::uInt nCells)
 allocate cells for colormaps More...
 
casacore::Bool deallocCells ()
 deallocate cells for colormaps More...
 
casacore::Bool allocColorCube ()
 Allocate the best color cube given the map. More...
 
casacore::Bool allocColorCube (casacore::uInt n1, casacore::uInt n2, casacore::uInt n3)
 Allocate a color cube of a specific size. More...
 
casacore::Bool allocColorCubeMinMax (casacore::uInt n1min, casacore::uInt n2min, casacore::uInt n3min, casacore::uInt n1max, casacore::uInt n2max, casacore::uInt n3max)
 Allocate a color cube within the ranges of sizes. More...
 
void copyColorCube (const GLPixelCanvasColorTable &mapRef)
 Copy color cube info from the mapRef. More...
 
void fillColorCubeRGB ()
 Fill a color cube with an RGB spectrum. More...
 
void fillColorCubeHSV ()
 Fill a color cube with an HSV spectrum. More...
 
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)
 Merge separate channel data into an output image. More...
 
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)
 
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)
 This one maps values between 0 and the integer maximum value for each channel into a single output image suitable for PixelCanvas::drawImage(). More...
 
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)
 
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)
 (Multichannel Color) Transform arrays from the passed color model into the colormodel of the XPCCT. More...
 
void mapToColor (const Colormap *map, casacore::Array< casacore::uChar > &outArray, const casacore::Array< casacore::uChar > &inArray, casacore::Bool rangeCheck=true) const
 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...
 
void mapToColor (const Colormap *map, casacore::Array< casacore::uShort > &outArray, const casacore::Array< casacore::uShort > &inArray, casacore::Bool rangeCheck=true) const
 
void mapToColor (const Colormap *map, casacore::Array< casacore::uInt > &outArray, const casacore::Array< casacore::uInt > &inArray, casacore::Bool rangeCheck=true) const
 
void mapToColor (const Colormap *map, casacore::Array< casacore::uLong > &outArray, const casacore::Array< casacore::uLong > &inArray, casacore::Bool rangeCheck=true) const
 
void mapToColor (const Colormap *map, casacore::Array< casacore::uChar > &inOutArray, casacore::Bool rangeCheck=true) const
 same as above except the matrix is operated on in place. More...
 
void mapToColor (const Colormap *map, casacore::Array< casacore::uShort > &inOutArray, casacore::Bool rangeCheck=true) const
 
void mapToColor (const Colormap *map, casacore::Array< casacore::uInt > &inOutArray, casacore::Bool rangeCheck=true) const
 
void mapToColor (const Colormap *map, casacore::Array< casacore::uLong > &inOutArray, casacore::Bool rangeCheck=true) const
 
virtual casacore::Bool staticSize ()
 Is the hardware colormap resizeable? ie. More...
 
casacore::Bool resize (casacore::uInt newSize)
 resize the map if allowed. More...
 
casacore::Bool resize (casacore::uInt nReds, casacore::uInt nGreens, casacore::uInt nBlues)
 
casacore::Bool installRGBColors (const casacore::Vector< casacore::Float > &r, const casacore::Vector< casacore::Float > &g, const casacore::Vector< casacore::Float > &b, casacore::uInt offset=0)
 Install colors into the color table. More...
 
casacore::uInt nColors () const
 Return the total number of RW colors currently in use. More...
 
virtual void nColors (casacore::uInt &n1, casacore::uInt &n2, casacore::uInt &n3) const
 Return the number of colors per component in the map. More...
 
casacore::uInt depth () const
 Return the depth in bits of the colors. More...
 
casacore::uInt nSpareColors () const
 Return the number of colors that are still unallocated. More...
 
::XDisplay * display () const
 Return pointer to display that is being used. More...
 
Screen * screen () const
 Return pointer to screen that is being used. More...
 
Visual * visual () const
 Return pointer to visual that is being used. More...
 
XVisualInfo * visualInfo () const
 Return pointer to visual info that is being used. More...
 
XColormap xcmap () const
 Return XID of X "virtual colormap" being used. More...
 
casacore::Bool indexMode () const
 Return true if the table is in colorIndex mode. More...
 
casacore::Bool rgbMode () const
 Return true if the table is in RGB mode. More...
 
casacore::Bool hsvMode () const
 Return true if the table is in HSV mode. More...
 
casacore::Bool rigid () const
 Return true if the colortable can be resized. More...
 
Display::ColorModel colorModel () const
 Return the color model for multichannel color. More...
 
casacore::Bool readOnly () const
 
casacore::Bool decomposedIndex () const
 
casacore::uInt QueryColorsAvailable (const casacore::Bool contig) const
 Return the number of currently unallocated cells that can be allocated RW. More...
 
virtual casacore::uInt QueryHWColorsAvailable (const casacore::Bool contig) const
 
casacore::Bool virtualToPhysical (const unsigned long vindex, unsigned long &pindex) const
 Convert a virtual index to a physical pixel. More...
 
void storeColor (const casacore::uInt index, const float r, const float g, const float b)
 Store an RGB value at index. More...
 
void pixelToComponents (const casacore::uLong pixel, casacore::Float &r, casacore::Float &g, casacore::Float &b)
 Convert a pixel to color components. More...
 
void indexToRGB (const casacore::uInt index, float &r, float &g, float &b)
 Returns the color values for the index. More...
 
- Public Member Functions inherited from casa::PixelCanvasColorTable
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 ~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 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
 
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...
 
ColormapManagercolormapManager ()
 Return the colormapManager used by this PCCT. More...
 
void registerPixelCanvas (const class PixelCanvas *pc)
 
void doRefreshCallbacks ()
 
*ColormapdefaultColormap ()
 

Static Public Member Functions

static void colorFillRGB (casacore::Vector< casacore::Float > &r, casacore::Vector< casacore::Float > &g, casacore::Vector< casacore::Float > &b, casacore::uInt nr, casacore::uInt ng, casacore::uInt nb, FILLMODE mode=FILLRGB)
 
static void colorFillRGB (casacore::Vector< casacore::Float > &r, casacore::Vector< casacore::Float > &g, casacore::Vector< casacore::Float > &b, casacore::uInt ncolors, FILLMODE mode=FILLRGB)
 
static XVisualInfo * getVisualInfo (::XDisplay *dpy, const Display::ColorModel colormodel)
 Return a GL capable visual that supports the colormodel or NULL. More...
 

Private Member Functions

casacore::Bool isPow2 (casacore::uInt n, casacore::uInt &log2n)
 Return the log power 2 of n and return true if n is a power of two. More...
 
void setupColorCube (casacore::uLong n1, casacore::uLong n2, casacore::uLong n3, casacore::uLong n1m, casacore::uLong n2m, casacore::uLong n3m)
 (Multi-Channel) More...
 
void setupStandardMapping (const XStandardColormap *mapInfo)
 (Multi-Channel) More...
 
casacore::Bool initVisual (XVisualInfo *vi=NULL)
 
void checkVisual ()
 
virtual void storeHWColor (const casacore::uLong pindex, const float r, const float g, const float b)
 Write an RGB value to hardware colormap at physical index. More...
 
void HSV2RGB (const casacore::uLong H, const casacore::uLong S, const casacore::uLong V, casacore::uLong &R, casacore::uLong &G, casacore::uLong &B)
 Convert from integer HSV components to RGB pixel components. More...
 
casacore::uInt HSV2Index (float h, float s, float v)
 
Valid only for multi channel color modes (RGB, HSV, etc)) If true
 

Private Attributes

::XDisplay * display_
 A pointer to the XDisplay. More...
 
Screen * screen_
 A pointer the the X Screen. More...
 
Visual * visual_
 A pointer to the X Visual. More...
 
XVisualInfo * visualInfo_
 
XColormap xcmap_
 A pointer to the XColormap (X Hardware colormap) More...
 
casacore::uInt depth_
 (Valid Always) number of bits of depth More...
 
casacore::uInt nColors_
 (Valid Always) number of total colors available for RW. More...
 
casacore::uLongcolors_
 (Valid only when implementation uses a PseudoColor or a StaticColor visual). More...
 
casacore::uShort vcmapLength_
 
GLVColorTableEntryvcmap_
 (& HW map if it exists) More...
 
casacore::Bool rigid_
 (Valid Always) true if the table may not be resized, such as when a standard XColormap is used. More...
 
true if the colormap is read
only *casacore::Bool 
readOnly_
 
casacore::Bool decomposedIndex_
 true if trueColor or DirectColor. More...
 
unsigned short red_shift_
 Shift counts, masks, and max values used to build pixels for decomposed index colormaps. More...
 
unsigned short green_shift_
 
unsigned short blue_shift_
 
unsigned short red_max_
 
unsigned short green_max_
 
unsigned short blue_max_
 
unsigned long red_mask_
 
unsigned long green_mask_
 
unsigned long blue_mask_
 
Valid only for multi channel
color then the color cube s
sides are powers of 
two
 
Display::ColorModel colorModel_
 (Valid Always) The colormodel that this GLPixelCanvasColorTable has been configured as. More...
 
casacore::uLong baseColor_
 (Valid only for multi-channel color modes (RGB, HSV, etc)) Represents the first cell used for the color cube. More...
 
casacore::uInt n1_
 (Valid only for multi-channel color modes (RGB, HSV, etc)) Specifies the color resolution for each side of the color cube. More...
 
casacore::uInt n2_
 
casacore::uInt n3_
 
casacore::uInt n1Mult_
 
casacore::uInt n2Mult_
 
casacore::uInt n3Mult_
 
casacore::uInt n1Shift_
 (Valid only for multi-channel color modes (RGB, HSV, etc)) and when pow2Mapping is true. More...
 
casacore::uInt n2Shift_
 
casacore::uInt n3Shift_
 

Friends

ostream & operator<< (ostream &os, const GLPixelCanvasColorTable &pcc)
 print details of class to ostream More...
 

Additional Inherited Members

- Protected Member Functions inherited from casa::PixelCanvasColorTable
casacore::uInt getColormapOffset (const Colormap *map) const
 return the offset of a particular colormap. More...
 
 PixelCanvasColorTable ()
 Abstract base class. More...
 

Detailed Description

Definition at line 115 of file GLPixelCanvasColorTable.h.

Member Enumeration Documentation

Enumerator
FILLRGB 
FILLRBG 
FILLGRB 
FILLGBR 
FILLBRG 
FILLBGR 

Definition at line 146 of file GLPixelCanvasColorTable.h.

Constructor & Destructor Documentation

casa::GLPixelCanvasColorTable::GLPixelCanvasColorTable ( )
casa::GLPixelCanvasColorTable::~GLPixelCanvasColorTable ( )
casa::GLPixelCanvasColorTable::GLPixelCanvasColorTable ( ::XDisplay *  dpy,
Display::ColorModel  mapType = Display::RGB,
casacore::Float  percent = 90.0,
XVisualInfo *  visInfo = NULL 
)

Member Function Documentation

casacore::Bool casa::GLPixelCanvasColorTable::allocCells ( casacore::uInt  nCells)

allocate cells for colormaps

casacore::Bool casa::GLPixelCanvasColorTable::allocColorCube ( )

Allocate the best color cube given the map.

casacore::Bool casa::GLPixelCanvasColorTable::allocColorCube ( casacore::uInt  n1,
casacore::uInt  n2,
casacore::uInt  n3 
)

Allocate a color cube of a specific size.

casacore::Bool casa::GLPixelCanvasColorTable::allocColorCubeMinMax ( casacore::uInt  n1min,
casacore::uInt  n2min,
casacore::uInt  n3min,
casacore::uInt  n1max,
casacore::uInt  n2max,
casacore::uInt  n3max 
)

Allocate a color cube within the ranges of sizes.

void casa::GLPixelCanvasColorTable::checkVisual ( )
private
static void casa::GLPixelCanvasColorTable::colorFillRGB ( casacore::Vector< casacore::Float > &  r,
casacore::Vector< casacore::Float > &  g,
casacore::Vector< casacore::Float > &  b,
casacore::uInt  nr,
casacore::uInt  ng,
casacore::uInt  nb,
FILLMODE  mode = FILLRGB 
)
static
static void casa::GLPixelCanvasColorTable::colorFillRGB ( casacore::Vector< casacore::Float > &  r,
casacore::Vector< casacore::Float > &  g,
casacore::Vector< casacore::Float > &  b,
casacore::uInt  ncolors,
FILLMODE  mode = FILLRGB 
)
static
Display::ColorModel casa::GLPixelCanvasColorTable::colorModel ( ) const
inlinevirtual

Return the color model for multichannel color.

Implements casa::PixelCanvasColorTable.

Definition at line 296 of file GLPixelCanvasColorTable.h.

References colorModel_.

casacore::Bool casa::GLPixelCanvasColorTable::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 
)
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]

Implements casa::PixelCanvasColorTable.

void casa::GLPixelCanvasColorTable::copyColorCube ( const GLPixelCanvasColorTable mapRef)

Copy color cube info from the mapRef.

casacore::Bool casa::GLPixelCanvasColorTable::deallocCells ( )

deallocate cells for colormaps

casacore::Bool casa::GLPixelCanvasColorTable::decomposedIndex ( ) const
inline

Definition at line 302 of file GLPixelCanvasColorTable.h.

References decomposedIndex_.

casacore::uInt casa::GLPixelCanvasColorTable::depth ( ) const
virtual

Return the depth in bits of the colors.

Implements casa::PixelCanvasColorTable.

::XDisplay* casa::GLPixelCanvasColorTable::display ( ) const

Return pointer to display that is being used.

void casa::GLPixelCanvasColorTable::fillColorCubeHSV ( )

Fill a color cube with an HSV spectrum.

void casa::GLPixelCanvasColorTable::fillColorCubeRGB ( )

Fill a color cube with an RGB spectrum.

static XVisualInfo* casa::GLPixelCanvasColorTable::getVisualInfo ( ::XDisplay *  dpy,
const Display::ColorModel  colormodel 
)
static

Return a GL capable visual that supports the colormodel or NULL.

casacore::uInt casa::GLPixelCanvasColorTable::HSV2Index ( float  h,
float  s,
float  v 
)
private
void casa::GLPixelCanvasColorTable::HSV2RGB ( const casacore::uLong  H,
const casacore::uLong  S,
const casacore::uLong  V,
casacore::uLong R,
casacore::uLong G,
casacore::uLong B 
)
private

Convert from integer HSV components to RGB pixel components.

casacore::Bool casa::GLPixelCanvasColorTable::hsvMode ( ) const
inline

Return true if the table is in HSV mode.

Definition at line 286 of file GLPixelCanvasColorTable.h.

References colorModel_, and casa::Display::HSV.

casacore::Bool casa::GLPixelCanvasColorTable::indexMode ( ) const
inline

Return true if the table is in colorIndex mode.

Definition at line 278 of file GLPixelCanvasColorTable.h.

References colorModel_, and casa::Display::Index.

void casa::GLPixelCanvasColorTable::indexToRGB ( const casacore::uInt  index,
float &  r,
float &  g,
float &  b 
)

Returns the color values for the index.

(Inverse of installRGBColors()).

casacore::Bool casa::GLPixelCanvasColorTable::initVisual ( XVisualInfo *  vi = NULL)
private
casacore::Bool casa::GLPixelCanvasColorTable::installRGBColors ( const casacore::Vector< casacore::Float > &  r,
const casacore::Vector< casacore::Float > &  g,
const casacore::Vector< casacore::Float > &  b,
casacore::uInt  offset = 0 
)

Install colors into the color table.

Offset is zero-based. Colors are installed into the PixelCanvasColorTable until the Arrays run out or until the end of the colortable is reached. This only has an effect if the ColorModel is Index. Values are clamped to [0.0,1.0].

casacore::Bool casa::GLPixelCanvasColorTable::isPow2 ( casacore::uInt  n,
casacore::uInt log2n 
)
private

Return the log power 2 of n and return true if n is a power of two.

Otherwise return false.

void casa::GLPixelCanvasColorTable::mapToColor ( const Colormap map,
casacore::Array< casacore::uChar > &  outArray,
const casacore::Array< casacore::uChar > &  inArray,
casacore::Bool  rangeCheck = true 
) const
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.


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

Implements casa::PixelCanvasColorTable.

void casa::GLPixelCanvasColorTable::mapToColor ( const Colormap map,
casacore::Array< casacore::uShort > &  outArray,
const casacore::Array< casacore::uShort > &  inArray,
casacore::Bool  rangeCheck = true 
) const
virtual
void casa::GLPixelCanvasColorTable::mapToColor ( const Colormap map,
casacore::Array< casacore::uInt > &  outArray,
const casacore::Array< casacore::uInt > &  inArray,
casacore::Bool  rangeCheck = true 
) const
virtual
void casa::GLPixelCanvasColorTable::mapToColor ( const Colormap map,
casacore::Array< casacore::uLong > &  outArray,
const casacore::Array< casacore::uLong > &  inArray,
casacore::Bool  rangeCheck = true 
) const
virtual
void casa::GLPixelCanvasColorTable::mapToColor ( const Colormap map,
casacore::Array< casacore::uChar > &  inOutArray,
casacore::Bool  rangeCheck = true 
) const
virtual

same as above except the matrix is operated on in place.

Only unsigned values make sense here.

Implements casa::PixelCanvasColorTable.

void casa::GLPixelCanvasColorTable::mapToColor ( const Colormap map,
casacore::Array< casacore::uShort > &  inOutArray,
casacore::Bool  rangeCheck = true 
) const
virtual
void casa::GLPixelCanvasColorTable::mapToColor ( const Colormap map,
casacore::Array< casacore::uInt > &  inOutArray,
casacore::Bool  rangeCheck = true 
) const
virtual
void casa::GLPixelCanvasColorTable::mapToColor ( const Colormap map,
casacore::Array< casacore::uLong > &  inOutArray,
casacore::Bool  rangeCheck = true 
) const
virtual
void casa::GLPixelCanvasColorTable::mapToColor3 ( casacore::Array< casacore::uLong > &  out,
const casacore::Array< casacore::Float > &  chan1in,
const casacore::Array< casacore::Float > &  chan2in,
const casacore::Array< casacore::Float > &  chan3in 
)
virtual

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().

Implements casa::PixelCanvasColorTable.

void casa::GLPixelCanvasColorTable::mapToColor3 ( casacore::Array< casacore::uLong > &  out,
const casacore::Array< casacore::Double > &  chan1in,
const casacore::Array< casacore::Double > &  chan2in,
const casacore::Array< casacore::Double > &  chan3in 
)
virtual
void casa::GLPixelCanvasColorTable::mapToColor3 ( casacore::Array< casacore::uLong > &  out,
const casacore::Array< casacore::uShort > &  chan1in,
const casacore::Array< casacore::uShort > &  chan2in,
const casacore::Array< casacore::uShort > &  chan3in 
)
virtual

This one maps values between 0 and the integer maximum value for each channel into a single output image suitable for PixelCanvas::drawImage().

Implements casa::PixelCanvasColorTable.

void casa::GLPixelCanvasColorTable::mapToColor3 ( casacore::Array< casacore::uLong > &  out,
const casacore::Array< casacore::uInt > &  chan1in,
const casacore::Array< casacore::uInt > &  chan2in,
const casacore::Array< casacore::uInt > &  chan3in 
)
virtual
Valid only for multi channel color casa::GLPixelCanvasColorTable::modes ( RGB  ,
HSV  ,
etc   
)
private
casacore::uInt casa::GLPixelCanvasColorTable::nColors ( ) const
virtual

Return the total number of RW colors currently in use.

Implements casa::PixelCanvasColorTable.

virtual void casa::GLPixelCanvasColorTable::nColors ( casacore::uInt n1,
casacore::uInt n2,
casacore::uInt n3 
) const
virtual

Return the number of colors per component in the map.

Throws an exception if this is not an HSV or RGB ColorTable.

Implements casa::PixelCanvasColorTable.

casacore::uInt casa::GLPixelCanvasColorTable::nSpareColors ( ) const
virtual

Return the number of colors that are still unallocated.

Implements casa::PixelCanvasColorTable.

void casa::GLPixelCanvasColorTable::pixelToComponents ( const casacore::uLong  pixel,
casacore::Float r,
casacore::Float g,
casacore::Float b 
)

Convert a pixel to color components.

If decomposed index (eg TC), the pixel contains the color information. Otherwise, (eg. PseudoColor), The information is looked up in the virtual colormap.

casacore::uInt casa::GLPixelCanvasColorTable::QueryColorsAvailable ( const casacore::Bool  contig) const

Return the number of currently unallocated cells that can be allocated RW.

virtual casacore::uInt casa::GLPixelCanvasColorTable::QueryHWColorsAvailable ( const casacore::Bool  contig) const
virtual
casacore::Bool casa::GLPixelCanvasColorTable::readOnly ( ) const
inline

Definition at line 299 of file GLPixelCanvasColorTable.h.

References readOnly_.

casacore::Bool casa::GLPixelCanvasColorTable::resize ( casacore::uInt  newSize)
virtual

resize the map if allowed.

Returns true if resize was accepted

Implements casa::PixelCanvasColorTable.

casacore::Bool casa::GLPixelCanvasColorTable::resize ( casacore::uInt  nReds,
casacore::uInt  nGreens,
casacore::uInt  nBlues 
)
virtual
casacore::Bool casa::GLPixelCanvasColorTable::rgbMode ( ) const
inline

Return true if the table is in RGB mode.

Definition at line 282 of file GLPixelCanvasColorTable.h.

References colorModel_, and casa::Display::RGB.

casacore::Bool casa::GLPixelCanvasColorTable::rigid ( ) const
inline

Return true if the colortable can be resized.

Definition at line 291 of file GLPixelCanvasColorTable.h.

References rigid_.

Screen* casa::GLPixelCanvasColorTable::screen ( ) const

Return pointer to screen that is being used.

void casa::GLPixelCanvasColorTable::setupColorCube ( casacore::uLong  n1,
casacore::uLong  n2,
casacore::uLong  n3,
casacore::uLong  n1m,
casacore::uLong  n2m,
casacore::uLong  n3m 
)
private

(Multi-Channel)

void casa::GLPixelCanvasColorTable::setupStandardMapping ( const XStandardColormap *  mapInfo)
private

(Multi-Channel)

virtual casacore::Bool casa::GLPixelCanvasColorTable::staticSize ( )
inlinevirtual

Is the hardware colormap resizeable? ie.

is it write-only?

Reimplemented from casa::PixelCanvasColorTable.

Definition at line 234 of file GLPixelCanvasColorTable.h.

References decomposedIndex_, and readOnly_.

void casa::GLPixelCanvasColorTable::storeColor ( const casacore::uInt  index,
const float  r,
const float  g,
const float  b 
)

Store an RGB value at index.

For RGV visuals, only the virtual colormap is updated.

virtual void casa::GLPixelCanvasColorTable::storeHWColor ( const casacore::uLong  pindex,
const float  r,
const float  g,
const float  b 
)
privatevirtual

Write an RGB value to hardware colormap at physical index.

(Called by storeColor()).

casacore::Bool casa::GLPixelCanvasColorTable::virtualToPhysical ( const unsigned long  vindex,
unsigned long &  pindex 
) const

Convert a virtual index to a physical pixel.

Visual* casa::GLPixelCanvasColorTable::visual ( ) const

Return pointer to visual that is being used.

XVisualInfo* casa::GLPixelCanvasColorTable::visualInfo ( ) const
inline

Return pointer to visual info that is being used.

Definition at line 271 of file GLPixelCanvasColorTable.h.

References visualInfo_.

XColormap casa::GLPixelCanvasColorTable::xcmap ( ) const

Return XID of X "virtual colormap" being used.

Friends And Related Function Documentation

ostream& operator<< ( ostream &  os,
const GLPixelCanvasColorTable pcc 
)
friend

print details of class to ostream

Member Data Documentation

casacore::uLong casa::GLPixelCanvasColorTable::baseColor_
private

(Valid only for multi-channel color modes (RGB, HSV, etc)) Represents the first cell used for the color cube.

baseColor_ is zero for PseudoColor/StaticColor implementations because they use a table.

Definition at line 400 of file GLPixelCanvasColorTable.h.

unsigned long casa::GLPixelCanvasColorTable::blue_mask_
private

Definition at line 377 of file GLPixelCanvasColorTable.h.

unsigned short casa::GLPixelCanvasColorTable::blue_max_
private

Definition at line 376 of file GLPixelCanvasColorTable.h.

unsigned short casa::GLPixelCanvasColorTable::blue_shift_
private

Definition at line 375 of file GLPixelCanvasColorTable.h.

Display::ColorModel casa::GLPixelCanvasColorTable::colorModel_
private

(Valid Always) The colormodel that this GLPixelCanvasColorTable has been configured as.

Definition at line 394 of file GLPixelCanvasColorTable.h.

Referenced by colorModel(), hsvMode(), indexMode(), and rgbMode().

casacore::uLong* casa::GLPixelCanvasColorTable::colors_
private

(Valid only when implementation uses a PseudoColor or a StaticColor visual).

casacore::Table of color indices available.

Definition at line 353 of file GLPixelCanvasColorTable.h.

casacore::Bool casa::GLPixelCanvasColorTable::decomposedIndex_
private

true if trueColor or DirectColor.

Definition at line 367 of file GLPixelCanvasColorTable.h.

Referenced by decomposedIndex(), and staticSize().

casacore::uInt casa::GLPixelCanvasColorTable::depth_
private

(Valid Always) number of bits of depth

Definition at line 348 of file GLPixelCanvasColorTable.h.

::XDisplay* casa::GLPixelCanvasColorTable::display_
private

A pointer to the XDisplay.

Definition at line 338 of file GLPixelCanvasColorTable.h.

unsigned long casa::GLPixelCanvasColorTable::green_mask_
private

Definition at line 377 of file GLPixelCanvasColorTable.h.

unsigned short casa::GLPixelCanvasColorTable::green_max_
private

Definition at line 376 of file GLPixelCanvasColorTable.h.

unsigned short casa::GLPixelCanvasColorTable::green_shift_
private

Definition at line 375 of file GLPixelCanvasColorTable.h.

casacore::uInt casa::GLPixelCanvasColorTable::n1_
private

(Valid only for multi-channel color modes (RGB, HSV, etc)) Specifies the color resolution for each side of the color cube.

index = n1Mult_*R + n2Mult_*G + n3Mult_*B for RGB in the range of <[0,n1_-1],[0,n2_-1],[0,n3_-1]>

Definition at line 408 of file GLPixelCanvasColorTable.h.

casacore::uInt casa::GLPixelCanvasColorTable::n1Mult_
private

Definition at line 412 of file GLPixelCanvasColorTable.h.

casacore::uInt casa::GLPixelCanvasColorTable::n1Shift_
private

(Valid only for multi-channel color modes (RGB, HSV, etc)) and when pow2Mapping is true.

index = (R << n1Shift_) | (G << n2Shift_) | (B << n3Shift_) for RGB the range of <[0,n1_-1],[0,n2_-1],[0,n3_-1]>

Definition at line 422 of file GLPixelCanvasColorTable.h.

casacore::uInt casa::GLPixelCanvasColorTable::n2_
private

Definition at line 409 of file GLPixelCanvasColorTable.h.

casacore::uInt casa::GLPixelCanvasColorTable::n2Mult_
private

Definition at line 413 of file GLPixelCanvasColorTable.h.

casacore::uInt casa::GLPixelCanvasColorTable::n2Shift_
private

Definition at line 423 of file GLPixelCanvasColorTable.h.

casacore::uInt casa::GLPixelCanvasColorTable::n3_
private

Definition at line 410 of file GLPixelCanvasColorTable.h.

casacore::uInt casa::GLPixelCanvasColorTable::n3Mult_
private

Definition at line 414 of file GLPixelCanvasColorTable.h.

casacore::uInt casa::GLPixelCanvasColorTable::n3Shift_
private

Definition at line 424 of file GLPixelCanvasColorTable.h.

casacore::uInt casa::GLPixelCanvasColorTable::nColors_
private

(Valid Always) number of total colors available for RW.

Definition at line 350 of file GLPixelCanvasColorTable.h.

true if the colormap is read only* casacore::Bool casa::GLPixelCanvasColorTable::readOnly_
private

Definition at line 365 of file GLPixelCanvasColorTable.h.

Referenced by readOnly(), and staticSize().

unsigned long casa::GLPixelCanvasColorTable::red_mask_
private

Definition at line 377 of file GLPixelCanvasColorTable.h.

unsigned short casa::GLPixelCanvasColorTable::red_max_
private

Definition at line 376 of file GLPixelCanvasColorTable.h.

unsigned short casa::GLPixelCanvasColorTable::red_shift_
private

Shift counts, masks, and max values used to build pixels for decomposed index colormaps.

Definition at line 375 of file GLPixelCanvasColorTable.h.

casacore::Bool casa::GLPixelCanvasColorTable::rigid_
private

(Valid Always) true if the table may not be resized, such as when a standard XColormap is used.

Generally this is set to true unless the visual is PseudoColor/StaticColor and the color model is Display::Index.

Definition at line 362 of file GLPixelCanvasColorTable.h.

Referenced by rigid().

Screen* casa::GLPixelCanvasColorTable::screen_
private

A pointer the the X Screen.

Definition at line 340 of file GLPixelCanvasColorTable.h.

Valid only for multi channel color then the color cube s sides are powers of casa::GLPixelCanvasColorTable::two
private

Definition at line 385 of file GLPixelCanvasColorTable.h.

GLVColorTableEntry* casa::GLPixelCanvasColorTable::vcmap_
private

(& HW map if it exists)

Definition at line 356 of file GLPixelCanvasColorTable.h.

casacore::uShort casa::GLPixelCanvasColorTable::vcmapLength_
private

Definition at line 354 of file GLPixelCanvasColorTable.h.

Visual* casa::GLPixelCanvasColorTable::visual_
private

A pointer to the X Visual.

Definition at line 342 of file GLPixelCanvasColorTable.h.

XVisualInfo* casa::GLPixelCanvasColorTable::visualInfo_
private

Definition at line 343 of file GLPixelCanvasColorTable.h.

Referenced by visualInfo().

XColormap casa::GLPixelCanvasColorTable::xcmap_
private

A pointer to the XColormap (X Hardware colormap)

Definition at line 345 of file GLPixelCanvasColorTable.h.


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