Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |
The QGLColormap class is used for installing custom colormaps into QGLWidgets. More...
#include <qglcolormap.h>
QGLColormap provides a platform independent way of specifying and installing indexed colormaps into QGLWidgets. QGLColormap is especially useful when using the OpenGL color-index mode.
Under X11 you will have to use an X server that supports either a PseudoColor or DirectColor visual class. If your X server currently only provides a GrayScale, TrueColor, StaticColor or StaticGray visual, you will not be able to allocate colorcells for writing. If this is the case, try setting your X server in 8 bit mode. It should then provide you with at least a PseudoColor visual. Note that you may experience colormap flashing if your X server is running in 8 bit mode.
Under Windows the size of the colormap is always set to 256 colors. Note that under Windows you are allowed to install colormaps into child widgets.
This class uses explicit sharing (see Shared Classes).
Example of use:
#include <qapplication.h> #include <qglcolormap.h> int main() { QApplication a( argc, argv ); MySuperGLWidget widget( 0 ); // A QGLWidget in color-index mode QGLColormap colormap; // This will fill the colormap with colors ranging from // black to white. for ( int i = 0; i < colormap.size(); i++ ) colormap.setEntry( i, qRgb( i, i, i ) ); widget.setColormap( colormap ); widget.show(); return a.exec(); }
See also QGLWidget::setColormap(), QGLWidget::colormap(), Graphics Classes and Image Processing Classes.
Set an array of cells in this colormap. count is the number of colors that should be set, colors is the array of colors, and base is the starting index.
Set cell with index idx in the colormap to color color.
This file is part of the Qt toolkit. Copyright © 1995-2002 Trolltech. All Rights Reserved.
Copyright © 2002 Trolltech | Trademarks | Qt version 3.0.5
|