Sophie

Sophie

distrib > Mandriva > cooker > i586 > by-pkgid > 76bdad05b5dca2a491582dbec0713d55 > files > 976

libqwt-devel-6.0.1-2.i586.rpm

<!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&#39;s Guide: qwt_color_map.h Source File</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&#160;<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&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<h1>qwt_color_map.h</h1>  </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* -*- mode: C++ ; c-file-style: &quot;stroustrup&quot; -*- *****************************</span>
<a name="l00002"></a>00002 <span class="comment"> * Qwt Widget Library</span>
<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1997   Josef Wilgen</span>
<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002   Uwe Rathmann</span>
<a name="l00005"></a>00005 <span class="comment"> *</span>
<a name="l00006"></a>00006 <span class="comment"> * This library is free software; you can redistribute it and/or</span>
<a name="l00007"></a>00007 <span class="comment"> * modify it under the terms of the Qwt License, Version 1.0</span>
<a name="l00008"></a>00008 <span class="comment"> *****************************************************************************/</span>
<a name="l00009"></a>00009 
<a name="l00010"></a>00010 <span class="preprocessor">#ifndef QWT_COLOR_MAP_H</span>
<a name="l00011"></a>00011 <span class="preprocessor"></span><span class="preprocessor">#define QWT_COLOR_MAP_H</span>
<a name="l00012"></a>00012 <span class="preprocessor"></span>
<a name="l00013"></a>00013 <span class="preprocessor">#include &quot;qwt_global.h&quot;</span>
<a name="l00014"></a>00014 <span class="preprocessor">#include &quot;qwt_interval.h&quot;</span>
<a name="l00015"></a>00015 <span class="preprocessor">#include &lt;qcolor.h&gt;</span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &lt;qvector.h&gt;</span>
<a name="l00017"></a>00017 
<a name="l00033"></a><a class="code" href="class_qwt_color_map.html">00033</a> <span class="keyword">class </span>QWT_EXPORT <a class="code" href="class_qwt_color_map.html" title="QwtColorMap is used to map values into colors.">QwtColorMap</a>
<a name="l00034"></a>00034 {
<a name="l00035"></a>00035 <span class="keyword">public</span>:
<a name="l00041"></a><a class="code" href="class_qwt_color_map.html#a9e5570790910fa3894887bca7dc5a670">00041</a>     <span class="keyword">enum</span> <a class="code" href="class_qwt_color_map.html#a9e5570790910fa3894887bca7dc5a670">Format</a>
<a name="l00042"></a>00042     {
<a name="l00044"></a><a class="code" href="class_qwt_color_map.html#a9e5570790910fa3894887bca7dc5a670a663473fd836d9a84fe48ae1755de326a">00044</a>         <a class="code" href="class_qwt_color_map.html#a9e5570790910fa3894887bca7dc5a670a663473fd836d9a84fe48ae1755de326a" title="The map is intended to map into QRgb values.">RGB</a>,
<a name="l00045"></a>00045 
<a name="l00050"></a><a class="code" href="class_qwt_color_map.html#a9e5570790910fa3894887bca7dc5a670a304cb055c004223ca77f1a4cbbf27ea2">00050</a>         Indexed
<a name="l00051"></a>00051     };
<a name="l00052"></a>00052 
<a name="l00053"></a>00053     <a class="code" href="class_qwt_color_map.html" title="QwtColorMap is used to map values into colors.">QwtColorMap</a>( Format = <a class="code" href="class_qwt_color_map.html#a9e5570790910fa3894887bca7dc5a670a663473fd836d9a84fe48ae1755de326a" title="The map is intended to map into QRgb values.">QwtColorMap::RGB</a> );
<a name="l00054"></a>00054     <span class="keyword">virtual</span> ~<a class="code" href="class_qwt_color_map.html" title="QwtColorMap is used to map values into colors.">QwtColorMap</a>();
<a name="l00055"></a>00055 
<a name="l00056"></a>00056     Format format() <span class="keyword">const</span>;
<a name="l00057"></a>00057 
<a name="l00064"></a>00064     <span class="keyword">virtual</span> QRgb rgb( <span class="keyword">const</span> <a class="code" href="class_qwt_interval.html" title="A class representing an interval.">QwtInterval</a> &amp;interval,
<a name="l00065"></a>00065         <span class="keywordtype">double</span> value ) <span class="keyword">const</span> = 0;
<a name="l00066"></a>00066 
<a name="l00073"></a>00073     <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> colorIndex(
<a name="l00074"></a>00074         <span class="keyword">const</span> <a class="code" href="class_qwt_interval.html" title="A class representing an interval.">QwtInterval</a> &amp;interval, <span class="keywordtype">double</span> value ) <span class="keyword">const</span> = 0;
<a name="l00075"></a>00075 
<a name="l00076"></a>00076     QColor color( <span class="keyword">const</span> <a class="code" href="class_qwt_interval.html" title="A class representing an interval.">QwtInterval</a> &amp;, <span class="keywordtype">double</span> value ) <span class="keyword">const</span>;
<a name="l00077"></a>00077     <span class="keyword">virtual</span> QVector&lt;QRgb&gt; colorTable( <span class="keyword">const</span> <a class="code" href="class_qwt_interval.html" title="A class representing an interval.">QwtInterval</a> &amp; ) <span class="keyword">const</span>;
<a name="l00078"></a>00078 
<a name="l00079"></a>00079 <span class="keyword">private</span>:
<a name="l00080"></a>00080     Format d_format;
<a name="l00081"></a>00081 };
<a name="l00082"></a>00082 
<a name="l00090"></a><a class="code" href="class_qwt_linear_color_map.html">00090</a> <span class="keyword">class </span>QWT_EXPORT <a class="code" href="class_qwt_linear_color_map.html" title="QwtLinearColorMap builds a color map from color stops.">QwtLinearColorMap</a>: <span class="keyword">public</span> <a class="code" href="class_qwt_color_map.html" title="QwtColorMap is used to map values into colors.">QwtColorMap</a>
<a name="l00091"></a>00091 {
<a name="l00092"></a>00092 <span class="keyword">public</span>:
<a name="l00097"></a><a class="code" href="class_qwt_linear_color_map.html#ac8c5f1991f533b1d25a9a0a0874b7d54">00097</a>     <span class="keyword">enum</span> <a class="code" href="class_qwt_linear_color_map.html#ac8c5f1991f533b1d25a9a0a0874b7d54">Mode</a>
<a name="l00098"></a>00098     {
<a name="l00100"></a><a class="code" href="class_qwt_linear_color_map.html#ac8c5f1991f533b1d25a9a0a0874b7d54a564b5243ab2c5e4c972a6b645234c651">00100</a>         <a class="code" href="class_qwt_linear_color_map.html#ac8c5f1991f533b1d25a9a0a0874b7d54a564b5243ab2c5e4c972a6b645234c651" title="Return the color from the next lower color stop.">FixedColors</a>,
<a name="l00101"></a>00101 
<a name="l00103"></a><a class="code" href="class_qwt_linear_color_map.html#ac8c5f1991f533b1d25a9a0a0874b7d54a01770189cb40240f2fe7fe2e6c1523f1">00103</a>         ScaledColors
<a name="l00104"></a>00104     };
<a name="l00105"></a>00105 
<a name="l00106"></a>00106     <a class="code" href="class_qwt_linear_color_map.html" title="QwtLinearColorMap builds a color map from color stops.">QwtLinearColorMap</a>( <a class="code" href="class_qwt_color_map.html#a9e5570790910fa3894887bca7dc5a670">QwtColorMap::Format</a> = <a class="code" href="class_qwt_color_map.html#a9e5570790910fa3894887bca7dc5a670a663473fd836d9a84fe48ae1755de326a" title="The map is intended to map into QRgb values.">QwtColorMap::RGB</a> );
<a name="l00107"></a>00107     <a class="code" href="class_qwt_linear_color_map.html" title="QwtLinearColorMap builds a color map from color stops.">QwtLinearColorMap</a>( <span class="keyword">const</span> QColor &amp;from, <span class="keyword">const</span> QColor &amp;to,
<a name="l00108"></a>00108         <a class="code" href="class_qwt_color_map.html#a9e5570790910fa3894887bca7dc5a670">QwtColorMap::Format</a> = <a class="code" href="class_qwt_color_map.html#a9e5570790910fa3894887bca7dc5a670a663473fd836d9a84fe48ae1755de326a" title="The map is intended to map into QRgb values.">QwtColorMap::RGB</a> );
<a name="l00109"></a>00109 
<a name="l00110"></a>00110     <span class="keyword">virtual</span> ~<a class="code" href="class_qwt_linear_color_map.html" title="QwtLinearColorMap builds a color map from color stops.">QwtLinearColorMap</a>();
<a name="l00111"></a>00111 
<a name="l00112"></a>00112     <span class="keywordtype">void</span> setMode( Mode );
<a name="l00113"></a>00113     Mode mode() <span class="keyword">const</span>;
<a name="l00114"></a>00114 
<a name="l00115"></a>00115     <span class="keywordtype">void</span> setColorInterval( <span class="keyword">const</span> QColor &amp;color1, <span class="keyword">const</span> QColor &amp;color2 );
<a name="l00116"></a>00116     <span class="keywordtype">void</span> addColorStop( <span class="keywordtype">double</span> value, <span class="keyword">const</span> QColor&amp; );
<a name="l00117"></a>00117     QVector&lt;double&gt; colorStops() <span class="keyword">const</span>;
<a name="l00118"></a>00118 
<a name="l00119"></a>00119     QColor color1() <span class="keyword">const</span>;
<a name="l00120"></a>00120     QColor color2() <span class="keyword">const</span>;
<a name="l00121"></a>00121 
<a name="l00122"></a>00122     <span class="keyword">virtual</span> QRgb <a class="code" href="class_qwt_color_map.html#aaed0bb47b6379696c588732348438136">rgb</a>( <span class="keyword">const</span> <a class="code" href="class_qwt_interval.html" title="A class representing an interval.">QwtInterval</a> &amp;, <span class="keywordtype">double</span> value ) <span class="keyword">const</span>;
<a name="l00123"></a>00123     <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="class_qwt_color_map.html#a762baa2edca8773ec09e0c1c5df2cf04">colorIndex</a>(
<a name="l00124"></a>00124         <span class="keyword">const</span> <a class="code" href="class_qwt_interval.html" title="A class representing an interval.">QwtInterval</a> &amp;, <span class="keywordtype">double</span> value ) <span class="keyword">const</span>;
<a name="l00125"></a>00125 
<a name="l00126"></a>00126     <span class="keyword">class </span>ColorStops;
<a name="l00127"></a>00127 
<a name="l00128"></a>00128 <span class="keyword">private</span>:
<a name="l00129"></a>00129     <span class="comment">// Disabled copy constructor and operator=</span>
<a name="l00130"></a>00130     <a class="code" href="class_qwt_linear_color_map.html" title="QwtLinearColorMap builds a color map from color stops.">QwtLinearColorMap</a>( <span class="keyword">const</span> <a class="code" href="class_qwt_linear_color_map.html" title="QwtLinearColorMap builds a color map from color stops.">QwtLinearColorMap</a> &amp; );
<a name="l00131"></a>00131     <a class="code" href="class_qwt_linear_color_map.html" title="QwtLinearColorMap builds a color map from color stops.">QwtLinearColorMap</a> &amp;operator=( <span class="keyword">const</span> <a class="code" href="class_qwt_linear_color_map.html" title="QwtLinearColorMap builds a color map from color stops.">QwtLinearColorMap</a> &amp; );
<a name="l00132"></a>00132 
<a name="l00133"></a>00133     <span class="keyword">class </span>PrivateData;
<a name="l00134"></a>00134     PrivateData *d_data;
<a name="l00135"></a>00135 };
<a name="l00136"></a>00136 
<a name="l00140"></a><a class="code" href="class_qwt_alpha_color_map.html">00140</a> <span class="keyword">class </span>QWT_EXPORT <a class="code" href="class_qwt_alpha_color_map.html" title="QwtAlphaColorMap variies the alpha value of a color.">QwtAlphaColorMap</a>: <span class="keyword">public</span> <a class="code" href="class_qwt_color_map.html" title="QwtColorMap is used to map values into colors.">QwtColorMap</a>
<a name="l00141"></a>00141 {
<a name="l00142"></a>00142 <span class="keyword">public</span>:
<a name="l00143"></a>00143     <a class="code" href="class_qwt_alpha_color_map.html" title="QwtAlphaColorMap variies the alpha value of a color.">QwtAlphaColorMap</a>( <span class="keyword">const</span> QColor &amp; = QColor( Qt::gray ) );
<a name="l00144"></a>00144     <span class="keyword">virtual</span> ~<a class="code" href="class_qwt_alpha_color_map.html" title="QwtAlphaColorMap variies the alpha value of a color.">QwtAlphaColorMap</a>();
<a name="l00145"></a>00145 
<a name="l00146"></a>00146     <span class="keywordtype">void</span> setColor( <span class="keyword">const</span> QColor &amp; );
<a name="l00147"></a>00147     QColor <a class="code" href="class_qwt_color_map.html#a35f74175e963d18e451a9fd4421ede1f">color</a>() <span class="keyword">const</span>;
<a name="l00148"></a>00148 
<a name="l00149"></a>00149     <span class="keyword">virtual</span> QRgb <a class="code" href="class_qwt_color_map.html#aaed0bb47b6379696c588732348438136">rgb</a>( <span class="keyword">const</span> <a class="code" href="class_qwt_interval.html" title="A class representing an interval.">QwtInterval</a> &amp;, <span class="keywordtype">double</span> value ) <span class="keyword">const</span>;
<a name="l00150"></a>00150 
<a name="l00151"></a>00151 <span class="keyword">private</span>:
<a name="l00152"></a>00152     <a class="code" href="class_qwt_alpha_color_map.html" title="QwtAlphaColorMap variies the alpha value of a color.">QwtAlphaColorMap</a>( <span class="keyword">const</span> <a class="code" href="class_qwt_alpha_color_map.html" title="QwtAlphaColorMap variies the alpha value of a color.">QwtAlphaColorMap</a> &amp; );
<a name="l00153"></a>00153     <a class="code" href="class_qwt_alpha_color_map.html" title="QwtAlphaColorMap variies the alpha value of a color.">QwtAlphaColorMap</a> &amp;operator=( <span class="keyword">const</span> <a class="code" href="class_qwt_alpha_color_map.html" title="QwtAlphaColorMap variies the alpha value of a color.">QwtAlphaColorMap</a> &amp; );
<a name="l00154"></a>00154 
<a name="l00155"></a>00155     <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="class_qwt_color_map.html#a762baa2edca8773ec09e0c1c5df2cf04">colorIndex</a>(
<a name="l00156"></a>00156         <span class="keyword">const</span> <a class="code" href="class_qwt_interval.html" title="A class representing an interval.">QwtInterval</a> &amp;, <span class="keywordtype">double</span> value ) <span class="keyword">const</span>;
<a name="l00157"></a>00157 
<a name="l00158"></a>00158     <span class="keyword">class </span>PrivateData;
<a name="l00159"></a>00159     PrivateData *d_data;
<a name="l00160"></a>00160 };
<a name="l00161"></a>00161 
<a name="l00162"></a>00162 
<a name="l00175"></a><a class="code" href="class_qwt_color_map.html#a35f74175e963d18e451a9fd4421ede1f">00175</a> <span class="keyword">inline</span> QColor <a class="code" href="class_qwt_color_map.html#a35f74175e963d18e451a9fd4421ede1f">QwtColorMap::color</a>(
<a name="l00176"></a>00176     <span class="keyword">const</span> <a class="code" href="class_qwt_interval.html" title="A class representing an interval.">QwtInterval</a> &amp;interval, <span class="keywordtype">double</span> value )<span class="keyword"> const</span>
<a name="l00177"></a>00177 <span class="keyword"></span>{
<a name="l00178"></a>00178     <span class="keywordflow">if</span> ( d_format == <a class="code" href="class_qwt_color_map.html#a9e5570790910fa3894887bca7dc5a670a663473fd836d9a84fe48ae1755de326a" title="The map is intended to map into QRgb values.">RGB</a> )
<a name="l00179"></a>00179     {
<a name="l00180"></a>00180         <span class="keywordflow">return</span> QColor( <a class="code" href="class_qwt_color_map.html#aaed0bb47b6379696c588732348438136">rgb</a>( interval, value ) );
<a name="l00181"></a>00181     }
<a name="l00182"></a>00182     <span class="keywordflow">else</span>
<a name="l00183"></a>00183     {
<a name="l00184"></a>00184         <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> index = <a class="code" href="class_qwt_color_map.html#a762baa2edca8773ec09e0c1c5df2cf04">colorIndex</a>( interval, value );
<a name="l00185"></a>00185         <span class="keywordflow">return</span> <a class="code" href="class_qwt_color_map.html#a4ccc23356e058783071b06dee437b6d7">colorTable</a>( interval )[index]; <span class="comment">// slow</span>
<a name="l00186"></a>00186     }
<a name="l00187"></a>00187 }
<a name="l00188"></a>00188 
<a name="l00193"></a><a class="code" href="class_qwt_color_map.html#a436802833ae1d4694f376655bc3d75be">00193</a> <span class="keyword">inline</span> <a class="code" href="class_qwt_color_map.html#a9e5570790910fa3894887bca7dc5a670">QwtColorMap::Format</a> <a class="code" href="class_qwt_color_map.html#a436802833ae1d4694f376655bc3d75be">QwtColorMap::format</a>()<span class="keyword"> const</span>
<a name="l00194"></a>00194 <span class="keyword"></span>{
<a name="l00195"></a>00195     <span class="keywordflow">return</span> d_format;
<a name="l00196"></a>00196 }
<a name="l00197"></a>00197 
<a name="l00198"></a>00198 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>Generated by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address>
</body>
</html>