VideoTools
|
A colourmap class that provides pixel values for a set of mapped colours. More...
#include <gxcolourmap.h>
Public Member Functions | |
ColourMap (Display &, bool greyscale256=false) | |
Constructor for a colourmap for the default visual providing 16 colours or 256 grey levels. More... | |
ColourMap (Display &, GX::Window &w,::Visual *v) | |
Constructor for a colourmap for a specific visual. More... | |
~ColourMap () | |
Destructor. | |
::Colormap | x () |
Returns the X colourmap id. See XCreateColormap(3). | |
unsigned long | get (int index) const |
Gets the pixel value for the given index value. | |
unsigned int | size () const |
Returns 16 for colours or 256 for greyscale. | |
int | find (unsigned long) const |
Does a reverse lookup to return the index value for the given pixel value. More... | |
A colourmap class that provides pixel values for a set of mapped colours.
The map can be for 16 colours or 256 greys. The first colour (0) is black, and the last (15/255) is white.
Definition at line 41 of file gxcolourmap.h.
|
explicit |
Constructor for a colourmap for the default visual providing 16 colours or 256 grey levels.
The implementation creates a temporary window.
Definition at line 31 of file gxcolourmap.cpp.
GX::ColourMap::ColourMap | ( | Display & | display, |
GX::Window & | w, | ||
::Visual * | v | ||
) |
Constructor for a colourmap for a specific visual.
The display reference is kept. The window is only used to determine the screen.
Definition at line 41 of file gxcolourmap.cpp.
int GX::ColourMap::find | ( | unsigned long | p | ) | const |
Does a reverse lookup to return the index value for the given pixel value.
Definition at line 113 of file gxcolourmap.cpp.