casa
$Rev:20696$
|
#include <QtPCColorTable.h>
Public Member Functions | |
QtPCColorTable () | |
virtual | ~QtPCColorTable () |
virtual Bool | staticSize () |
Is the hardware colormap resizeable? ie. | |
virtual Bool | resize (uInt, uInt, uInt) |
virtual void | nColors (uInt &n1, uInt &n2, uInt &n3) const |
Return the number of colors per component used in the map. | |
virtual uInt | depth () const |
Return the depth of the map in bits. | |
virtual Display::ColorModel | colorModel () const |
The non-indexed 'true' color depth that Qt supports, and the number of bits in a Qrgb. | |
virtual uInt | nColors () const |
Initial size of the colortable. | |
virtual uInt | nSpareColors () const |
Current number of slots usable by colormaps. | |
virtual Bool | resize (uInt newSize) |
Resize the hardware colormap. | |
virtual Bool | installRGBColors (const Vector< Float > &r, const Vector< Float > &g, const Vector< Float > &b, uInt offset=0) |
Called by corresp. | |
virtual void | mapToColor (const Colormap *map, Array< uInt > &outArray, const Array< uInt > &inArray, Bool rangeCheck=True) const |
Translate Array of colormap indices into graphics platform's colors. | |
virtual void | mapToColor3 (Array< uLong > &, const Array< uInt > &, const Array< uInt > &, const Array< uInt > &) |
ColorModels are implemented for QtPixelCanvas. | |
virtual void | mapToColor (const Colormap *, Array< uChar > &, const Array< uChar > &, Bool=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. | |
virtual void | mapToColor (const Colormap *, Array< uShort > &, const Array< uShort > &, Bool=True) const |
virtual void | mapToColor (const Colormap *, Array< uLong > &, const Array< uLong > &, Bool=True) const |
virtual void | mapToColor (const Colormap *, Array< uChar > &, Bool=True) const |
same as above except the matrix is operated on in place. | |
virtual void | mapToColor (const Colormap *, Array< uShort > &, Bool=True) const |
virtual void | mapToColor (const Colormap *, Array< uInt > &, Bool=True) const |
virtual void | mapToColor (const Colormap *, Array< uLong > &, Bool=True) const |
virtual void | mapToColor3 (Array< uLong > &, const Array< Float > &, const Array< Float > &, const Array< Float > &) |
Functions for dealing with multi-channel mapping. | |
virtual void | mapToColor3 (Array< uLong > &, const Array< Double > &, const Array< Double > &, const Array< Double > &) |
virtual void | mapToColor3 (Array< uLong > &, const Array< uShort > &, const Array< uShort > &, const Array< uShort > &) |
This one maps values between 0 and the integer maximum value for each channel into a single output image suitable for PixelCanvas::drawImage(). | |
virtual Bool | colorSpaceMap (Display::ColorModel, const Array< Float > &, const Array< Float > &, const Array< Float > &, Array< Float > &, Array< Float > &, Array< Float > &) |
(Multichannel Color) Transform arrays from the passed color model into the colormodel of the XPCCT. | |
Protected Member Functions | |
Int | clrByte (Float f) |
(could move X11 version down to base class and use that -- it has no X11 dependencies...) | |
Private Attributes | |
Vector< uInt > | maps_ |
translate color component in the range [0., 1. | |
uInt | size_ |
actual storage for the color slots. |
Definition at line 21 of file QtPCColorTable.h.
virtual casa::QtPCColorTable::~QtPCColorTable | ( | ) | [inline, virtual] |
Definition at line 26 of file QtPCColorTable.h.
Int casa::QtPCColorTable::clrByte | ( | Float | f | ) | [inline, protected] |
(could move X11 version down to base class and use that -- it has no X11 dependencies...)
Definition at line 145 of file QtPCColorTable.h.
References casa::max(), and casa::min().
virtual Display::ColorModel casa::QtPCColorTable::colorModel | ( | ) | const [inline, virtual] |
The non-indexed 'true' color depth that Qt supports, and the number of bits in a Qrgb.
This includes room for the alpha channel (yay). FYI, component byte order in Qrgb (most- to least-significant) is A-R-G-B.
Implements casa::PixelCanvasColorTable.
Definition at line 44 of file QtPCColorTable.h.
References casa::Display::Index.
virtual Bool casa::QtPCColorTable::colorSpaceMap | ( | Display::ColorModel | , |
const Array< Float > & | chan1in, | ||
const Array< Float > & | chan2in, | ||
const Array< Float > & | chan3in, | ||
Array< Float > & | chan1out, | ||
Array< Float > & | chan2out, | ||
Array< Float > & | chan3out | ||
) | [inline, 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.
Definition at line 133 of file QtPCColorTable.h.
References casa::False.
virtual uInt casa::QtPCColorTable::depth | ( | ) | const [inline, virtual] |
Return the depth of the map in bits.
Implements casa::PixelCanvasColorTable.
Definition at line 38 of file QtPCColorTable.h.
virtual Bool casa::QtPCColorTable::installRGBColors | ( | const Vector< Float > & | r, |
const Vector< Float > & | g, | ||
const Vector< Float > & | b, | ||
uInt | offset = 0 |
||
) | [virtual] |
Called by corresp.
ColormapManager to actually fill color slots for the Colormaps. r,g,b ahould be in range [0,1].
Implements casa::PixelCanvasColorTable.
virtual void casa::QtPCColorTable::mapToColor | ( | const Colormap * | map, |
Array< uInt > & | outArray, | ||
const Array< uInt > & | inArray, | ||
Bool | rangeCheck = True |
||
) | const [virtual] |
Translate Array of colormap indices into graphics platform's colors.
Implements casa::PixelCanvasColorTable.
virtual void casa::QtPCColorTable::mapToColor | ( | const Colormap * | map, |
Array< uChar > & | outArray, | ||
const Array< uChar > & | inArray, | ||
Bool | rangeCheck = True |
||
) | const [inline, 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, uChar is optimal; Some systems with 12 bits per pixel with an alpha channel may require using the uLong;
Warning: uChar type may not have enough bits to hold the pixel index on some high-end graphics systems
Warning: uShort type may not have enough bits to hold the pixel index on some high-end graphics systems
Implements casa::PixelCanvasColorTable.
Definition at line 88 of file QtPCColorTable.h.
virtual void casa::QtPCColorTable::mapToColor | ( | const Colormap * | , |
Array< uShort > & | , | ||
const Array< uShort > & | , | ||
Bool | = True |
||
) | const [inline, virtual] |
Implements casa::PixelCanvasColorTable.
Definition at line 93 of file QtPCColorTable.h.
virtual void casa::QtPCColorTable::mapToColor | ( | const Colormap * | , |
Array< uLong > & | , | ||
const Array< uLong > & | , | ||
Bool | = True |
||
) | const [inline, virtual] |
Implements casa::PixelCanvasColorTable.
Definition at line 98 of file QtPCColorTable.h.
virtual void casa::QtPCColorTable::mapToColor | ( | const Colormap * | map, |
Array< uChar > & | inOutArray, | ||
Bool | rangeCheck = True |
||
) | const [inline, 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.
Implements casa::PixelCanvasColorTable.
Definition at line 103 of file QtPCColorTable.h.
virtual void casa::QtPCColorTable::mapToColor | ( | const Colormap * | , |
Array< uShort > & | , | ||
Bool | = True |
||
) | const [inline, virtual] |
Implements casa::PixelCanvasColorTable.
Definition at line 107 of file QtPCColorTable.h.
virtual void casa::QtPCColorTable::mapToColor | ( | const Colormap * | , |
Array< uInt > & | , | ||
Bool | = True |
||
) | const [inline, virtual] |
Implements casa::PixelCanvasColorTable.
Definition at line 111 of file QtPCColorTable.h.
virtual void casa::QtPCColorTable::mapToColor | ( | const Colormap * | , |
Array< uLong > & | , | ||
Bool | = True |
||
) | const [inline, virtual] |
Implements casa::PixelCanvasColorTable.
Definition at line 115 of file QtPCColorTable.h.
virtual void casa::QtPCColorTable::mapToColor3 | ( | Array< uLong > & | , |
const Array< uInt > & | , | ||
const Array< uInt > & | , | ||
const Array< uInt > & | |||
) | [inline, virtual] |
ColorModels are implemented for QtPixelCanvas.
Implements casa::PixelCanvasColorTable.
Definition at line 81 of file QtPCColorTable.h.
virtual void casa::QtPCColorTable::mapToColor3 | ( | Array< uLong > & | out, |
const Array< Float > & | chan1in, | ||
const Array< Float > & | chan2in, | ||
const Array< Float > & | chan3in | ||
) | [inline, 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().
Implements casa::PixelCanvasColorTable.
Definition at line 119 of file QtPCColorTable.h.
virtual void casa::QtPCColorTable::mapToColor3 | ( | Array< uLong > & | , |
const Array< Double > & | , | ||
const Array< Double > & | , | ||
const Array< Double > & | |||
) | [inline, virtual] |
Implements casa::PixelCanvasColorTable.
Definition at line 123 of file QtPCColorTable.h.
virtual void casa::QtPCColorTable::mapToColor3 | ( | Array< uLong > & | out, |
const Array< uShort > & | chan1in, | ||
const Array< uShort > & | chan2in, | ||
const Array< uShort > & | chan3in | ||
) | [inline, 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.
Definition at line 128 of file QtPCColorTable.h.
virtual void casa::QtPCColorTable::nColors | ( | uInt & | n1, |
uInt & | n2, | ||
uInt & | n3 | ||
) | const [inline, virtual] |
Return the number of colors per component used in the map.
Fails for non-HSV/RGB modes.
Implements casa::PixelCanvasColorTable.
Definition at line 35 of file QtPCColorTable.h.
virtual uInt casa::QtPCColorTable::nColors | ( | ) | const [inline, virtual] |
Initial size of the colortable.
Implements casa::PixelCanvasColorTable.
Definition at line 55 of file QtPCColorTable.h.
References size_.
virtual uInt casa::QtPCColorTable::nSpareColors | ( | ) | const [inline, virtual] |
Current number of slots usable by colormaps.
can be expanded at runtime up to MAX_QTPCCT_SIZE.
Implements casa::PixelCanvasColorTable.
Definition at line 59 of file QtPCColorTable.h.
References MAX_QTPCCT_SIZE, and size_.
virtual Bool casa::QtPCColorTable::resize | ( | uInt | , |
uInt | , | ||
uInt | |||
) | [inline, virtual] |
Implements casa::PixelCanvasColorTable.
Definition at line 33 of file QtPCColorTable.h.
References casa::False.
virtual Bool casa::QtPCColorTable::resize | ( | uInt | newSize | ) | [virtual] |
Resize the hardware colormap.
Implements casa::PixelCanvasColorTable.
virtual Bool casa::QtPCColorTable::staticSize | ( | ) | [inline, virtual] |
Is the hardware colormap resizeable? ie.
is it write-only? Default is to return true, and derived classes should generally override this function.
Reimplemented from casa::PixelCanvasColorTable.
Definition at line 31 of file QtPCColorTable.h.
References casa::True.
Vector<uInt> casa::QtPCColorTable::maps_ [private] |
translate color component in the range [0., 1.
] to clrByte, with 0 <= clrByte < 256
Definition at line 151 of file QtPCColorTable.h.
uInt casa::QtPCColorTable::size_ [private] |
actual storage for the color slots.
Definition at line 153 of file QtPCColorTable.h.
Referenced by nColors(), and nSpareColors().