<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>Qwt User's Guide: QwtColorMap Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.7.3 --> <div id="top"> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">Qwt User's Guide <span id="projectnumber">6.0.1</span></div> </td> </tr> </tbody> </table> </div> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="classes.html"><span>Class Index</span></a></li> <li><a href="inherits.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> </div> <div class="header"> <div class="summary"> <a href="#pub-types">Public Types</a> | <a href="#pub-methods">Public Member Functions</a> </div> <div class="headertitle"> <h1>QwtColorMap Class Reference</h1> </div> </div> <div class="contents"> <!-- doxytag: class="QwtColorMap" --> <p><a class="el" href="class_qwt_color_map.html" title="QwtColorMap is used to map values into colors.">QwtColorMap</a> is used to map values into colors. <a href="#_details">More...</a></p> <p><code>#include <<a class="el" href="qwt__color__map_8h_source.html">qwt_color_map.h</a>></code></p> <div class="dynheader"> Inheritance diagram for QwtColorMap:</div> <div class="dyncontent"> <div class="center"><img src="class_qwt_color_map__inherit__graph.png" border="0" usemap="#_qwt_color_map_inherit__map" alt="Inheritance graph"/></div> <map name="_qwt_color_map_inherit__map" id="_qwt_color_map_inherit__map"> <area shape="rect" id="node3" href="class_qwt_alpha_color_map.html" title="QwtAlphaColorMap variies the alpha value of a color." alt="" coords="5,83,139,112"/><area shape="rect" id="node5" href="class_qwt_linear_color_map.html" title="QwtLinearColorMap builds a color map from color stops." alt="" coords="163,83,296,112"/></map> <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div> <p><a href="class_qwt_color_map-members.html">List of all members.</a></p> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="pub-types"></a> Public Types</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_color_map.html#a9e5570790910fa3894887bca7dc5a670">Format</a> { <br/>   <a class="el" href="class_qwt_color_map.html#a9e5570790910fa3894887bca7dc5a670a663473fd836d9a84fe48ae1755de326a">RGB</a>, <br/>   <a class="el" href="class_qwt_color_map.html#a9e5570790910fa3894887bca7dc5a670a304cb055c004223ca77f1a4cbbf27ea2">Indexed</a> <br/> }</td></tr> <tr><td colspan="2"><h2><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">QColor </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_color_map.html#a35f74175e963d18e451a9fd4421ede1f">color</a> (const <a class="el" href="class_qwt_interval.html">QwtInterval</a> &, double value) const </td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual unsigned char </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_color_map.html#a762baa2edca8773ec09e0c1c5df2cf04">colorIndex</a> (const <a class="el" href="class_qwt_interval.html">QwtInterval</a> &interval, double value) const =0</td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual QVector< QRgb > </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_color_map.html#a4ccc23356e058783071b06dee437b6d7">colorTable</a> (const <a class="el" href="class_qwt_interval.html">QwtInterval</a> &) const </td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_qwt_color_map.html#a9e5570790910fa3894887bca7dc5a670">Format</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_color_map.html#a436802833ae1d4694f376655bc3d75be">format</a> () const </td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_color_map.html#a2ab0a6041ea6d37c0609ca2e3bd976ca">QwtColorMap</a> (<a class="el" href="class_qwt_color_map.html#a9e5570790910fa3894887bca7dc5a670">Format</a>=QwtColorMap::RGB)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual QRgb </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_color_map.html#aaed0bb47b6379696c588732348438136">rgb</a> (const <a class="el" href="class_qwt_interval.html">QwtInterval</a> &interval, double value) const =0</td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_color_map.html#af20e4ffdb3c5d34f5a6dc301bcbb9f7e">~QwtColorMap</a> ()</td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <div class="textblock"><p><a class="el" href="class_qwt_color_map.html" title="QwtColorMap is used to map values into colors.">QwtColorMap</a> is used to map values into colors. </p> <p>For displaying 3D data on a 2D plane the 3rd dimension is often displayed using colors, like f.e in a spectrogram.</p> <p>Each color map is optimized to return colors for only one of the following image formats:</p> <ul> <li>QImage::Format_Indexed8<br/> </li> <li>QImage::Format_ARGB32<br/> </li> </ul> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_qwt_plot_spectrogram.html" title="A plot item, which displays a spectrogram.">QwtPlotSpectrogram</a>, <a class="el" href="class_qwt_scale_widget.html" title="A Widget which contains a scale.">QwtScaleWidget</a> </dd></dl> </div><hr/><h2>Member Enumeration Documentation</h2> <a class="anchor" id="a9e5570790910fa3894887bca7dc5a670"></a><!-- doxytag: member="QwtColorMap::Format" ref="a9e5570790910fa3894887bca7dc5a670" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">enum <a class="el" href="class_qwt_color_map.html#a9e5570790910fa3894887bca7dc5a670">QwtColorMap::Format</a></td> </tr> </table> </div> <div class="memdoc"> <p>Format for color mapping </p> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_qwt_color_map.html#aaed0bb47b6379696c588732348438136">rgb()</a>, <a class="el" href="class_qwt_color_map.html#a762baa2edca8773ec09e0c1c5df2cf04">colorIndex()</a>, <a class="el" href="class_qwt_color_map.html#a4ccc23356e058783071b06dee437b6d7">colorTable()</a> </dd></dl> <dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"><em><a class="anchor" id="a9e5570790910fa3894887bca7dc5a670a663473fd836d9a84fe48ae1755de326a"></a><!-- doxytag: member="RGB" ref="a9e5570790910fa3894887bca7dc5a670a663473fd836d9a84fe48ae1755de326a" args="" -->RGB</em> </td><td> <p>The map is intended to map into QRgb values. </p> </td></tr> <tr><td valign="top"><em><a class="anchor" id="a9e5570790910fa3894887bca7dc5a670a304cb055c004223ca77f1a4cbbf27ea2"></a><!-- doxytag: member="Indexed" ref="a9e5570790910fa3894887bca7dc5a670a304cb055c004223ca77f1a4cbbf27ea2" args="" -->Indexed</em> </td><td> <p>The map is intended to map into 8 bit values, that are indices into the color table. </p> </td></tr> </table> </dd> </dl> </div> </div> <hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="a2ab0a6041ea6d37c0609ca2e3bd976ca"></a><!-- doxytag: member="QwtColorMap::QwtColorMap" ref="a2ab0a6041ea6d37c0609ca2e3bd976ca" args="(Format=QwtColorMap::RGB)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">QwtColorMap::QwtColorMap </td> <td>(</td> <td class="paramtype"><a class="el" href="class_qwt_color_map.html#a9e5570790910fa3894887bca7dc5a670">Format</a> </td> <td class="paramname"><em>format</em> = <code>QwtColorMap::RGB</code></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Constructor. </p> </div> </div> <a class="anchor" id="af20e4ffdb3c5d34f5a6dc301bcbb9f7e"></a><!-- doxytag: member="QwtColorMap::~QwtColorMap" ref="af20e4ffdb3c5d34f5a6dc301bcbb9f7e" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">QwtColorMap::~QwtColorMap </td> <td>(</td> <td class="paramname"></td><td>)</td> <td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Destructor. </p> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="a35f74175e963d18e451a9fd4421ede1f"></a><!-- doxytag: member="QwtColorMap::color" ref="a35f74175e963d18e451a9fd4421ede1f" args="(const QwtInterval &, double value) const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">QColor QwtColorMap::color </td> <td>(</td> <td class="paramtype">const <a class="el" href="class_qwt_interval.html">QwtInterval</a> & </td> <td class="paramname"><em>interval</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double </td> <td class="paramname"><em>value</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Map a value into a color</p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">interval</td><td>Valid interval for values </td></tr> <tr><td class="paramname">value</td><td>Value</td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>Color corresponding to value</dd></dl> <dl class="warning"><dt><b>Warning:</b></dt><dd>This method is slow for Indexed color maps. If it is necessary to map many values, its better to get the color table once and find the color using <a class="el" href="class_qwt_color_map.html#a762baa2edca8773ec09e0c1c5df2cf04">colorIndex()</a>. </dd></dl> </div> </div> <a class="anchor" id="a762baa2edca8773ec09e0c1c5df2cf04"></a><!-- doxytag: member="QwtColorMap::colorIndex" ref="a762baa2edca8773ec09e0c1c5df2cf04" args="(const QwtInterval &interval, double value) const =0" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual unsigned char QwtColorMap::colorIndex </td> <td>(</td> <td class="paramtype">const <a class="el" href="class_qwt_interval.html">QwtInterval</a> & </td> <td class="paramname"><em>interval</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double </td> <td class="paramname"><em>value</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const<code> [pure virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Map a value of a given interval into a color index </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">interval</td><td>Range for the values </td></tr> <tr><td class="paramname">value</td><td>Value </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>color index, corresponding to value </dd></dl> <p>Implemented in <a class="el" href="class_qwt_linear_color_map.html#aa69528213eb7d484466f095c8a9a6efe">QwtLinearColorMap</a>.</p> </div> </div> <a class="anchor" id="a4ccc23356e058783071b06dee437b6d7"></a><!-- doxytag: member="QwtColorMap::colorTable" ref="a4ccc23356e058783071b06dee437b6d7" args="(const QwtInterval &) const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">QVector< QRgb > QwtColorMap::colorTable </td> <td>(</td> <td class="paramtype">const <a class="el" href="class_qwt_interval.html">QwtInterval</a> & </td> <td class="paramname"><em>interval</em></td><td>)</td> <td> const<code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Build and return a color map of 256 colors</p> <p>The color table is needed for rendering indexed images in combination with using <a class="el" href="class_qwt_color_map.html#a762baa2edca8773ec09e0c1c5df2cf04">colorIndex()</a>.</p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">interval</td><td>Range for the values </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>A color table, that can be used for a QImage </dd></dl> </div> </div> <a class="anchor" id="a436802833ae1d4694f376655bc3d75be"></a><!-- doxytag: member="QwtColorMap::format" ref="a436802833ae1d4694f376655bc3d75be" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="class_qwt_color_map.html#a9e5570790910fa3894887bca7dc5a670">QwtColorMap::Format</a> QwtColorMap::format </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <dl class="return"><dt><b>Returns:</b></dt><dd>Intended format of the color map </dd></dl> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_qwt_color_map.html#a9e5570790910fa3894887bca7dc5a670">Format</a> </dd></dl> </div> </div> <a class="anchor" id="aaed0bb47b6379696c588732348438136"></a><!-- doxytag: member="QwtColorMap::rgb" ref="aaed0bb47b6379696c588732348438136" args="(const QwtInterval &interval, double value) const =0" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual QRgb QwtColorMap::rgb </td> <td>(</td> <td class="paramtype">const <a class="el" href="class_qwt_interval.html">QwtInterval</a> & </td> <td class="paramname"><em>interval</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double </td> <td class="paramname"><em>value</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const<code> [pure virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Map a value of a given interval into a rgb value. </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">interval</td><td>Range for the values </td></tr> <tr><td class="paramname">value</td><td>Value </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>rgb value, corresponding to value </dd></dl> <p>Implemented in <a class="el" href="class_qwt_linear_color_map.html#ac031babccc90d8c857c707d0841ba1eb">QwtLinearColorMap</a>, and <a class="el" href="class_qwt_alpha_color_map.html#a2f0ce2bdaecf7e74b635b8433ed733d5">QwtAlphaColorMap</a>.</p> </div> </div> </div> <hr class="footer"/><address class="footer"><small>Generated by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address> </body> </html>