Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > e63754dc5af9f9ec95223fcea9485104 > files > 1539

python3-PyQt4-devel-4.8.3-2.fc14.x86_64.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QGLColormap Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QGLColormap Class Reference<br /><sup><sup>[<a href="qtopengl.html">QtOpenGL</a> module]</sup></sup></h1><p>The QGLColormap class is used for installing custom colormaps
into a <a href="qglwidget.html">QGLWidget</a>. <a href="#details">More...</a></p>

<h3>Methods</h3><ul><li><div class="fn" /><b><a href="qglcolormap.html#QGLColormap">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qglcolormap.html#QGLColormap-2">__init__</a></b> (<i>self</i>, QGLColormap)</li><li><div class="fn" /><b><a href="qglcolormap.html#detach">detach</a></b> (<i>self</i>)</li><li><div class="fn" />QColor <b><a href="qglcolormap.html#entryColor">entryColor</a></b> (<i>self</i>, int&#160;<i>idx</i>)</li><li><div class="fn" />int <b><a href="qglcolormap.html#entryRgb">entryRgb</a></b> (<i>self</i>, int&#160;<i>idx</i>)</li><li><div class="fn" />int <b><a href="qglcolormap.html#find">find</a></b> (<i>self</i>, int&#160;<i>color</i>)</li><li><div class="fn" />int <b><a href="qglcolormap.html#findNearest">findNearest</a></b> (<i>self</i>, int&#160;<i>color</i>)</li><li><div class="fn" />int <b><a href="qglcolormap.html#handle">handle</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qglcolormap.html#isEmpty">isEmpty</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qglcolormap.html#setEntries">setEntries</a></b> (<i>self</i>, list-of-int&#160;<i>colors</i>, int&#160;<i>base</i>&#160;=&#160;0)</li><li><div class="fn" /><b><a href="qglcolormap.html#setEntry">setEntry</a></b> (<i>self</i>, int&#160;<i>idx</i>, int&#160;<i>color</i>)</li><li><div class="fn" /><b><a href="qglcolormap.html#setEntry-2">setEntry</a></b> (<i>self</i>, int&#160;<i>idx</i>, QColor&#160;<i>color</i>)</li><li><div class="fn" /><b><a href="qglcolormap.html#setHandle">setHandle</a></b> (<i>self</i>, int&#160;<i>ahandle</i>)</li><li><div class="fn" />int <b><a href="qglcolormap.html#size">size</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QGLColormap class is used for installing custom colormaps
into a <a href="qglwidget.html">QGLWidget</a>.</p>
<p>QGLColormap provides a platform independent way of specifying
and installing indexed colormaps for a <a href="qglwidget.html">QGLWidget</a>. QGLColormap 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>The <a href="qglcolormap.html#size">size</a>() 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 <a href="implicit-sharing.html">implicit
sharing</a> as a memory and speed optimization.</p>
<p>Example of use:</p>
<pre class="highlightedCode brush: cpp">
 #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><hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QGLColormap" />QGLColormap.__init__ (<i>self</i>)</h3><p>Construct a <a href="qglcolormap.html">QGLColormap</a>.</p>


<h3 class="fn"><a name="QGLColormap-2" />QGLColormap.__init__ (<i>self</i>, <a href="qglcolormap.html">QGLColormap</a>)</h3><p>Construct a shallow copy of <i>map</i>.</p>


<h3 class="fn"><a name="detach" />QGLColormap.detach (<i>self</i>)</h3><h3 class="fn"><a name="entryColor" /><a href="qcolor.html">QColor</a> QGLColormap.entryColor (<i>self</i>, int&#160;<i>idx</i>)</h3><p>Returns the <a href="qcolor.html#QRgb-typedef">QRgb</a> value in
the colorcell with index <i>idx</i>.</p>


<h3 class="fn"><a name="entryRgb" />int QGLColormap.entryRgb (<i>self</i>, int&#160;<i>idx</i>)</h3><p>Returns the <a href="qcolor.html#QRgb-typedef">QRgb</a> value in
the colorcell with index <i>idx</i>.</p>


<h3 class="fn"><a name="find" />int QGLColormap.find (<i>self</i>, int&#160;<i>color</i>)</h3><p>Returns the index of the color <i>color</i>. If <i>color</i> is
not in the map, -1 is returned.</p>


<h3 class="fn"><a name="findNearest" />int QGLColormap.findNearest (<i>self</i>, int&#160;<i>color</i>)</h3><p>Returns the index of the color that is the closest match to
color <i>color</i>.</p>


<h3 class="fn"><a name="handle" />int QGLColormap.handle (<i>self</i>)</h3><h3 class="fn"><a name="isEmpty" />bool QGLColormap.isEmpty (<i>self</i>)</h3><p>Returns true if the colormap is empty or it is not in use by a
<a href="qglwidget.html">QGLWidget</a>; otherwise returns
false.</p>
<p>A colormap with no color values set is considered to be empty.
For historical reasons, a colormap that has color values set but
which is not in use by a <a href="qglwidget.html">QGLWidget</a> is
also considered empty.</p>
<p>Compare <a href="qglcolormap.html#size">size</a>() with zero to
determine if the colormap is empty regardless of whether it is in
use by a <a href="qglwidget.html">QGLWidget</a> or not.</p>
<p>See also <a href="qglcolormap.html#size">size</a>().</p>


<h3 class="fn"><a name="setEntries" />QGLColormap.setEntries (<i>self</i>, list-of-int&#160;<i>colors</i>, int&#160;<i>base</i>&#160;=&#160;0)</h3><p>Set an array of cells in this colormap. <i>count</i> is the
number of colors that should be set, <i>colors</i> is the array of
colors, and <i>base</i> is the starting index. The first element in
<i>colors</i> is set at <i>base</i> in the colormap.</p>


<h3 class="fn"><a name="setEntry" />QGLColormap.setEntry (<i>self</i>, int&#160;<i>idx</i>, int&#160;<i>color</i>)</h3><p>Set cell at index <i>idx</i> in the colormap to color
<i>color</i>.</p>


<h3 class="fn"><a name="setEntry-2" />QGLColormap.setEntry (<i>self</i>, int&#160;<i>idx</i>, <a href="qcolor.html">QColor</a>&#160;<i>color</i>)</h3><p>This is an overloaded function.</p>
<p>Set the cell with index <i>idx</i> in the colormap to color
<i>color</i>.</p>


<h3 class="fn"><a name="setHandle" />QGLColormap.setHandle (<i>self</i>, int&#160;<i>ahandle</i>)</h3><h3 class="fn"><a name="size" />int QGLColormap.size (<i>self</i>)</h3><p>Returns the number of colorcells in the colormap.</p>


<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.8.3 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2011</td><td align="right" width="25%">Qt&#160;4.7.1</td></tr></table></div></address></body></html>