<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <!-- qcolormap.qdoc --> <head> <title>Qt 4.6: QColormap Class Reference</title> <link href="classic.css" rel="stylesheet" type="text/css" /> </head> <body> <a name="//apple_ref/cpp/cl//QColormap"></a> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td> <td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="functions.html"><font color="#004faf">All Functions</font></a> · <a href="overviews.html"><font color="#004faf">Overviews</font></a></td></tr></table><h1 class="title">QColormap Class Reference<br /><span class="small-subtitle">[<a href="qtgui.html">QtGui</a> module]</span> </h1> <p>The QColormap class maps device independent QColors to device dependent pixel values. <a href="#details">More...</a></p> <pre> #include <QColormap></pre><ul> <li><a href="qcolormap-members.html">List of all members, including inherited members</a></li> </ul> <hr /> <a name="public-types"></a> <h2>Public Types</h2> <table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr><td class="memItemLeft" align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><b><a href="qcolormap.html#Mode-enum">Mode</a></b> { Direct, Indexed, Gray }</td></tr> </table> <hr /> <a name="public-functions"></a> <h2>Public Functions</h2> <table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qcolormap.html#QColormap">QColormap</a></b> ( const QColormap & <i>colormap</i> )</td></tr> <tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qcolormap.html#dtor.QColormap">~QColormap</a></b> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">const QColor </td><td class="memItemRight" valign="bottom"><b><a href="qcolormap.html#colorAt">colorAt</a></b> ( uint <i>pixel</i> ) const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">const QVector<QColor> </td><td class="memItemRight" valign="bottom"><b><a href="qcolormap.html#colormap">colormap</a></b> () const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="qcolormap.html#depth">depth</a></b> () const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">Mode </td><td class="memItemRight" valign="bottom"><b><a href="qcolormap.html#mode">mode</a></b> () const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">uint </td><td class="memItemRight" valign="bottom"><b><a href="qcolormap.html#pixel">pixel</a></b> ( const QColor & <i>color</i> ) const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="qcolormap.html#size">size</a></b> () const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">QColormap & </td><td class="memItemRight" valign="bottom"><b><a href="qcolormap.html#operator-eq">operator=</a></b> ( const QColormap & <i>colormap</i> )</td></tr> </table> <hr /> <a name="static-public-members"></a> <h2>Static Public Members</h2> <table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr><td class="memItemLeft" align="right" valign="top">HPALETTE </td><td class="memItemRight" valign="bottom"><b><a href="qcolormap.html#hPal">hPal</a></b> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">QColormap </td><td class="memItemRight" valign="bottom"><b><a href="qcolormap.html#instance">instance</a></b> ( int <i>screen</i> = -1 )</td></tr> </table> <a name="details"></a> <hr /> <h2>Detailed Description</h2> <p>The QColormap class maps device independent QColors to device dependent pixel values.</p> <hr /> <h2>Member Type Documentation</h2> <a name="//apple_ref/cpp/tag/QColormap/Mode"></a> <a name="//apple_ref/cpp/econst/QColormap/Direct"></a> <a name="//apple_ref/cpp/econst/QColormap/Indexed"></a> <a name="//apple_ref/cpp/econst/QColormap/Gray"></a> <h3 class="fn"><a name="Mode-enum"></a>enum QColormap::Mode</h3> <p>This enum describes how <a href="qcolormap.html">QColormap</a> maps device independent RGB values to device dependent pixel values.</p> <p><table class="valuelist" border="1" cellpadding="2" cellspacing="1" width="100%"> <tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr> <tr><td valign="top"><tt>QColormap::Direct</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">Pixel values are derived directly from the RGB values, also known as "True Color."</td></tr> <tr><td valign="top"><tt>QColormap::Indexed</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">Pixel values represent indexes into a vector of available colors, i.e. <a href="qcolormap.html">QColormap</a> uses the index of the color that most closely matches an RGB value.</td></tr> <tr><td valign="top"><tt>QColormap::Gray</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">Similar to <tt>Indexed</tt>, pixel values represent a vector of available gray tones. <a href="qcolormap.html">QColormap</a> uses the index of the gray tone that most closely matches the computed gray tone of an RGB value.</td></tr> </table></p> <hr /> <h2>Member Function Documentation</h2> <a name="//apple_ref/cpp/instm/QColormap/QColormap"></a> <h3 class="fn"><a name="QColormap"></a>QColormap::QColormap ( const QColormap & <i>colormap</i> )</h3> <p>Constructs a copy of another <i>colormap</i>.</p> <a name="//apple_ref/cpp/instm/QColormap/~QColormap"></a> <h3 class="fn"><a name="dtor.QColormap"></a>QColormap::~QColormap ()</h3> <p>Destroys the colormap.</p> <a name="//apple_ref/cpp/instm/QColormap/colorAt"></a> <h3 class="fn"><a name="colorAt"></a>const <a href="qcolor.html">QColor</a> QColormap::colorAt ( <a href="qtglobal.html#uint-typedef">uint</a> <i>pixel</i> ) const</h3> <p>Returns a <a href="qcolor.html">QColor</a> for the <i>pixel</i>.</p> <p>See also <a href="qcolormap.html#pixel">pixel</a>().</p> <a name="//apple_ref/cpp/instm/QColormap/colormap"></a> <h3 class="fn"><a name="colormap"></a>const <a href="qvector.html">QVector</a><<a href="qcolor.html">QColor</a>> QColormap::colormap () const</h3> <p>Returns a vector of colors which represents the devices colormap for <tt>Indexed</tt> and <tt>Gray</tt> modes. This function returns an empty vector for <tt>Direct</tt> mode.</p> <p>See also <a href="qcolormap.html#size">size</a>().</p> <a name="//apple_ref/cpp/instm/QColormap/depth"></a> <h3 class="fn"><a name="depth"></a>int QColormap::depth () const</h3> <p>Returns the depth of the device.</p> <p>See also <a href="qcolormap.html#size">size</a>().</p> <a name="//apple_ref/cpp/clm/QColormap/hPal"></a> <h3 class="fn"><a name="hPal"></a>HPALETTE QColormap::hPal () <tt> [static]</tt></h3> <p>This function is only available on Windows.</p> <p>Returns an handle to the HPALETTE used by this colormap. If no HPALETTE is being used, this function returns zero.</p> <a name="//apple_ref/cpp/clm/QColormap/instance"></a> <h3 class="fn"><a name="instance"></a>QColormap QColormap::instance ( int <i>screen</i> = -1 ) <tt> [static]</tt></h3> <p>Returns the colormap for the specified <i>screen</i>. If <i>screen</i> is -1, this function returns the colormap for the default screen.</p> <a name="//apple_ref/cpp/instm/QColormap/mode"></a> <h3 class="fn"><a name="mode"></a><a href="qcolormap.html#Mode-enum">Mode</a> QColormap::mode () const</h3> <p>Returns the mode of this colormap.</p> <p>See also <a href="qcolormap.html#Mode-enum">QColormap::Mode</a>.</p> <a name="//apple_ref/cpp/instm/QColormap/pixel"></a> <h3 class="fn"><a name="pixel"></a><a href="qtglobal.html#uint-typedef">uint</a> QColormap::pixel ( const <a href="qcolor.html">QColor</a> & <i>color</i> ) const</h3> <p>Returns a device dependent pixel value for the <i>color</i>.</p> <p>See also <a href="qcolormap.html#colorAt">colorAt</a>().</p> <a name="//apple_ref/cpp/instm/QColormap/size"></a> <h3 class="fn"><a name="size"></a>int QColormap::size () const</h3> <p>Returns the size of the colormap for <tt>Indexed</tt> and <tt>Gray</tt> modes; Returns -1 for <tt>Direct</tt> mode.</p> <p>See also <a href="qcolormap.html#colormap">colormap</a>().</p> <a name="//apple_ref/cpp/instm/QColormap/operator="></a> <h3 class="fn"><a name="operator-eq"></a>QColormap & QColormap::operator= ( const QColormap & <i>colormap</i> )</h3> <p>Assigns the given <i>colormap</i> to <i>this</i> color map and returns a reference to <i>this</i> color map.</p> <p>This function was introduced in Qt 4.2.</p> <p /><address><hr /><div align="center"> <table width="100%" cellspacing="0" border="0"><tr class="address"> <td width="40%" align="left">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)</td> <td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td> <td width="40%" align="right"><div align="right">Qt 4.6.3</div></td> </tr></table></div></address></body> </html>