28 #ifndef TRIALDISPLAY_GLPIXELCANVASCOLORTABLE_H
29 #define TRIALDISPLAY_GLPIXELCANVASCOLORTABLE_H
36 #include <X11/Xutil.h>
81 void put(
const float red,
const float green,
const float blue) {
87 void get(
float &red,
float &green,
float &blue)
const {
126 XVisualInfo *visInfo=NULL);
275 XColormap
xcmap()
const;
310 unsigned long &pindex)
const;
314 const float r,
const float g,
const float b);
372 const float r,
const float g,
const float b);
430 #ifndef AIPS_NO_TEMPLATE_SRC
431 #include <display/Display/GLPCColTblTemplates.tcc>
casacore::Bool decomposedIndex() const
casacore::uInt depth_
(Valid Always) number of bits of depth
::XDisplay * display_
A pointer to the XDisplay.
GLVColorTableEntry * vcmap_
(& HW map if it exists)
Abstract interface to underlying graphics library's colortable.
casacore::Bool virtualToPhysical(const unsigned long vindex, unsigned long &pindex) const
Convert a virtual index to a physical pixel.
casacore::uInt HSV2Index(float h, float s, float v)
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.
casacore::uShort vcmapLength_
unsigned short blue_shift_
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.
void storeColor(const casacore::uInt index, const float r, const float g, const float b)
Store an RGB value at index.
casacore::uLong * colors_
(Valid only when implementation uses a PseudoColor or a StaticColor visual).
unsigned short green_shift_
casacore::Bool readOnly() const
void setPixel(const unsigned long p)
casacore::uInt QueryColorsAvailable(const casacore::Bool contig) const
Return the number of currently unallocated cells that can be allocated RW.
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.
Display::ColorModel colorModel_
(Valid Always) The colormodel that this GLPixelCanvasColorTable has been configured as...
unsigned short green_max_
void operator=(const GLVColorTableEntry &)
XColormap xcmap() const
Return XID of X "virtual colormap" being used.
void setIndex(const casacore::uInt i)
casacore::Bool indexMode() const
Return true if the table is in colorIndex mode.
casacore::Bool decomposedIndex_
true if trueColor or DirectColor.
casacore::uInt nColors() const
Return the total number of RW colors currently in use.
Visual * visual() const
Return pointer to visual that is being used.
casacore::Bool hsvMode() const
Return true if the table is in HSV mode.
casacore::Bool rigid_
(Valid Always) true if the table may not be resized, such as when a standard XColormap is used...
Visual * visual_
A pointer to the X Visual.
virtual casacore::Bool staticSize()
Is the hardware colormap resizeable? ie.
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.
casacore::uInt nColors_
(Valid Always) number of total colors available for RW.
::XDisplay * display() const
Return pointer to display that is being used.
unsigned long green_mask_
casacore::uInt nSpareColors() const
Return the number of colors that are still unallocated.
void copyColorCube(const GLPixelCanvasColorTable &mapRef)
Copy color cube info from the mapRef.
static XVisualInfo * getVisualInfo(::XDisplay *dpy, const Display::ColorModel colormodel)
Return a GL capable visual that supports the colormodel or NULL.
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)
friend ostream & operator<<(ostream &os, const GLPixelCanvasColorTable &pcc)
print details of class to ostream
casacore::uInt depth() const
Return the depth in bits of the colors.
casacore::Bool allocCells(casacore::uInt nCells)
allocate cells for colormaps
Screen * screen() const
Return pointer to screen that is being used.
casacore::Bool resize(casacore::uInt newSize)
resize the map if allowed.
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 unsigne...
void pixelToComponents(const casacore::uLong pixel, casacore::Float &r, casacore::Float &g, casacore::Float &b)
Convert a pixel to color components.
void fillColorCubeRGB()
Fill a color cube with an RGB spectrum.
~GLPixelCanvasColorTable()
GLPixelCanvasColorTable()
casacore::Bool allocColorCube()
Allocate the best color cube given the map.
bool Bool
Define the standard types used by Casacore.
unsigned short red_shift_
Shift counts, masks, and max values used to build pixels for decomposed index colormaps.
template <class T, class U> class vector;
casacore::uInt n1_
(Valid only for multi-channel color modes (RGB, HSV, etc)) Specifies the color resolution for each si...
Display::ColorModel colorModel() const
Return the color model for multichannel color.
Screen * screen_
A pointer the the X Screen.
casacore::uLong baseColor_
(Valid only for multi-channel color modes (RGB, HSV, etc)) Represents the first cell used for the col...
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.
casacore::Bool initVisual(XVisualInfo *vi=NULL)
casacore::Bool deallocCells()
deallocate cells for colormaps
void setupStandardMapping(const XStandardColormap *mapInfo)
(Multi-Channel)
casacore::uInt getIndex() const
Describes a method of generating a table of colors.
void indexToRGB(const casacore::uInt index, float &r, float &g, float &b)
Returns the color values for the index.
casacore::Bool rgbMode() const
Return true if the table is in RGB mode.
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...
Implementation of PixelCanvasColorTable for OpenGL.
void fillColorCubeHSV()
Fill a color cube with an HSV spectrum.
XVisualInfo * visualInfo_
casacore::uLong getPixel() const
void put(const float red, const float green, const float blue)
Store/get the values.
casacore::Bool rigid() const
Return true if the colortable can be resized.
XVisualInfo * visualInfo() const
Return pointer to visual info that is being used.
true if the colormap is read only *casacore::Bool readOnly_
XColormap xcmap_
A pointer to the XColormap (X Hardware colormap)
void setupColorCube(casacore::uLong n1, casacore::uLong n2, casacore::uLong n3, casacore::uLong n1m, casacore::uLong n2m, casacore::uLong n3m)
(Multi-Channel)
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.
friend ostream & operator<<(ostream &s, const GLVColorTableEntry &x)
casacore::uInt n1Shift_
(Valid only for multi-channel color modes (RGB, HSV, etc)) and when pow2Mapping is true...
ColorModel
Different ways of handling color on the display.
virtual casacore::uInt QueryHWColorsAvailable(const casacore::Bool contig) const