<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>HippoDraw Class Library</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> <link rel="shortcut icon" href="hippoApp.ico"> </head><body> <!-- Generated by Doxygen 1.6.2 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="namespaces.html"><span>Namespaces</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> <li><a href="dirs.html"><span>Directories</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <div class="navpath"><a class="el" href="dir_e91d7d57230b93275afa36a649c1c346.html">colorreps</a> </div> </div> <div class="contents"> <h1>BinToRainbow.cxx</h1><a href="BinToRainbow_8cxx.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <a name="l00012"></a>00012 <span class="preprocessor">#include "<a class="code" href="BinToRainbow_8h.html" title="BinToEosA class interface.">BinToRainbow.h</a>"</span> <a name="l00013"></a>00013 <a name="l00014"></a>00014 <span class="keyword">using namespace </span>hippodraw; <a name="l00015"></a>00015 <a name="l00016"></a>00016 BinToRainbow:: <a name="l00017"></a><a class="code" href="classhippodraw_1_1BinToRainbow.html#a436f190cd2465a04d1fcf98cfbfea4d8">00017</a> BinToRainbow ( <span class="keyword">const</span> <span class="keywordtype">char</span> * name ) <a name="l00018"></a>00018 : <a class="code" href="classhippodraw_1_1BinToColorMap.html" title="The base class for the value to the color transformation.">BinToColorMap</a> ( name ) <a name="l00019"></a>00019 { <a name="l00020"></a>00020 <a class="code" href="classhippodraw_1_1BinToColorMap.html#a1951711673d1297250e9607dc140fc1a" title="vector of reds for color map.">m_reds</a>.resize ( 256); <a name="l00021"></a>00021 <a class="code" href="classhippodraw_1_1BinToColorMap.html#a7b97174c3ea3639f19956c1a869f2276" title="vector of greens for color map.">m_greens</a>.resize ( 256 ); <a name="l00022"></a>00022 <a class="code" href="classhippodraw_1_1BinToColorMap.html#a067a68d593da370b79eeb6f9f0d75fe7" title="vector of blues for color map.">m_blues</a>.resize ( 256 ); <a name="l00023"></a>00023 <a name="l00024"></a>00024 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i < 256; i++ ) { <a name="l00025"></a>00025 <span class="keywordflow">if</span> ( i < 64 ) { <a name="l00026"></a>00026 <a class="code" href="classhippodraw_1_1BinToColorMap.html#a1951711673d1297250e9607dc140fc1a" title="vector of reds for color map.">m_reds</a>[i] = 0; <a name="l00027"></a>00027 <a class="code" href="classhippodraw_1_1BinToColorMap.html#a7b97174c3ea3639f19956c1a869f2276" title="vector of greens for color map.">m_greens</a>[i] = 4*i; <a name="l00028"></a>00028 <a class="code" href="classhippodraw_1_1BinToColorMap.html#a067a68d593da370b79eeb6f9f0d75fe7" title="vector of blues for color map.">m_blues</a>[i] = 255; <a name="l00029"></a>00029 } <a name="l00030"></a>00030 <span class="keywordflow">if</span> ( i >= 64 && i < 192 ) { <a name="l00031"></a>00031 <a class="code" href="classhippodraw_1_1BinToColorMap.html#a1951711673d1297250e9607dc140fc1a" title="vector of reds for color map.">m_reds</a> [i] = 2 * ( i - 64 ); <a name="l00032"></a>00032 <a class="code" href="classhippodraw_1_1BinToColorMap.html#a7b97174c3ea3639f19956c1a869f2276" title="vector of greens for color map.">m_greens</a>[i] = 255; <a name="l00033"></a>00033 <a class="code" href="classhippodraw_1_1BinToColorMap.html#a067a68d593da370b79eeb6f9f0d75fe7" title="vector of blues for color map.">m_blues</a>[i] = 255 - <a class="code" href="classhippodraw_1_1BinToColorMap.html#a1951711673d1297250e9607dc140fc1a" title="vector of reds for color map.">m_reds</a>[i]; <a name="l00034"></a>00034 } <a name="l00035"></a>00035 <span class="keywordflow">if</span> ( i >= 192 ) { <a name="l00036"></a>00036 <a class="code" href="classhippodraw_1_1BinToColorMap.html#a1951711673d1297250e9607dc140fc1a" title="vector of reds for color map.">m_reds</a>[i] = 255; <a name="l00037"></a>00037 <a class="code" href="classhippodraw_1_1BinToColorMap.html#a7b97174c3ea3639f19956c1a869f2276" title="vector of greens for color map.">m_greens</a>[i] = 255 - 4*( i- 192); <a name="l00038"></a>00038 <a class="code" href="classhippodraw_1_1BinToColorMap.html#a067a68d593da370b79eeb6f9f0d75fe7" title="vector of blues for color map.">m_blues</a>[i] = 0; <a name="l00039"></a>00039 } <a name="l00040"></a>00040 } <a name="l00041"></a>00041 } <a name="l00042"></a>00042 <a name="l00043"></a><a class="code" href="classhippodraw_1_1BinToRainbow.html#abcc8c034305f1bc854252209c5397dd8">00043</a> <a class="code" href="classhippodraw_1_1BinToRainbow.html#a436f190cd2465a04d1fcf98cfbfea4d8" title="The constructor.">BinToRainbow::BinToRainbow</a> ( <span class="keyword">const</span> <a class="code" href="classhippodraw_1_1BinToRainbow.html" title="This class implements a value to nature colors.">BinToRainbow</a> & bin_to_color ) <a name="l00044"></a>00044 : <a class="code" href="classhippodraw_1_1BinToColorMap.html" title="The base class for the value to the color transformation.">BinToColorMap</a> ( bin_to_color ) <a name="l00045"></a>00045 { <a name="l00046"></a>00046 } <a name="l00047"></a>00047 <a name="l00048"></a><a class="code" href="classhippodraw_1_1BinToRainbow.html#acf2d9ae0de44b8efbce24084b3ea5184">00048</a> <a class="code" href="classhippodraw_1_1BinToColor.html" title="The base class for the value to the color transformation.">BinToColor</a> * <a class="code" href="classhippodraw_1_1BinToRainbow.html#acf2d9ae0de44b8efbce24084b3ea5184" title="Creates a copy of itself.">BinToRainbow::clone</a> ()<span class="keyword"> const</span> <a name="l00049"></a>00049 <span class="keyword"></span>{ <a name="l00050"></a>00050 <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="classhippodraw_1_1BinToRainbow.html#a436f190cd2465a04d1fcf98cfbfea4d8" title="The constructor.">BinToRainbow</a> ( *<span class="keyword">this</span> ); <a name="l00051"></a>00051 } <a name="l00052"></a>00052 </pre></div></div> <hr size="1"><address style="align: right;"><small> Generated for HippoDraw Class Library by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border=0> </a> </small></address> </body> </html>