<class name="QGLColormap" doc="/** <p>The <a href="QGLColormap.html#QGLColormap(com.trolltech.qt.opengl.QGLColormap)"><tt>QGLColormap</tt></a> class is used for installing custom colormaps into QGLWidgets.</p> <p><a href="QGLColormap.html#QGLColormap(com.trolltech.qt.opengl.QGLColormap)"><tt>QGLColormap</tt></a> provides a platform independent way of specifying and installing indexed colormaps into QGLWidgets. <a href="QGLColormap.html#QGLColormap(com.trolltech.qt.opengl.QGLColormap)"><tt>QGLColormap</tt></a> is especially useful when using the OpenGL color-index mode.</p> <p>Under X11 you must use an X server that supports either a <tt>PseudoColor</tt> or <tt>DirectColor</tt> visual class. If your X server currently only provides a <tt>GrayScale</tt>, <tt>TrueColor</tt>, <tt>StaticColor</tt> or <tt>StaticGray</tt> visual, you will not be able to allocate colorcells for writing. If this is the case, try setting your X server to 8 bit mode. It should then provide you with at least a <tt>PseudoColor</tt> visual. Note that you may experience colormap flashing if your X server is running in 8 bit mode.</p> <p>Under Windows the size of the colormap is always set to 256 colors. Note that under Windows you can also install colormaps in child widgets.</p> <p>This class uses implicit sharing</tt> as a memory and speed optimization.</p> <p>Example of use:</p> <pre> #include &lt;QApplication&gt; #include &lt;QGLColormap&gt; int main() { QApplication app(argc, argv); MySuperGLWidget widget; <span class="comment">// a QGLWidget in color-index mode</span> QGLColormap colormap; <span class="comment">// This will fill the colormap with colors ranging from</span> <span class="comment">// black to white.</span> for (int i = 0; i &lt; colormap.size(); i++) colormap.setEntry(i, qRgb(i, i, i)); widget.setColormap(colormap); widget.show(); return app.exec(); }</pre> @see <tt>QGLWidget::setColormap</tt> @see <tt>QGLWidget::colormap</tt> */"> <method name="public QGLColormap()" doc="/** <p>Construct a <a href="QGLColormap.html#QGLColormap(com.trolltech.qt.opengl.QGLColormap)"><tt>QGLColormap</tt></a>.</p> */"/> <method name="public QGLColormap(com.trolltech.qt.opengl.QGLColormap arg__1)" doc="/** <p>Construct a shallow copy of <tt>arg__1</tt>.</p> */"/> <method name="public final com.trolltech.qt.gui.QColor entryColor(int idx)" doc="/** <p>Returns the QRgb value in the colorcell with index <tt>idx</tt>.</p> */"/> <method name="public final int entryRgb(int idx)" doc="/** <p>Returns the QRgb value in the colorcell with index <tt>idx</tt>.</p> */"/> <method name="public final int find(int color)" doc="/** <p>Returns the index of the color <tt>color</tt>. If <tt>color</tt> is not in the map, -1 is returned.</p> */"/> <method name="public final int findNearest(int color)" doc="/** <p>Returns the index of the color that is the closest match to color <tt>color</tt>.</p> */"/> <method name="protected final long handle()" doc="/** <p>This method is used internally by Qt Jambi. Do not use it in your applications.</p> @see <a href="QGLColormap.html#setHandle(long)"><tt>setHandle</tt></a> */"/> <method name="public final boolean isEmpty()" doc="/** <p>Returns true if the colormap is empty; otherwise returns false. A colormap with no color values set is considered to be empty.</p> */"/> <method name="public final void setEntry(int idx, com.trolltech.qt.gui.QColor color)" doc="/** <p>Set the cell with index <tt>idx</tt> in the colormap to color <tt>color</tt>.</p> */"/> <method name="public final void setEntry(int idx, int color)" doc="/** <p>Set cell at index <tt>idx</tt> in the colormap to color <tt>color</tt>.</p> */"/> <method name="protected final void setHandle(long ahandle)" doc="/** <p>This method is used internally by Qt Jambi. Do not use it in your applications.</p> @see <a href="QGLColormap.html#handle()"><tt>handle</tt></a> */"/> <method name="public final int size()" doc="/** <p>Returns the number of colorcells in the colormap.</p> */"/> </class>