qglcolormap.html

来自「QT 下载资料仅供参考」· HTML 代码 · 共 180 行

HTML
180
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><!-- /home/reggie/tmp/qt-3.0-reggie-5401/qt-x11-commercial-3.0.5/src/opengl/qglcolormap.cpp:38 --><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>QGLColormap Class</title><style type="text/css"><!--h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }a:link { color: #004faf; text-decoration: none }a:visited { color: #672967; text-decoration: none }body { background: #ffffff; color: black; }--></style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr bgcolor="#E5E5E5"><td valign=center> <a href="index.html"><font color="#004faf">Home</font></a> | <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a> | <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a> | <a href="annotated.html"><font color="#004faf">Annotated</font></a> | <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a> | <a href="functions.html"><font color="#004faf">Functions</font></a></td><td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QGLColormap Class Reference</h1><p>The QGLColormap class is used for installing custom colormaps intoQGLWidgets.<a href="#details">More...</a><p><tt>#include &lt;<a href="qglcolormap-h.html">qglcolormap.h</a>&gt;</tt><p><a href="qglcolormap-members.html">List of all member functions.</a><h2>Public Members</h2><ul><li><div class=fn><a href="#QGLColormap"><b>QGLColormap</b></a> ()</div></li><li><div class=fn><a href="#QGLColormap-2"><b>QGLColormap</b></a> ( const&nbsp;QGLColormap&nbsp;&amp;&nbsp;map )</div></li><li><div class=fn><a href="#~QGLColormap"><b>~QGLColormap</b></a> ()</div></li><li><div class=fn>QGLColormap &amp; <a href="#operator-eq"><b>operator=</b></a> ( const&nbsp;QGLColormap&nbsp;&amp;&nbsp;map )</div></li><li><div class=fn>bool <a href="#isEmpty"><b>isEmpty</b></a> () const</div></li><li><div class=fn>int <a href="#size"><b>size</b></a> () const</div></li><li><div class=fn>void <a href="#detach"><b>detach</b></a> ()</div></li><li><div class=fn>void <a href="#setEntries"><b>setEntries</b></a> ( int&nbsp;count, const&nbsp;QRgb&nbsp;*&nbsp;colors, int&nbsp;base = 0 )</div></li><li><div class=fn>void <a href="#setEntry"><b>setEntry</b></a> ( int&nbsp;idx, QRgb&nbsp;color )</div></li><li><div class=fn>void <a href="#setEntry-2"><b>setEntry</b></a> ( int&nbsp;idx, const&nbsp;QColor&nbsp;&amp;&nbsp;color )</div></li><li><div class=fn>QRgb <a href="#entryRgb"><b>entryRgb</b></a> ( int&nbsp;idx ) const</div></li><li><div class=fn>QColor <a href="#entryColor"><b>entryColor</b></a> ( int&nbsp;idx ) const</div></li><li><div class=fn>int <a href="#find"><b>find</b></a> ( QRgb&nbsp;color ) const</div></li><li><div class=fn>int <a href="#findNearest"><b>findNearest</b></a> ( QRgb&nbsp;color ) const</div></li></ul><hr><a name="details"></a><h2>Detailed Description</h2>The QGLColormap class is used for installing custom colormaps intoQGLWidgets.<p> QGLColormap provides a platform independent way of specifying andinstalling indexed colormaps into QGLWidgets. QGLColormap isespecially useful when using the <a href="opengl.html">OpenGL</a>color-index mode.<p> Under X11 you will have to use an X server that supports either aPseudoColor or DirectColor visual class.  If your X server currentlyonly provides a GrayScale, TrueColor, StaticColor or StaticGrayvisual, you will not be able to allocate colorcells for writing. Ifthis is the case, try setting your X server in 8 bit mode. It shouldthen provide you with at least a PseudoColor visual. Note that youmay experience colormap flashing if your X server is running in 8bit mode.<p> Under Windows the size of the colormap is always set to 256 colors.Note that under Windows you are allowed to install colormaps intochild widgets.<p> This class uses <a href="shclass.html#explicit-sharing">explicit sharing</a> (see <a href="shclass.html">Shared  Classes</a>).<p> Example of use:<pre>  #include &lt;<a href="qapplication-h.html">qapplication.h</a>&gt;  #include &lt;<a href="qglcolormap-h.html">qglcolormap.h</a>&gt;  int main()  {      <a href="qapplication.html">QApplication</a> 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 &lt; colormap.<a href="#size">size</a>(); i++ )          colormap.<a href="#setEntry">setEntry</a>( i, qRgb( i, i, i ) );      widget.setColormap( colormap );      widget.show();      return a.<a href="qapplication.html#exec">exec</a>();  }  </pre> <p> <p>See also <a href="qglwidget.html#setColormap">QGLWidget::setColormap</a>(), <a href="qglwidget.html#colormap">QGLWidget::colormap</a>(), <a href="graphics.html">Graphics Classes</a> and <a href="images.html">Image Processing Classes</a>.<hr><h2>Member Function Documentation</h2><h3 class=fn><a name="QGLColormap"></a>QGLColormap::QGLColormap ()</h3>Construct a QGLColormap.<h3 class=fn><a name="QGLColormap-2"></a>QGLColormap::QGLColormap ( const&nbsp;<a href="qglcolormap.html">QGLColormap</a>&nbsp;&amp;&nbsp;map )</h3>Construct a <a href="shclass.html#shallow-copy">shallow copy</a> of <em>map</em>.<h3 class=fn><a name="~QGLColormap"></a>QGLColormap::~QGLColormap ()</h3>Dereferences the QGLColormap and deletes it if this was the lastreference to it.<h3 class=fn>void <a name="detach"></a>QGLColormap::detach ()</h3>Detaches this QGLColormap from the shared block.<h3 class=fn><a href="qcolor.html">QColor</a> <a name="entryColor"></a>QGLColormap::entryColor ( int&nbsp;idx ) const</h3>Returns the QRgb value in the colorcell with index <em>idx</em>.<h3 class=fn>QRgb <a name="entryRgb"></a>QGLColormap::entryRgb ( int&nbsp;idx ) const</h3>Returns the QRgb value in the colorcell with index <em>idx</em>.<h3 class=fn>int <a name="find"></a>QGLColormap::find ( QRgb&nbsp;color ) const</h3>Returns the index of the color <em>color</em>. If <em>color</em> is not in themap, -1 is returned.<h3 class=fn>int <a name="findNearest"></a>QGLColormap::findNearest ( QRgb&nbsp;color ) const</h3>Returns the index of the color that is the closest match to color<em>color</em>.<h3 class=fn>bool <a name="isEmpty"></a>QGLColormap::isEmpty () const</h3>Returns TRUE if the colormap is empty; otherwise returns FALSE.A colormap with no color values set is considered to be empty.<h3 class=fn><a href="qglcolormap.html">QGLColormap</a>&nbsp;&amp; <a name="operator-eq"></a>QGLColormap::operator= ( const&nbsp;<a href="qglcolormap.html">QGLColormap</a>&nbsp;&amp;&nbsp;map )</h3>Assign a <a href="shclass.html#shallow-copy">shallow copy</a> of <em>map</em> to this QGLColormap.<h3 class=fn>void <a name="setEntries"></a>QGLColormap::setEntries ( int&nbsp;count, const&nbsp;QRgb&nbsp;*&nbsp;colors, int&nbsp;base = 0 )</h3><p> Set an array of cells in this colormap. <em>count</em> is the number ofcolors that should be set, <em>colors</em> is the array of colors, and<em>base</em> is the starting index.<h3 class=fn>void <a name="setEntry"></a>QGLColormap::setEntry ( int&nbsp;idx, QRgb&nbsp;color )</h3>Set cell <em>idx</em> in the colormap to color <em>color</em>.<h3 class=fn>void <a name="setEntry-2"></a>QGLColormap::setEntry ( int&nbsp;idx, const&nbsp;<a href="qcolor.html">QColor</a>&nbsp;&amp;&nbsp;color )</h3>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.<p> Set cell with index <em>idx</em> in the colormap to color <em>color</em>.<h3 class=fn>int <a name="size"></a>QGLColormap::size () const</h3>Returns the number of colorcells in the colormap.<!-- eof --><hr><p>This file is part of the <a href="index.html">Qt toolkit</a>.Copyright &copy; 1995-2002<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center><table width=100% cellspacing=0 border=0><tr><td>Copyright &copy; 2002 <a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a><td align=right><div align=right>Qt version 3.0.5</div></table></div></address></body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?