Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > d364378b9c6df53cf5963e903015729e > files > 304

irrlicht-doc-1.8.1-3.mga4.noarch.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>Irrlicht 3D Engine: SColor.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="irrlichtlogo.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Irrlicht 3D Engine
   
   </div>
   
  </td>
  
  
  
   
   <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
</td>
   
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="dynsections.js"></script>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('_s_color_8h.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">SColor.h</div>  </div>
</div>
<div class="contents">
<a href="_s_color_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// Copyright (C) 2002-2012 Nikolaus Gebhardt</span>
<a name="l00002"></a>00002 <span class="comment">// This file is part of the &quot;Irrlicht Engine&quot;.</span>
<a name="l00003"></a>00003 <span class="comment">// For conditions of distribution and use, see copyright notice in irrlicht.h</span>
<a name="l00004"></a>00004 
<a name="l00005"></a>00005 <span class="preprocessor">#ifndef __COLOR_H_INCLUDED__</span>
<a name="l00006"></a>00006 <span class="preprocessor"></span><span class="preprocessor">#define __COLOR_H_INCLUDED__</span>
<a name="l00007"></a>00007 <span class="preprocessor"></span>
<a name="l00008"></a>00008 <span class="preprocessor">#include &quot;<a class="code" href="irr_types_8h.html">irrTypes.h</a>&quot;</span>
<a name="l00009"></a>00009 <span class="preprocessor">#include &quot;<a class="code" href="irr_math_8h.html">irrMath.h</a>&quot;</span>
<a name="l00010"></a>00010 
<a name="l00011"></a>00011 <span class="keyword">namespace </span>irr
<a name="l00012"></a>00012 {
<a name="l00013"></a>00013 <span class="keyword">namespace </span>video
<a name="l00014"></a>00014 {
<a name="l00016"></a>00016 
<a name="l00017"></a><a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829ed">00017</a>     <span class="keyword">enum</span> <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829ed" title="An enum for the color format of textures used by the Irrlicht Engine.">ECOLOR_FORMAT</a>
<a name="l00018"></a>00018     {
<a name="l00020"></a>00020 
<a name="l00023"></a><a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda1207765b5eab1701111b5dc37b68b4bf">00023</a>         <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda1207765b5eab1701111b5dc37b68b4bf" title="16 bit color format used by the software driver.">ECF_A1R5G5B5</a> = 0,
<a name="l00024"></a>00024 
<a name="l00026"></a><a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda49b4fe9d0ba395456dcd7c76a1ae9775">00026</a>         <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda49b4fe9d0ba395456dcd7c76a1ae9775" title="Standard 16 bit color format.">ECF_R5G6B5</a>,
<a name="l00027"></a>00027 
<a name="l00029"></a><a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda3f0380aafb1e1fd59f5419a95d630a6d">00029</a>         <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda3f0380aafb1e1fd59f5419a95d630a6d" title="24 bit color, no alpha channel, but 8 bit for red, green and blue.">ECF_R8G8B8</a>,
<a name="l00030"></a>00030 
<a name="l00032"></a><a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda55c57d63efff39efe33ee733fe962df0">00032</a>         <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda55c57d63efff39efe33ee733fe962df0" title="Default 32 bit color format. 8 bits are used for every component: red, green, blue and alpha...">ECF_A8R8G8B8</a>,
<a name="l00033"></a>00033 
<a name="l00036"></a>00036 
<a name="l00037"></a><a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829edaaa87f3817817a302753b8dbb26fc72ec">00037</a>         <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829edaaa87f3817817a302753b8dbb26fc72ec" title="16 bit floating point format using 16 bits for the red channel.">ECF_R16F</a>,
<a name="l00038"></a>00038 
<a name="l00040"></a><a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829edafc5bcc8f47e78d073130300229c22113">00040</a>         <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829edafc5bcc8f47e78d073130300229c22113" title="32 bit floating point format using 16 bits for the red channel and 16 bits for the green channel...">ECF_G16R16F</a>,
<a name="l00041"></a>00041 
<a name="l00043"></a><a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda91a9f2eeac94b28d4e1421625b53ab5e">00043</a>         <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda91a9f2eeac94b28d4e1421625b53ab5e" title="64 bit floating point format 16 bits are used for the red, green, blue and alpha channels.">ECF_A16B16G16R16F</a>,
<a name="l00044"></a>00044 
<a name="l00046"></a><a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829edad271018ac22c4ff6c76c8ebb870a6c96">00046</a>         <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829edad271018ac22c4ff6c76c8ebb870a6c96" title="32 bit floating point format using 32 bits for the red channel.">ECF_R32F</a>,
<a name="l00047"></a>00047 
<a name="l00049"></a><a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda92ab57e6c0b93f96b08db4dc5656aea2">00049</a>         <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda92ab57e6c0b93f96b08db4dc5656aea2" title="64 bit floating point format using 32 bits for the red channel and 32 bits for the green channel...">ECF_G32R32F</a>,
<a name="l00050"></a>00050 
<a name="l00052"></a><a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda22958f549a8322e81b5210edaa172157">00052</a>         <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda22958f549a8322e81b5210edaa172157" title="128 bit floating point format. 32 bits are used for the red, green, blue and alpha channels...">ECF_A32B32G32R32F</a>,
<a name="l00053"></a>00053 
<a name="l00055"></a><a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda209608685f06c86c6ae489896a246e77">00055</a>         <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda209608685f06c86c6ae489896a246e77" title="Unknown color format:">ECF_UNKNOWN</a>
<a name="l00056"></a>00056     };
<a name="l00057"></a>00057 
<a name="l00058"></a>00058 
<a name="l00060"></a><a class="code" href="namespaceirr_1_1video.html#a65997ac1b7b7544acc0f4757be7860d1">00060</a>     <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> <a class="code" href="namespaceirr_1_1video.html#a65997ac1b7b7544acc0f4757be7860d1" title="Creates a 16 bit A1R5G5B5 color.">RGBA16</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> r, <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> g, <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> b, <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> a=0xFF)
<a name="l00061"></a>00061     {
<a name="l00062"></a>00062         <span class="keywordflow">return</span> (<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a>)((a &amp; 0x80) &lt;&lt; 8 |
<a name="l00063"></a>00063             (r &amp; 0xF8) &lt;&lt; 7 |
<a name="l00064"></a>00064             (g &amp; 0xF8) &lt;&lt; 2 |
<a name="l00065"></a>00065             (b &amp; 0xF8) &gt;&gt; 3);
<a name="l00066"></a>00066     }
<a name="l00067"></a>00067 
<a name="l00068"></a>00068 
<a name="l00070"></a><a class="code" href="namespaceirr_1_1video.html#a55f59b4905cab236a03cb420fd55830d">00070</a>     <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> <a class="code" href="namespaceirr_1_1video.html#a55f59b4905cab236a03cb420fd55830d" title="Creates a 16 bit A1R5G5B5 color.">RGB16</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> r, <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> g, <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> b)
<a name="l00071"></a>00071     {
<a name="l00072"></a>00072         <span class="keywordflow">return</span> <a class="code" href="namespaceirr_1_1video.html#a65997ac1b7b7544acc0f4757be7860d1" title="Creates a 16 bit A1R5G5B5 color.">RGBA16</a>(r,g,b);
<a name="l00073"></a>00073     }
<a name="l00074"></a>00074 
<a name="l00075"></a>00075 
<a name="l00077"></a><a class="code" href="namespaceirr_1_1video.html#a1f8b2e9ef461d76c0723536f776c2e36">00077</a>     <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> <a class="code" href="namespaceirr_1_1video.html#a1f8b2e9ef461d76c0723536f776c2e36" title="Creates a 16bit A1R5G5B5 color, based on 16bit input values.">RGB16from16</a>(<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> r, <a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> g, <a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> b)
<a name="l00078"></a>00078     {
<a name="l00079"></a>00079         <span class="keywordflow">return</span> (0x8000 |
<a name="l00080"></a>00080                 (r &amp; 0x1F) &lt;&lt; 10 |
<a name="l00081"></a>00081                 (g &amp; 0x1F) &lt;&lt; 5  |
<a name="l00082"></a>00082                 (b &amp; 0x1F));
<a name="l00083"></a>00083     }
<a name="l00084"></a>00084 
<a name="l00085"></a>00085 
<a name="l00087"></a><a class="code" href="namespaceirr_1_1video.html#a6824dfc9c71a7fd9d7a3e704b1267ddc">00087</a>     <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> <a class="code" href="namespaceirr_1_1video.html#a6824dfc9c71a7fd9d7a3e704b1267ddc" title="Converts a 32bit (X8R8G8B8) color to a 16bit A1R5G5B5 color.">X8R8G8B8toA1R5G5B5</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> color)
<a name="l00088"></a>00088     {
<a name="l00089"></a>00089         <span class="keywordflow">return</span> (<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a>)(0x8000 |
<a name="l00090"></a>00090             ( color &amp; 0x00F80000) &gt;&gt; 9 |
<a name="l00091"></a>00091             ( color &amp; 0x0000F800) &gt;&gt; 6 |
<a name="l00092"></a>00092             ( color &amp; 0x000000F8) &gt;&gt; 3);
<a name="l00093"></a>00093     }
<a name="l00094"></a>00094 
<a name="l00095"></a>00095 
<a name="l00097"></a><a class="code" href="namespaceirr_1_1video.html#a929c6758a0edc772cf69b2c674e4f5cd">00097</a>     <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> <a class="code" href="namespaceirr_1_1video.html#a929c6758a0edc772cf69b2c674e4f5cd" title="Converts a 32bit (A8R8G8B8) color to a 16bit A1R5G5B5 color.">A8R8G8B8toA1R5G5B5</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> color)
<a name="l00098"></a>00098     {
<a name="l00099"></a>00099         <span class="keywordflow">return</span> (<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a>)(( color &amp; 0x80000000) &gt;&gt; 16|
<a name="l00100"></a>00100             ( color &amp; 0x00F80000) &gt;&gt; 9 |
<a name="l00101"></a>00101             ( color &amp; 0x0000F800) &gt;&gt; 6 |
<a name="l00102"></a>00102             ( color &amp; 0x000000F8) &gt;&gt; 3);
<a name="l00103"></a>00103     }
<a name="l00104"></a>00104 
<a name="l00105"></a>00105 
<a name="l00107"></a><a class="code" href="namespaceirr_1_1video.html#a10636302b225d7f525fa46bbd3f747a4">00107</a>     <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> <a class="code" href="namespaceirr_1_1video.html#a10636302b225d7f525fa46bbd3f747a4" title="Converts a 32bit (A8R8G8B8) color to a 16bit R5G6B5 color.">A8R8G8B8toR5G6B5</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> color)
<a name="l00108"></a>00108     {
<a name="l00109"></a>00109         <span class="keywordflow">return</span> (<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a>)(( color &amp; 0x00F80000) &gt;&gt; 8 |
<a name="l00110"></a>00110             ( color &amp; 0x0000FC00) &gt;&gt; 5 |
<a name="l00111"></a>00111             ( color &amp; 0x000000F8) &gt;&gt; 3);
<a name="l00112"></a>00112     }
<a name="l00113"></a>00113 
<a name="l00114"></a>00114 
<a name="l00116"></a>00116 
<a name="l00117"></a><a class="code" href="namespaceirr_1_1video.html#a8aa9e69faa25064379df5a91273b9fbe">00117</a>     <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="namespaceirr_1_1video.html#a8aa9e69faa25064379df5a91273b9fbe" title="Convert A8R8G8B8 Color from A1R5G5B5 color.">A1R5G5B5toA8R8G8B8</a>(<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> color)
<a name="l00118"></a>00118     {
<a name="l00119"></a>00119         <span class="keywordflow">return</span> ( (( -( (<a class="code" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a>) color &amp; 0x00008000 ) &gt;&gt; (<a class="code" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a>) 31 ) &amp; 0xFF000000 ) |
<a name="l00120"></a>00120                 (( color &amp; 0x00007C00 ) &lt;&lt; 9) | (( color &amp; 0x00007000 ) &lt;&lt; 4) |
<a name="l00121"></a>00121                 (( color &amp; 0x000003E0 ) &lt;&lt; 6) | (( color &amp; 0x00000380 ) &lt;&lt; 1) |
<a name="l00122"></a>00122                 (( color &amp; 0x0000001F ) &lt;&lt; 3) | (( color &amp; 0x0000001C ) &gt;&gt; 2)
<a name="l00123"></a>00123                 );
<a name="l00124"></a>00124     }
<a name="l00125"></a>00125 
<a name="l00126"></a>00126 
<a name="l00128"></a><a class="code" href="namespaceirr_1_1video.html#a421971627afe81533a3c2b51907b72bd">00128</a>     <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="namespaceirr_1_1video.html#a421971627afe81533a3c2b51907b72bd" title="Returns A8R8G8B8 Color from R5G6B5 color.">R5G6B5toA8R8G8B8</a>(<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> color)
<a name="l00129"></a>00129     {
<a name="l00130"></a>00130         <span class="keywordflow">return</span> 0xFF000000 |
<a name="l00131"></a>00131             ((color &amp; 0xF800) &lt;&lt; 8)|
<a name="l00132"></a>00132             ((color &amp; 0x07E0) &lt;&lt; 5)|
<a name="l00133"></a>00133             ((color &amp; 0x001F) &lt;&lt; 3);
<a name="l00134"></a>00134     }
<a name="l00135"></a>00135 
<a name="l00136"></a>00136 
<a name="l00138"></a><a class="code" href="namespaceirr_1_1video.html#aaeb39c8fc1b9c4e78b68e2da210f70ff">00138</a>     <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> <a class="code" href="namespaceirr_1_1video.html#aaeb39c8fc1b9c4e78b68e2da210f70ff" title="Returns A1R5G5B5 Color from R5G6B5 color.">R5G6B5toA1R5G5B5</a>(<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> color)
<a name="l00139"></a>00139     {
<a name="l00140"></a>00140         <span class="keywordflow">return</span> 0x8000 | (((color &amp; 0xFFC0) &gt;&gt; 1) | (color &amp; 0x1F));
<a name="l00141"></a>00141     }
<a name="l00142"></a>00142 
<a name="l00143"></a>00143 
<a name="l00145"></a><a class="code" href="namespaceirr_1_1video.html#a4906b4425165ee533dab17506fe98ce8">00145</a>     <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> <a class="code" href="namespaceirr_1_1video.html#a4906b4425165ee533dab17506fe98ce8" title="Returns R5G6B5 Color from A1R5G5B5 color.">A1R5G5B5toR5G6B5</a>(<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> color)
<a name="l00146"></a>00146     {
<a name="l00147"></a>00147         <span class="keywordflow">return</span> (((color &amp; 0x7FE0) &lt;&lt; 1) | (color &amp; 0x1F));
<a name="l00148"></a>00148     }
<a name="l00149"></a>00149 
<a name="l00150"></a>00150 
<a name="l00151"></a>00151 
<a name="l00153"></a>00153 
<a name="l00155"></a><a class="code" href="namespaceirr_1_1video.html#a23358b142a005c4a4c747d227a4d77ab">00155</a>     <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="namespaceirr_1_1video.html#a23358b142a005c4a4c747d227a4d77ab" title="Returns the alpha component from A1R5G5B5 color.">getAlpha</a>(<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> color)
<a name="l00156"></a>00156     {
<a name="l00157"></a>00157         <span class="keywordflow">return</span> ((color &gt;&gt; 15)&amp;0x1);
<a name="l00158"></a>00158     }
<a name="l00159"></a>00159 
<a name="l00160"></a>00160 
<a name="l00162"></a>00162 
<a name="l00163"></a><a class="code" href="namespaceirr_1_1video.html#aa98234702c65c82ce29115b12e89dafe">00163</a>     <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="namespaceirr_1_1video.html#aa98234702c65c82ce29115b12e89dafe" title="Returns the red component from A1R5G5B5 color.">getRed</a>(<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> color)
<a name="l00164"></a>00164     {
<a name="l00165"></a>00165         <span class="keywordflow">return</span> ((color &gt;&gt; 10)&amp;0x1F);
<a name="l00166"></a>00166     }
<a name="l00167"></a>00167 
<a name="l00168"></a>00168 
<a name="l00170"></a>00170 
<a name="l00171"></a><a class="code" href="namespaceirr_1_1video.html#a3e64185c36326ed33a494ba14cac00a5">00171</a>     <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="namespaceirr_1_1video.html#a3e64185c36326ed33a494ba14cac00a5" title="Returns the green component from A1R5G5B5 color.">getGreen</a>(<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> color)
<a name="l00172"></a>00172     {
<a name="l00173"></a>00173         <span class="keywordflow">return</span> ((color &gt;&gt; 5)&amp;0x1F);
<a name="l00174"></a>00174     }
<a name="l00175"></a>00175 
<a name="l00176"></a>00176 
<a name="l00178"></a>00178 
<a name="l00179"></a><a class="code" href="namespaceirr_1_1video.html#ae8dc9edd5a3eb01de47933ac2d7f679e">00179</a>     <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="namespaceirr_1_1video.html#ae8dc9edd5a3eb01de47933ac2d7f679e" title="Returns the blue component from A1R5G5B5 color.">getBlue</a>(<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> color)
<a name="l00180"></a>00180     {
<a name="l00181"></a>00181         <span class="keywordflow">return</span> (color &amp; 0x1F);
<a name="l00182"></a>00182     }
<a name="l00183"></a>00183 
<a name="l00184"></a>00184 
<a name="l00186"></a><a class="code" href="namespaceirr_1_1video.html#ab242fde6c6e19ae4100fe39b0dadd9d0">00186</a>     <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> <a class="code" href="namespaceirr_1_1video.html#ab242fde6c6e19ae4100fe39b0dadd9d0" title="Returns the average from a 16 bit A1R5G5B5 color.">getAverage</a>(<a class="code" href="namespaceirr.html#a43ace0af066371ac0862bac3f7314220" title="16 bit signed variable.">s16</a> color)
<a name="l00187"></a>00187     {
<a name="l00188"></a>00188         <span class="keywordflow">return</span> ((<a class="code" href="namespaceirr_1_1video.html#aa98234702c65c82ce29115b12e89dafe" title="Returns the red component from A1R5G5B5 color.">getRed</a>(color)&lt;&lt;3) + (<a class="code" href="namespaceirr_1_1video.html#a3e64185c36326ed33a494ba14cac00a5" title="Returns the green component from A1R5G5B5 color.">getGreen</a>(color)&lt;&lt;3) + (<a class="code" href="namespaceirr_1_1video.html#ae8dc9edd5a3eb01de47933ac2d7f679e" title="Returns the blue component from A1R5G5B5 color.">getBlue</a>(color)&lt;&lt;3)) / 3;
<a name="l00189"></a>00189     }
<a name="l00190"></a>00190 
<a name="l00191"></a>00191 
<a name="l00193"></a>00193 
<a name="l00201"></a><a class="code" href="classirr_1_1video_1_1_s_color.html">00201</a>     <span class="keyword">class </span><a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">SColor</a>
<a name="l00202"></a>00202     {
<a name="l00203"></a>00203     <span class="keyword">public</span>:
<a name="l00204"></a>00204 
<a name="l00206"></a>00206 
<a name="l00207"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#ab001c0c2515ff5f8a0b324d1345485f4">00207</a>         <a class="code" href="classirr_1_1video_1_1_s_color.html#ab001c0c2515ff5f8a0b324d1345485f4" title="Constructor of the Color. Does nothing.">SColor</a>() {}
<a name="l00208"></a>00208 
<a name="l00210"></a>00210 
<a name="l00211"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#aa2ca1fcb9b11375282bb407b635b3dd6">00211</a>         <a class="code" href="classirr_1_1video_1_1_s_color.html#ab001c0c2515ff5f8a0b324d1345485f4" title="Constructor of the Color. Does nothing.">SColor</a> (<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> a, <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> r, <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> g, <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> b)
<a name="l00212"></a>00212             : <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a>(((a &amp; 0xff)&lt;&lt;24) | ((r &amp; 0xff)&lt;&lt;16) | ((g &amp; 0xff)&lt;&lt;8) | (b &amp; 0xff)) {}
<a name="l00213"></a>00213 
<a name="l00215"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a56dd5677c3e36d3b33d5d796be2597da">00215</a>         <a class="code" href="classirr_1_1video_1_1_s_color.html#ab001c0c2515ff5f8a0b324d1345485f4" title="Constructor of the Color. Does nothing.">SColor</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> clr)
<a name="l00216"></a>00216             : <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a>(clr) {}
<a name="l00217"></a>00217 
<a name="l00219"></a>00219 
<a name="l00221"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a9647d09a9d4b9c6fb48a8fa1f2da425c">00221</a>         <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="classirr_1_1video_1_1_s_color.html#a9647d09a9d4b9c6fb48a8fa1f2da425c" title="Returns the alpha component of the color.">getAlpha</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a>&gt;&gt;24; }
<a name="l00222"></a>00222 
<a name="l00224"></a>00224 
<a name="l00226"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#af10d2deaccbde5c958032ed9ec81b59f">00226</a>         <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="classirr_1_1video_1_1_s_color.html#af10d2deaccbde5c958032ed9ec81b59f" title="Returns the red component of the color.">getRed</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> (<a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a>&gt;&gt;16) &amp; 0xff; }
<a name="l00227"></a>00227 
<a name="l00229"></a>00229 
<a name="l00231"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d">00231</a>         <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d" title="Returns the green component of the color.">getGreen</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> (<a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a>&gt;&gt;8) &amp; 0xff; }
<a name="l00232"></a>00232 
<a name="l00234"></a>00234 
<a name="l00236"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a26fdbde73081b35a1686f8d21a549544">00236</a>         <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="classirr_1_1video_1_1_s_color.html#a26fdbde73081b35a1686f8d21a549544" title="Returns the blue component of the color.">getBlue</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> &amp; 0xff; }
<a name="l00237"></a>00237 
<a name="l00239"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#aa96bfc155c181104c61df9d58ad8be0f">00239</a>         <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="classirr_1_1video_1_1_s_color.html#aa96bfc155c181104c61df9d58ad8be0f" title="Get lightness of the color in the range [0,255].">getLightness</a>()<span class="keyword"> const</span>
<a name="l00240"></a>00240 <span class="keyword">        </span>{
<a name="l00241"></a>00241             <span class="keywordflow">return</span> 0.5f*(<a class="code" href="namespaceirr_1_1core.html#afca1ce7ac54e0c31a9047947f4c7319b" title="returns maximum of two values. Own implementation to get rid of the STL (VS6 problems)">core::max_</a>(<a class="code" href="namespaceirr_1_1core.html#afca1ce7ac54e0c31a9047947f4c7319b" title="returns maximum of two values. Own implementation to get rid of the STL (VS6 problems)">core::max_</a>(<a class="code" href="classirr_1_1video_1_1_s_color.html#af10d2deaccbde5c958032ed9ec81b59f" title="Returns the red component of the color.">getRed</a>(),<a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d" title="Returns the green component of the color.">getGreen</a>()),<a class="code" href="classirr_1_1video_1_1_s_color.html#a26fdbde73081b35a1686f8d21a549544" title="Returns the blue component of the color.">getBlue</a>())+<a class="code" href="namespaceirr_1_1core.html#a9d34bfdbbe9c136b01ae04974572bc11" title="returns minimum of two values. Own implementation to get rid of the STL (VS6 problems)">core::min_</a>(<a class="code" href="namespaceirr_1_1core.html#a9d34bfdbbe9c136b01ae04974572bc11" title="returns minimum of two values. Own implementation to get rid of the STL (VS6 problems)">core::min_</a>(<a class="code" href="classirr_1_1video_1_1_s_color.html#af10d2deaccbde5c958032ed9ec81b59f" title="Returns the red component of the color.">getRed</a>(),<a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d" title="Returns the green component of the color.">getGreen</a>()),<a class="code" href="classirr_1_1video_1_1_s_color.html#a26fdbde73081b35a1686f8d21a549544" title="Returns the blue component of the color.">getBlue</a>()));
<a name="l00242"></a>00242         }
<a name="l00243"></a>00243 
<a name="l00245"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#ad0a78b90a97e8444a1d12e93e7e929ba">00245</a>         <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="classirr_1_1video_1_1_s_color.html#ad0a78b90a97e8444a1d12e93e7e929ba" title="Get luminance of the color in the range [0,255].">getLuminance</a>()<span class="keyword"> const</span>
<a name="l00246"></a>00246 <span class="keyword">        </span>{
<a name="l00247"></a>00247             <span class="keywordflow">return</span> 0.3f*<a class="code" href="classirr_1_1video_1_1_s_color.html#af10d2deaccbde5c958032ed9ec81b59f" title="Returns the red component of the color.">getRed</a>() + 0.59f*<a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d" title="Returns the green component of the color.">getGreen</a>() + 0.11f*<a class="code" href="classirr_1_1video_1_1_s_color.html#a26fdbde73081b35a1686f8d21a549544" title="Returns the blue component of the color.">getBlue</a>();
<a name="l00248"></a>00248         }
<a name="l00249"></a>00249 
<a name="l00251"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a29a672f4bae9805970b84c4aef81b9ab">00251</a>         <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="classirr_1_1video_1_1_s_color.html#a29a672f4bae9805970b84c4aef81b9ab" title="Get average intensity of the color in the range [0,255].">getAverage</a>()<span class="keyword"> const</span>
<a name="l00252"></a>00252 <span class="keyword">        </span>{
<a name="l00253"></a>00253             <span class="keywordflow">return</span> ( <a class="code" href="classirr_1_1video_1_1_s_color.html#af10d2deaccbde5c958032ed9ec81b59f" title="Returns the red component of the color.">getRed</a>() + <a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d" title="Returns the green component of the color.">getGreen</a>() + <a class="code" href="classirr_1_1video_1_1_s_color.html#a26fdbde73081b35a1686f8d21a549544" title="Returns the blue component of the color.">getBlue</a>() ) / 3;
<a name="l00254"></a>00254         }
<a name="l00255"></a>00255 
<a name="l00257"></a>00257 
<a name="l00259"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a7bfe4abc30d563668b947c8bdb055bab">00259</a>         <span class="keywordtype">void</span> <a class="code" href="classirr_1_1video_1_1_s_color.html#a7bfe4abc30d563668b947c8bdb055bab" title="Sets the alpha component of the Color.">setAlpha</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> a) { <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> = ((a &amp; 0xff)&lt;&lt;24) | (<a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> &amp; 0x00ffffff); }
<a name="l00260"></a>00260 
<a name="l00262"></a>00262 
<a name="l00264"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a950c98714711ae9dd8c5219f83c07693">00264</a>         <span class="keywordtype">void</span> <a class="code" href="classirr_1_1video_1_1_s_color.html#a950c98714711ae9dd8c5219f83c07693" title="Sets the red component of the Color.">setRed</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> r) { <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> = ((r &amp; 0xff)&lt;&lt;16) | (<a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> &amp; 0xff00ffff); }
<a name="l00265"></a>00265 
<a name="l00267"></a>00267 
<a name="l00269"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#af80cfedd5e761216b8bed259963ac948">00269</a>         <span class="keywordtype">void</span> <a class="code" href="classirr_1_1video_1_1_s_color.html#af80cfedd5e761216b8bed259963ac948" title="Sets the green component of the Color.">setGreen</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> g) { <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> = ((g &amp; 0xff)&lt;&lt;8) | (<a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> &amp; 0xffff00ff); }
<a name="l00270"></a>00270 
<a name="l00272"></a>00272 
<a name="l00274"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a13d82e6b52d32f7394f3cce041dc2965">00274</a>         <span class="keywordtype">void</span> <a class="code" href="classirr_1_1video_1_1_s_color.html#a13d82e6b52d32f7394f3cce041dc2965" title="Sets the blue component of the Color.">setBlue</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> b) { <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> = (b &amp; 0xff) | (<a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> &amp; 0xffffff00); }
<a name="l00275"></a>00275 
<a name="l00277"></a>00277 
<a name="l00278"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a9a6ad04081a1b15c07746cf84a971565">00278</a>         <a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> <a class="code" href="classirr_1_1video_1_1_s_color.html#a9a6ad04081a1b15c07746cf84a971565" title="Calculates a 16 bit A1R5G5B5 value of this color.">toA1R5G5B5</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="namespaceirr_1_1video.html#a929c6758a0edc772cf69b2c674e4f5cd" title="Converts a 32bit (A8R8G8B8) color to a 16bit A1R5G5B5 color.">A8R8G8B8toA1R5G5B5</a>(<a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a>); }
<a name="l00279"></a>00279 
<a name="l00281"></a>00281 
<a name="l00284"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a0196acc3dfded9f6161c41f0065267c1">00284</a>         <span class="keywordtype">void</span> <a class="code" href="classirr_1_1video_1_1_s_color.html#a0196acc3dfded9f6161c41f0065267c1" title="Converts color to OpenGL color format.">toOpenGLColor</a>(<a class="code" href="namespaceirr.html#a646874f69af8ff87fc10201b0254a761" title="8 bit unsigned variable.">u8</a>* dest)<span class="keyword"> const</span>
<a name="l00285"></a>00285 <span class="keyword">        </span>{
<a name="l00286"></a>00286             *dest =   (<a class="code" href="namespaceirr.html#a646874f69af8ff87fc10201b0254a761" title="8 bit unsigned variable.">u8</a>)<a class="code" href="classirr_1_1video_1_1_s_color.html#af10d2deaccbde5c958032ed9ec81b59f" title="Returns the red component of the color.">getRed</a>();
<a name="l00287"></a>00287             *++dest = (<a class="code" href="namespaceirr.html#a646874f69af8ff87fc10201b0254a761" title="8 bit unsigned variable.">u8</a>)<a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d" title="Returns the green component of the color.">getGreen</a>();
<a name="l00288"></a>00288             *++dest = (<a class="code" href="namespaceirr.html#a646874f69af8ff87fc10201b0254a761" title="8 bit unsigned variable.">u8</a>)<a class="code" href="classirr_1_1video_1_1_s_color.html#a26fdbde73081b35a1686f8d21a549544" title="Returns the blue component of the color.">getBlue</a>();
<a name="l00289"></a>00289             *++dest = (<a class="code" href="namespaceirr.html#a646874f69af8ff87fc10201b0254a761" title="8 bit unsigned variable.">u8</a>)<a class="code" href="classirr_1_1video_1_1_s_color.html#a9647d09a9d4b9c6fb48a8fa1f2da425c" title="Returns the alpha component of the color.">getAlpha</a>();
<a name="l00290"></a>00290         }
<a name="l00291"></a>00291 
<a name="l00293"></a>00293 
<a name="l00307"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a8cf295c05c7406cc249843acbb31ec5f">00307</a>         <span class="keywordtype">void</span> <span class="keyword">set</span>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> a, <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> r, <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> g, <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> b)
<a name="l00308"></a>00308         {
<a name="l00309"></a>00309             <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> = (((a &amp; 0xff)&lt;&lt;24) | ((r &amp; 0xff)&lt;&lt;16) | ((g &amp; 0xff)&lt;&lt;8) | (b &amp; 0xff));
<a name="l00310"></a>00310         }
<a name="l00311"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a4966581260a89f10386bf9d06239c341">00311</a>         <span class="keywordtype">void</span> <span class="keyword">set</span>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> col) { <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> = col; }
<a name="l00312"></a>00312 
<a name="l00314"></a>00314 
<a name="l00315"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a68025038ef1c75c8b7ca64270216f79f">00315</a>         <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1video_1_1_s_color.html#a68025038ef1c75c8b7ca64270216f79f" title="Compares the color to another color.">operator==</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">SColor</a>&amp; other)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> other.<a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> == <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a>; }
<a name="l00316"></a>00316 
<a name="l00318"></a>00318 
<a name="l00319"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#abcacfc84b1a87f148570efb176999104">00319</a>         <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1video_1_1_s_color.html#abcacfc84b1a87f148570efb176999104" title="Compares the color to another color.">operator!=</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">SColor</a>&amp; other)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> other.<a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> != <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a>; }
<a name="l00320"></a>00320 
<a name="l00322"></a>00322 
<a name="l00323"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a8e7944ddc658076a2933861a1b99f1e7">00323</a>         <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1video_1_1_s_color.html#a8e7944ddc658076a2933861a1b99f1e7" title="comparison operator">operator&lt;</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">SColor</a>&amp; other)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> (<a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> &lt; other.<a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a>); }
<a name="l00324"></a>00324 
<a name="l00326"></a>00326 
<a name="l00328"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a1cd25e0e67050af13a15515b7d2c8782">00328</a>         <a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">SColor</a> <a class="code" href="classirr_1_1video_1_1_s_color.html#a1cd25e0e67050af13a15515b7d2c8782" title="Adds two colors, result is clamped to 0..255 values.">operator+</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">SColor</a>&amp; other)<span class="keyword"> const</span>
<a name="l00329"></a>00329 <span class="keyword">        </span>{
<a name="l00330"></a>00330             <span class="keywordflow">return</span> <a class="code" href="classirr_1_1video_1_1_s_color.html#ab001c0c2515ff5f8a0b324d1345485f4" title="Constructor of the Color. Does nothing.">SColor</a>(<a class="code" href="namespaceirr_1_1core.html#a9d34bfdbbe9c136b01ae04974572bc11" title="returns minimum of two values. Own implementation to get rid of the STL (VS6 problems)">core::min_</a>(<a class="code" href="classirr_1_1video_1_1_s_color.html#a9647d09a9d4b9c6fb48a8fa1f2da425c" title="Returns the alpha component of the color.">getAlpha</a>() + other.<a class="code" href="classirr_1_1video_1_1_s_color.html#a9647d09a9d4b9c6fb48a8fa1f2da425c" title="Returns the alpha component of the color.">getAlpha</a>(), 255u),
<a name="l00331"></a>00331                     <a class="code" href="namespaceirr_1_1core.html#a9d34bfdbbe9c136b01ae04974572bc11" title="returns minimum of two values. Own implementation to get rid of the STL (VS6 problems)">core::min_</a>(<a class="code" href="classirr_1_1video_1_1_s_color.html#af10d2deaccbde5c958032ed9ec81b59f" title="Returns the red component of the color.">getRed</a>() + other.<a class="code" href="classirr_1_1video_1_1_s_color.html#af10d2deaccbde5c958032ed9ec81b59f" title="Returns the red component of the color.">getRed</a>(), 255u),
<a name="l00332"></a>00332                     <a class="code" href="namespaceirr_1_1core.html#a9d34bfdbbe9c136b01ae04974572bc11" title="returns minimum of two values. Own implementation to get rid of the STL (VS6 problems)">core::min_</a>(<a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d" title="Returns the green component of the color.">getGreen</a>() + other.<a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d" title="Returns the green component of the color.">getGreen</a>(), 255u),
<a name="l00333"></a>00333                     <a class="code" href="namespaceirr_1_1core.html#a9d34bfdbbe9c136b01ae04974572bc11" title="returns minimum of two values. Own implementation to get rid of the STL (VS6 problems)">core::min_</a>(<a class="code" href="classirr_1_1video_1_1_s_color.html#a26fdbde73081b35a1686f8d21a549544" title="Returns the blue component of the color.">getBlue</a>() + other.<a class="code" href="classirr_1_1video_1_1_s_color.html#a26fdbde73081b35a1686f8d21a549544" title="Returns the blue component of the color.">getBlue</a>(), 255u));
<a name="l00334"></a>00334         }
<a name="l00335"></a>00335 
<a name="l00337"></a>00337 
<a name="l00340"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a880760bf37e7c2143cc0b1a0e90a85b1">00340</a>         <a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">SColor</a> <a class="code" href="classirr_1_1video_1_1_s_color.html#a880760bf37e7c2143cc0b1a0e90a85b1" title="Interpolates the color with a f32 value to another color.">getInterpolated</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">SColor</a> &amp;other, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> d)<span class="keyword"> const</span>
<a name="l00341"></a>00341 <span class="keyword">        </span>{
<a name="l00342"></a>00342             d = <a class="code" href="namespaceirr_1_1core.html#a6162f685b68f629e77336081d3316969" title="clamps a value between low and high">core::clamp</a>(d, 0.f, 1.f);
<a name="l00343"></a>00343             <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> inv = 1.0f - d;
<a name="l00344"></a>00344             <span class="keywordflow">return</span> <a class="code" href="classirr_1_1video_1_1_s_color.html#ab001c0c2515ff5f8a0b324d1345485f4" title="Constructor of the Color. Does nothing.">SColor</a>((<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a>)<a class="code" href="namespaceirr_1_1core.html#ae46f57f03e9033c57c180fbe83b04cf2">core::round32</a>(other.<a class="code" href="classirr_1_1video_1_1_s_color.html#a9647d09a9d4b9c6fb48a8fa1f2da425c" title="Returns the alpha component of the color.">getAlpha</a>()*inv + <a class="code" href="classirr_1_1video_1_1_s_color.html#a9647d09a9d4b9c6fb48a8fa1f2da425c" title="Returns the alpha component of the color.">getAlpha</a>()*d),
<a name="l00345"></a>00345                 (<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a>)<a class="code" href="namespaceirr_1_1core.html#ae46f57f03e9033c57c180fbe83b04cf2">core::round32</a>(other.<a class="code" href="classirr_1_1video_1_1_s_color.html#af10d2deaccbde5c958032ed9ec81b59f" title="Returns the red component of the color.">getRed</a>()*inv + <a class="code" href="classirr_1_1video_1_1_s_color.html#af10d2deaccbde5c958032ed9ec81b59f" title="Returns the red component of the color.">getRed</a>()*d),
<a name="l00346"></a>00346                 (<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a>)<a class="code" href="namespaceirr_1_1core.html#ae46f57f03e9033c57c180fbe83b04cf2">core::round32</a>(other.<a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d" title="Returns the green component of the color.">getGreen</a>()*inv + <a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d" title="Returns the green component of the color.">getGreen</a>()*d),
<a name="l00347"></a>00347                 (<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a>)<a class="code" href="namespaceirr_1_1core.html#ae46f57f03e9033c57c180fbe83b04cf2">core::round32</a>(other.<a class="code" href="classirr_1_1video_1_1_s_color.html#a26fdbde73081b35a1686f8d21a549544" title="Returns the blue component of the color.">getBlue</a>()*inv + <a class="code" href="classirr_1_1video_1_1_s_color.html#a26fdbde73081b35a1686f8d21a549544" title="Returns the blue component of the color.">getBlue</a>()*d));
<a name="l00348"></a>00348         }
<a name="l00349"></a>00349 
<a name="l00351"></a>00351 
<a name="l00354"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a9e3832dd71062d1d200f11b91cd3a104">00354</a>         <a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">SColor</a> <a class="code" href="classirr_1_1video_1_1_s_color.html#a9e3832dd71062d1d200f11b91cd3a104" title="Returns interpolated color. ( quadratic )">getInterpolated_quadratic</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">SColor</a>&amp; c1, <span class="keyword">const</span> <a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">SColor</a>&amp; c2, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> d)<span class="keyword"> const</span>
<a name="l00355"></a>00355 <span class="keyword">        </span>{
<a name="l00356"></a>00356             <span class="comment">// this*(1-d)*(1-d) + 2 * c1 * (1-d) + c2 * d * d;</span>
<a name="l00357"></a>00357             d = <a class="code" href="namespaceirr_1_1core.html#a6162f685b68f629e77336081d3316969" title="clamps a value between low and high">core::clamp</a>(d, 0.f, 1.f);
<a name="l00358"></a>00358             <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> inv = 1.f - d;
<a name="l00359"></a>00359             <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> mul0 = inv * inv;
<a name="l00360"></a>00360             <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> mul1 = 2.f * d * inv;
<a name="l00361"></a>00361             <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> mul2 = d * d;
<a name="l00362"></a>00362 
<a name="l00363"></a>00363             <span class="keywordflow">return</span> <a class="code" href="classirr_1_1video_1_1_s_color.html#ab001c0c2515ff5f8a0b324d1345485f4" title="Constructor of the Color. Does nothing.">SColor</a>(
<a name="l00364"></a>00364                     <a class="code" href="namespaceirr_1_1core.html#a6162f685b68f629e77336081d3316969" title="clamps a value between low and high">core::clamp</a>( <a class="code" href="namespaceirr_1_1core.html#ac230a392b15e3d27c6e2a07a6925a8c4">core::floor32</a>(
<a name="l00365"></a>00365                             <a class="code" href="classirr_1_1video_1_1_s_color.html#a9647d09a9d4b9c6fb48a8fa1f2da425c" title="Returns the alpha component of the color.">getAlpha</a>() * mul0 + c1.<a class="code" href="classirr_1_1video_1_1_s_color.html#a9647d09a9d4b9c6fb48a8fa1f2da425c" title="Returns the alpha component of the color.">getAlpha</a>() * mul1 + c2.<a class="code" href="classirr_1_1video_1_1_s_color.html#a9647d09a9d4b9c6fb48a8fa1f2da425c" title="Returns the alpha component of the color.">getAlpha</a>() * mul2 ), 0, 255 ),
<a name="l00366"></a>00366                     <a class="code" href="namespaceirr_1_1core.html#a6162f685b68f629e77336081d3316969" title="clamps a value between low and high">core::clamp</a>( <a class="code" href="namespaceirr_1_1core.html#ac230a392b15e3d27c6e2a07a6925a8c4">core::floor32</a>(
<a name="l00367"></a>00367                             <a class="code" href="classirr_1_1video_1_1_s_color.html#af10d2deaccbde5c958032ed9ec81b59f" title="Returns the red component of the color.">getRed</a>()   * mul0 + c1.<a class="code" href="classirr_1_1video_1_1_s_color.html#af10d2deaccbde5c958032ed9ec81b59f" title="Returns the red component of the color.">getRed</a>()   * mul1 + c2.<a class="code" href="classirr_1_1video_1_1_s_color.html#af10d2deaccbde5c958032ed9ec81b59f" title="Returns the red component of the color.">getRed</a>()   * mul2 ), 0, 255 ),
<a name="l00368"></a>00368                     <a class="code" href="namespaceirr_1_1core.html#a6162f685b68f629e77336081d3316969" title="clamps a value between low and high">core::clamp</a> ( <a class="code" href="namespaceirr_1_1core.html#ac230a392b15e3d27c6e2a07a6925a8c4">core::floor32</a>(
<a name="l00369"></a>00369                             <a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d" title="Returns the green component of the color.">getGreen</a>() * mul0 + c1.<a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d" title="Returns the green component of the color.">getGreen</a>() * mul1 + c2.<a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d" title="Returns the green component of the color.">getGreen</a>() * mul2 ), 0, 255 ),
<a name="l00370"></a>00370                     <a class="code" href="namespaceirr_1_1core.html#a6162f685b68f629e77336081d3316969" title="clamps a value between low and high">core::clamp</a> ( <a class="code" href="namespaceirr_1_1core.html#ac230a392b15e3d27c6e2a07a6925a8c4">core::floor32</a>(
<a name="l00371"></a>00371                             <a class="code" href="classirr_1_1video_1_1_s_color.html#a26fdbde73081b35a1686f8d21a549544" title="Returns the blue component of the color.">getBlue</a>()  * mul0 + c1.<a class="code" href="classirr_1_1video_1_1_s_color.html#a26fdbde73081b35a1686f8d21a549544" title="Returns the blue component of the color.">getBlue</a>()  * mul1 + c2.<a class="code" href="classirr_1_1video_1_1_s_color.html#a26fdbde73081b35a1686f8d21a549544" title="Returns the blue component of the color.">getBlue</a>()  * mul2 ), 0, 255 ));
<a name="l00372"></a>00372         }
<a name="l00373"></a>00373 
<a name="l00375"></a>00375 
<a name="l00378"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a381f2db0ed17c6b06ba5c8809dce3370">00378</a>         <span class="keywordtype">void</span> <a class="code" href="classirr_1_1video_1_1_s_color.html#a381f2db0ed17c6b06ba5c8809dce3370" title="set the color by expecting data in the given format">setData</a>(<span class="keyword">const</span> <span class="keywordtype">void</span> *data, <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829ed" title="An enum for the color format of textures used by the Irrlicht Engine.">ECOLOR_FORMAT</a> format)
<a name="l00379"></a>00379         {
<a name="l00380"></a>00380             <span class="keywordflow">switch</span> (format)
<a name="l00381"></a>00381             {
<a name="l00382"></a>00382                 <span class="keywordflow">case</span> <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda1207765b5eab1701111b5dc37b68b4bf" title="16 bit color format used by the software driver.">ECF_A1R5G5B5</a>:
<a name="l00383"></a>00383                     <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> = <a class="code" href="namespaceirr_1_1video.html#a8aa9e69faa25064379df5a91273b9fbe" title="Convert A8R8G8B8 Color from A1R5G5B5 color.">A1R5G5B5toA8R8G8B8</a>(*(<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a>*)data);
<a name="l00384"></a>00384                     <span class="keywordflow">break</span>;
<a name="l00385"></a>00385                 <span class="keywordflow">case</span> <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda49b4fe9d0ba395456dcd7c76a1ae9775" title="Standard 16 bit color format.">ECF_R5G6B5</a>:
<a name="l00386"></a>00386                     <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> = <a class="code" href="namespaceirr_1_1video.html#a421971627afe81533a3c2b51907b72bd" title="Returns A8R8G8B8 Color from R5G6B5 color.">R5G6B5toA8R8G8B8</a>(*(<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a>*)data);
<a name="l00387"></a>00387                     <span class="keywordflow">break</span>;
<a name="l00388"></a>00388                 <span class="keywordflow">case</span> <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda55c57d63efff39efe33ee733fe962df0" title="Default 32 bit color format. 8 bits are used for every component: red, green, blue and alpha...">ECF_A8R8G8B8</a>:
<a name="l00389"></a>00389                     <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> = *(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a>*)data;
<a name="l00390"></a>00390                     <span class="keywordflow">break</span>;
<a name="l00391"></a>00391                 <span class="keywordflow">case</span> <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda3f0380aafb1e1fd59f5419a95d630a6d" title="24 bit color, no alpha channel, but 8 bit for red, green and blue.">ECF_R8G8B8</a>:
<a name="l00392"></a>00392                     {
<a name="l00393"></a>00393                         <a class="code" href="namespaceirr.html#a646874f69af8ff87fc10201b0254a761" title="8 bit unsigned variable.">u8</a>* p = (<a class="code" href="namespaceirr.html#a646874f69af8ff87fc10201b0254a761" title="8 bit unsigned variable.">u8</a>*)data;
<a name="l00394"></a>00394                         <span class="keyword">set</span>(255, p[0],p[1],p[2]);
<a name="l00395"></a>00395                     }
<a name="l00396"></a>00396                     <span class="keywordflow">break</span>;
<a name="l00397"></a>00397                 <span class="keywordflow">default</span>:
<a name="l00398"></a>00398                     <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> = 0xffffffff;
<a name="l00399"></a>00399                 <span class="keywordflow">break</span>;
<a name="l00400"></a>00400             }
<a name="l00401"></a>00401         }
<a name="l00402"></a>00402 
<a name="l00404"></a>00404 
<a name="l00407"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a7cba1b914230289de9c91ff28be96bc9">00407</a>         <span class="keywordtype">void</span> <a class="code" href="classirr_1_1video_1_1_s_color.html#a7cba1b914230289de9c91ff28be96bc9" title="Write the color to data in the defined format.">getData</a>(<span class="keywordtype">void</span> *data, <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829ed" title="An enum for the color format of textures used by the Irrlicht Engine.">ECOLOR_FORMAT</a> format)
<a name="l00408"></a>00408         {
<a name="l00409"></a>00409             <span class="keywordflow">switch</span>(format)
<a name="l00410"></a>00410             {
<a name="l00411"></a>00411                 <span class="keywordflow">case</span> <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda1207765b5eab1701111b5dc37b68b4bf" title="16 bit color format used by the software driver.">ECF_A1R5G5B5</a>:
<a name="l00412"></a>00412                 {
<a name="l00413"></a>00413                     <a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> * dest = (<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a>*)data;
<a name="l00414"></a>00414                     *dest = <a class="code" href="namespaceirr_1_1video.html#a929c6758a0edc772cf69b2c674e4f5cd" title="Converts a 32bit (A8R8G8B8) color to a 16bit A1R5G5B5 color.">video::A8R8G8B8toA1R5G5B5</a>( <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> );
<a name="l00415"></a>00415                 } 
<a name="l00416"></a>00416                 <span class="keywordflow">break</span>;
<a name="l00417"></a>00417 
<a name="l00418"></a>00418                 <span class="keywordflow">case</span> <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda49b4fe9d0ba395456dcd7c76a1ae9775" title="Standard 16 bit color format.">ECF_R5G6B5</a>:
<a name="l00419"></a>00419                 {
<a name="l00420"></a>00420                     <a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> * dest = (<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a>*)data;
<a name="l00421"></a>00421                     *dest = <a class="code" href="namespaceirr_1_1video.html#a10636302b225d7f525fa46bbd3f747a4" title="Converts a 32bit (A8R8G8B8) color to a 16bit R5G6B5 color.">video::A8R8G8B8toR5G6B5</a>( <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> );
<a name="l00422"></a>00422                 } 
<a name="l00423"></a>00423                 <span class="keywordflow">break</span>;
<a name="l00424"></a>00424 
<a name="l00425"></a>00425                 <span class="keywordflow">case</span> <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda3f0380aafb1e1fd59f5419a95d630a6d" title="24 bit color, no alpha channel, but 8 bit for red, green and blue.">ECF_R8G8B8</a>:
<a name="l00426"></a>00426                 {
<a name="l00427"></a>00427                     <a class="code" href="namespaceirr.html#a646874f69af8ff87fc10201b0254a761" title="8 bit unsigned variable.">u8</a>* dest = (<a class="code" href="namespaceirr.html#a646874f69af8ff87fc10201b0254a761" title="8 bit unsigned variable.">u8</a>*)data;
<a name="l00428"></a>00428                     dest[0] = (<a class="code" href="namespaceirr.html#a646874f69af8ff87fc10201b0254a761" title="8 bit unsigned variable.">u8</a>)<a class="code" href="classirr_1_1video_1_1_s_color.html#af10d2deaccbde5c958032ed9ec81b59f" title="Returns the red component of the color.">getRed</a>();
<a name="l00429"></a>00429                     dest[1] = (<a class="code" href="namespaceirr.html#a646874f69af8ff87fc10201b0254a761" title="8 bit unsigned variable.">u8</a>)<a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d" title="Returns the green component of the color.">getGreen</a>();
<a name="l00430"></a>00430                     dest[2] = (<a class="code" href="namespaceirr.html#a646874f69af8ff87fc10201b0254a761" title="8 bit unsigned variable.">u8</a>)<a class="code" href="classirr_1_1video_1_1_s_color.html#a26fdbde73081b35a1686f8d21a549544" title="Returns the blue component of the color.">getBlue</a>();
<a name="l00431"></a>00431                 } 
<a name="l00432"></a>00432                 <span class="keywordflow">break</span>;
<a name="l00433"></a>00433 
<a name="l00434"></a>00434                 <span class="keywordflow">case</span> <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda55c57d63efff39efe33ee733fe962df0" title="Default 32 bit color format. 8 bits are used for every component: red, green, blue and alpha...">ECF_A8R8G8B8</a>:
<a name="l00435"></a>00435                 {
<a name="l00436"></a>00436                     <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> * dest = (<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a>*)data;
<a name="l00437"></a>00437                     *dest = <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a>;
<a name="l00438"></a>00438                 } 
<a name="l00439"></a>00439                 <span class="keywordflow">break</span>;
<a name="l00440"></a>00440 
<a name="l00441"></a>00441                 <span class="keywordflow">default</span>:
<a name="l00442"></a>00442                 <span class="keywordflow">break</span>;
<a name="l00443"></a>00443             }
<a name="l00444"></a>00444         }
<a name="l00445"></a>00445 
<a name="l00447"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf">00447</a>         <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a>;
<a name="l00448"></a>00448     };
<a name="l00449"></a>00449 
<a name="l00450"></a>00450 
<a name="l00452"></a>00452 
<a name="l00458"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html">00458</a>     <span class="keyword">class </span><a class="code" href="classirr_1_1video_1_1_s_colorf.html" title="Class representing a color with four floats.">SColorf</a>
<a name="l00459"></a>00459     {
<a name="l00460"></a>00460     <span class="keyword">public</span>:
<a name="l00462"></a>00462 
<a name="l00463"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#a701ea1b449c2aae4a3dd44a13055ac3e">00463</a>         <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a701ea1b449c2aae4a3dd44a13055ac3e" title="Default constructor for SColorf.">SColorf</a>() : <a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaabdd1e2ef53f24e9dec70d5d531e425" title="red color component">r</a>(0.0f), <a class="code" href="classirr_1_1video_1_1_s_colorf.html#abcb076ccba5f994d6dca52aed397d59a" title="green color component">g</a>(0.0f), <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a82d235f32be8c4a5a07acb45abde726e" title="blue component">b</a>(0.0f), <a class="code" href="classirr_1_1video_1_1_s_colorf.html#add63387fd1fd80d09500b85ae679b050" title="alpha color component">a</a>(1.0f) {}
<a name="l00464"></a>00464 
<a name="l00466"></a>00466 
<a name="l00476"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#adaf8df839d5174aedba17e61ba28fc64">00476</a>         <a class="code" href="classirr_1_1video_1_1_s_colorf.html#adaf8df839d5174aedba17e61ba28fc64" title="Constructs a color from up to four color values: red, green, blue, and alpha.">SColorf</a>(<a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaabdd1e2ef53f24e9dec70d5d531e425" title="red color component">r</a>, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#abcb076ccba5f994d6dca52aed397d59a" title="green color component">g</a>, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a82d235f32be8c4a5a07acb45abde726e" title="blue component">b</a>, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#add63387fd1fd80d09500b85ae679b050" title="alpha color component">a</a> = 1.0f) : r(r), g(g), b(b), <a class="code" href="classirr_1_1video_1_1_s_colorf.html#add63387fd1fd80d09500b85ae679b050" title="alpha color component">a</a>(<a class="code" href="classirr_1_1video_1_1_s_colorf.html#add63387fd1fd80d09500b85ae679b050" title="alpha color component">a</a>) {}
<a name="l00477"></a>00477 
<a name="l00479"></a>00479 
<a name="l00481"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#a78bdda49d8605203acc99854cc9722b7">00481</a>         <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a701ea1b449c2aae4a3dd44a13055ac3e" title="Default constructor for SColorf.">SColorf</a>(<a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">SColor</a> c)
<a name="l00482"></a>00482         {
<a name="l00483"></a>00483             <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> inv = 1.0f / 255.0f;
<a name="l00484"></a>00484             <a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaabdd1e2ef53f24e9dec70d5d531e425" title="red color component">r</a> = c.<a class="code" href="classirr_1_1video_1_1_s_color.html#af10d2deaccbde5c958032ed9ec81b59f" title="Returns the red component of the color.">getRed</a>() * inv;
<a name="l00485"></a>00485             <a class="code" href="classirr_1_1video_1_1_s_colorf.html#abcb076ccba5f994d6dca52aed397d59a" title="green color component">g</a> = c.<a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d" title="Returns the green component of the color.">getGreen</a>() * inv;
<a name="l00486"></a>00486             <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a82d235f32be8c4a5a07acb45abde726e" title="blue component">b</a> = c.<a class="code" href="classirr_1_1video_1_1_s_color.html#a26fdbde73081b35a1686f8d21a549544" title="Returns the blue component of the color.">getBlue</a>() * inv;
<a name="l00487"></a>00487             <a class="code" href="classirr_1_1video_1_1_s_colorf.html#add63387fd1fd80d09500b85ae679b050" title="alpha color component">a</a> = c.<a class="code" href="classirr_1_1video_1_1_s_color.html#a9647d09a9d4b9c6fb48a8fa1f2da425c" title="Returns the alpha component of the color.">getAlpha</a>() * inv;
<a name="l00488"></a>00488         }
<a name="l00489"></a>00489 
<a name="l00491"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#a72ce02a50bf17d5a0017caa4cdddd4a1">00491</a>         <a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">SColor</a> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a72ce02a50bf17d5a0017caa4cdddd4a1" title="Converts this color to a SColor without floats.">toSColor</a>()<span class="keyword"> const</span>
<a name="l00492"></a>00492 <span class="keyword">        </span>{
<a name="l00493"></a>00493             <span class="keywordflow">return</span> <a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">SColor</a>((<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a>)<a class="code" href="namespaceirr_1_1core.html#ae46f57f03e9033c57c180fbe83b04cf2">core::round32</a>(<a class="code" href="classirr_1_1video_1_1_s_colorf.html#add63387fd1fd80d09500b85ae679b050" title="alpha color component">a</a>*255.0f), (<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a>)<a class="code" href="namespaceirr_1_1core.html#ae46f57f03e9033c57c180fbe83b04cf2">core::round32</a>(<a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaabdd1e2ef53f24e9dec70d5d531e425" title="red color component">r</a>*255.0f), (<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a>)<a class="code" href="namespaceirr_1_1core.html#ae46f57f03e9033c57c180fbe83b04cf2">core::round32</a>(<a class="code" href="classirr_1_1video_1_1_s_colorf.html#abcb076ccba5f994d6dca52aed397d59a" title="green color component">g</a>*255.0f), (<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a>)<a class="code" href="namespaceirr_1_1core.html#ae46f57f03e9033c57c180fbe83b04cf2">core::round32</a>(<a class="code" href="classirr_1_1video_1_1_s_colorf.html#a82d235f32be8c4a5a07acb45abde726e" title="blue component">b</a>*255.0f));
<a name="l00494"></a>00494         }
<a name="l00495"></a>00495 
<a name="l00497"></a>00497 
<a name="l00503"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#a99fe5c7d261d288d9afe301d4b90d41c">00503</a>         <span class="keywordtype">void</span> <span class="keyword">set</span>(<a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> rr, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> gg, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> bb) {<a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaabdd1e2ef53f24e9dec70d5d531e425" title="red color component">r</a> = rr; <a class="code" href="classirr_1_1video_1_1_s_colorf.html#abcb076ccba5f994d6dca52aed397d59a" title="green color component">g</a> =gg; <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a82d235f32be8c4a5a07acb45abde726e" title="blue component">b</a> = bb; }
<a name="l00504"></a>00504 
<a name="l00506"></a>00506 
<a name="l00514"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#ae5a082e95ff2631651356f8a6daa2e73">00514</a>         <span class="keywordtype">void</span> <span class="keyword">set</span>(<a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> aa, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> rr, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> gg, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> bb) {<a class="code" href="classirr_1_1video_1_1_s_colorf.html#add63387fd1fd80d09500b85ae679b050" title="alpha color component">a</a> = aa; <a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaabdd1e2ef53f24e9dec70d5d531e425" title="red color component">r</a> = rr; <a class="code" href="classirr_1_1video_1_1_s_colorf.html#abcb076ccba5f994d6dca52aed397d59a" title="green color component">g</a> =gg; <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a82d235f32be8c4a5a07acb45abde726e" title="blue component">b</a> = bb; }
<a name="l00515"></a>00515 
<a name="l00517"></a>00517 
<a name="l00520"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#a7167069deeacd120985dedfc578e98f3">00520</a>         <a class="code" href="classirr_1_1video_1_1_s_colorf.html" title="Class representing a color with four floats.">SColorf</a> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a7167069deeacd120985dedfc578e98f3" title="Interpolates the color with a f32 value to another color.">getInterpolated</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1video_1_1_s_colorf.html" title="Class representing a color with four floats.">SColorf</a> &amp;other, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> d)<span class="keyword"> const</span>
<a name="l00521"></a>00521 <span class="keyword">        </span>{
<a name="l00522"></a>00522             d = <a class="code" href="namespaceirr_1_1core.html#a6162f685b68f629e77336081d3316969" title="clamps a value between low and high">core::clamp</a>(d, 0.f, 1.f);
<a name="l00523"></a>00523             <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> inv = 1.0f - d;
<a name="l00524"></a>00524             <span class="keywordflow">return</span> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a701ea1b449c2aae4a3dd44a13055ac3e" title="Default constructor for SColorf.">SColorf</a>(other.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaabdd1e2ef53f24e9dec70d5d531e425" title="red color component">r</a>*inv + <a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaabdd1e2ef53f24e9dec70d5d531e425" title="red color component">r</a>*d,
<a name="l00525"></a>00525                 other.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#abcb076ccba5f994d6dca52aed397d59a" title="green color component">g</a>*inv + <a class="code" href="classirr_1_1video_1_1_s_colorf.html#abcb076ccba5f994d6dca52aed397d59a" title="green color component">g</a>*d, other.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#a82d235f32be8c4a5a07acb45abde726e" title="blue component">b</a>*inv + <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a82d235f32be8c4a5a07acb45abde726e" title="blue component">b</a>*d, other.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#add63387fd1fd80d09500b85ae679b050" title="alpha color component">a</a>*inv + <a class="code" href="classirr_1_1video_1_1_s_colorf.html#add63387fd1fd80d09500b85ae679b050" title="alpha color component">a</a>*d);
<a name="l00526"></a>00526         }
<a name="l00527"></a>00527 
<a name="l00529"></a>00529 
<a name="l00532"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaba8f592ab29c706a57ef4fdeccf362a">00532</a>         <span class="keyword">inline</span> <a class="code" href="classirr_1_1video_1_1_s_colorf.html" title="Class representing a color with four floats.">SColorf</a> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaba8f592ab29c706a57ef4fdeccf362a" title="Returns interpolated color. ( quadratic )">getInterpolated_quadratic</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1video_1_1_s_colorf.html" title="Class representing a color with four floats.">SColorf</a>&amp; c1, <span class="keyword">const</span> <a class="code" href="classirr_1_1video_1_1_s_colorf.html" title="Class representing a color with four floats.">SColorf</a>&amp; c2,
<a name="l00533"></a>00533                 <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> d)<span class="keyword"> const</span>
<a name="l00534"></a>00534 <span class="keyword">        </span>{
<a name="l00535"></a>00535             d = <a class="code" href="namespaceirr_1_1core.html#a6162f685b68f629e77336081d3316969" title="clamps a value between low and high">core::clamp</a>(d, 0.f, 1.f);
<a name="l00536"></a>00536             <span class="comment">// this*(1-d)*(1-d) + 2 * c1 * (1-d) + c2 * d * d;</span>
<a name="l00537"></a>00537             <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> inv = 1.f - d;
<a name="l00538"></a>00538             <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> mul0 = inv * inv;
<a name="l00539"></a>00539             <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> mul1 = 2.f * d * inv;
<a name="l00540"></a>00540             <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> mul2 = d * d;
<a name="l00541"></a>00541 
<a name="l00542"></a>00542             <span class="keywordflow">return</span> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a701ea1b449c2aae4a3dd44a13055ac3e" title="Default constructor for SColorf.">SColorf</a> (<a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaabdd1e2ef53f24e9dec70d5d531e425" title="red color component">r</a> * mul0 + c1.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaabdd1e2ef53f24e9dec70d5d531e425" title="red color component">r</a> * mul1 + c2.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaabdd1e2ef53f24e9dec70d5d531e425" title="red color component">r</a> * mul2,
<a name="l00543"></a>00543                     <a class="code" href="classirr_1_1video_1_1_s_colorf.html#abcb076ccba5f994d6dca52aed397d59a" title="green color component">g</a> * mul0 + c1.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#abcb076ccba5f994d6dca52aed397d59a" title="green color component">g</a> * mul1 + c2.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#abcb076ccba5f994d6dca52aed397d59a" title="green color component">g</a> * mul2,
<a name="l00544"></a>00544                     <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a82d235f32be8c4a5a07acb45abde726e" title="blue component">b</a> * mul0 + c1.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#a82d235f32be8c4a5a07acb45abde726e" title="blue component">b</a> * mul1 + c2.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#a82d235f32be8c4a5a07acb45abde726e" title="blue component">b</a> * mul2,
<a name="l00545"></a>00545                     <a class="code" href="classirr_1_1video_1_1_s_colorf.html#add63387fd1fd80d09500b85ae679b050" title="alpha color component">a</a> * mul0 + c1.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#add63387fd1fd80d09500b85ae679b050" title="alpha color component">a</a> * mul1 + c2.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#add63387fd1fd80d09500b85ae679b050" title="alpha color component">a</a> * mul2);
<a name="l00546"></a>00546         }
<a name="l00547"></a>00547 
<a name="l00548"></a>00548 
<a name="l00550"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#a79c420ed7052d68d3827f455881535af">00550</a>         <span class="keywordtype">void</span> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a79c420ed7052d68d3827f455881535af" title="Sets a color component by index. R=0, G=1, B=2, A=3.">setColorComponentValue</a>(<a class="code" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> index, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> value)
<a name="l00551"></a>00551         {
<a name="l00552"></a>00552             <span class="keywordflow">switch</span>(index)
<a name="l00553"></a>00553             {
<a name="l00554"></a>00554             <span class="keywordflow">case</span> 0: <a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaabdd1e2ef53f24e9dec70d5d531e425" title="red color component">r</a> = value; <span class="keywordflow">break</span>;
<a name="l00555"></a>00555             <span class="keywordflow">case</span> 1: <a class="code" href="classirr_1_1video_1_1_s_colorf.html#abcb076ccba5f994d6dca52aed397d59a" title="green color component">g</a> = value; <span class="keywordflow">break</span>;
<a name="l00556"></a>00556             <span class="keywordflow">case</span> 2: <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a82d235f32be8c4a5a07acb45abde726e" title="blue component">b</a> = value; <span class="keywordflow">break</span>;
<a name="l00557"></a>00557             <span class="keywordflow">case</span> 3: <a class="code" href="classirr_1_1video_1_1_s_colorf.html#add63387fd1fd80d09500b85ae679b050" title="alpha color component">a</a> = value; <span class="keywordflow">break</span>;
<a name="l00558"></a>00558             }
<a name="l00559"></a>00559         }
<a name="l00560"></a>00560 
<a name="l00562"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#a01e38f4fee055d085530baac54dacb67">00562</a>         <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a01e38f4fee055d085530baac54dacb67" title="Returns the alpha component of the color in the range 0.0 (transparent) to 1.0 (opaque)">getAlpha</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#add63387fd1fd80d09500b85ae679b050" title="alpha color component">a</a>; }
<a name="l00563"></a>00563 
<a name="l00565"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#abf88944ab00a08054cecaefe65e6d485">00565</a>         <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#abf88944ab00a08054cecaefe65e6d485" title="Returns the red component of the color in the range 0.0 to 1.0.">getRed</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaabdd1e2ef53f24e9dec70d5d531e425" title="red color component">r</a>; }
<a name="l00566"></a>00566 
<a name="l00568"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#a9b12565067e4606afe7dcdf3c34c232d">00568</a>         <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a9b12565067e4606afe7dcdf3c34c232d" title="Returns the green component of the color in the range 0.0 to 1.0.">getGreen</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#abcb076ccba5f994d6dca52aed397d59a" title="green color component">g</a>; }
<a name="l00569"></a>00569 
<a name="l00571"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#ad4c669bb1966d58ec9b5eb6b564531c0">00571</a>         <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#ad4c669bb1966d58ec9b5eb6b564531c0" title="Returns the blue component of the color in the range 0.0 to 1.0.">getBlue</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a82d235f32be8c4a5a07acb45abde726e" title="blue component">b</a>; }
<a name="l00572"></a>00572 
<a name="l00574"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaabdd1e2ef53f24e9dec70d5d531e425">00574</a>         <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaabdd1e2ef53f24e9dec70d5d531e425" title="red color component">r</a>;
<a name="l00575"></a>00575 
<a name="l00577"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#abcb076ccba5f994d6dca52aed397d59a">00577</a>         <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#abcb076ccba5f994d6dca52aed397d59a" title="green color component">g</a>;
<a name="l00578"></a>00578 
<a name="l00580"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#a82d235f32be8c4a5a07acb45abde726e">00580</a>         <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a82d235f32be8c4a5a07acb45abde726e" title="blue component">b</a>;
<a name="l00581"></a>00581 
<a name="l00583"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#add63387fd1fd80d09500b85ae679b050">00583</a>         <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#add63387fd1fd80d09500b85ae679b050" title="alpha color component">a</a>;
<a name="l00584"></a>00584     };
<a name="l00585"></a>00585 
<a name="l00586"></a>00586 
<a name="l00588"></a>00588 
<a name="l00592"></a><a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html">00592</a>     <span class="keyword">class </span><a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html" title="Class representing a color in HSL format.">SColorHSL</a>
<a name="l00593"></a>00593     {
<a name="l00594"></a>00594     <span class="keyword">public</span>:
<a name="l00595"></a><a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#ad75a96f226bcbb38a2237fb7be22f537">00595</a>         <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#ad75a96f226bcbb38a2237fb7be22f537">SColorHSL</a> ( <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> h = 0.f, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> s = 0.f, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> l = 0.f )
<a name="l00596"></a>00596             : <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a76d317e46d5a30982ed3da58401d319f">Hue</a> ( h ), <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a61a3b30e3a7724ec9d091001e411987e">Saturation</a> ( s ), <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#acc584a689cf0e4a312c07d58f2a9f2b4">Luminance</a> ( l ) {}
<a name="l00597"></a>00597 
<a name="l00598"></a>00598         <span class="keywordtype">void</span> <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#ac5806ad1f238083ac59d6f3d21673e94">fromRGB</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1video_1_1_s_colorf.html" title="Class representing a color with four floats.">SColorf</a> &amp;color);
<a name="l00599"></a>00599         <span class="keywordtype">void</span> <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#ad0dc9336487c0912d4d72ba3b803f6c6">toRGB</a>(<a class="code" href="classirr_1_1video_1_1_s_colorf.html" title="Class representing a color with four floats.">SColorf</a> &amp;color) <span class="keyword">const</span>;
<a name="l00600"></a>00600 
<a name="l00601"></a><a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a76d317e46d5a30982ed3da58401d319f">00601</a>         <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a76d317e46d5a30982ed3da58401d319f">Hue</a>;
<a name="l00602"></a><a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a61a3b30e3a7724ec9d091001e411987e">00602</a>         <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a61a3b30e3a7724ec9d091001e411987e">Saturation</a>;
<a name="l00603"></a><a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#acc584a689cf0e4a312c07d58f2a9f2b4">00603</a>         <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#acc584a689cf0e4a312c07d58f2a9f2b4">Luminance</a>;
<a name="l00604"></a>00604 
<a name="l00605"></a>00605     <span class="keyword">private</span>:
<a name="l00606"></a>00606         <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> toRGB1(<a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> rm1, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> rm2, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> rh) <span class="keyword">const</span>;
<a name="l00607"></a>00607 
<a name="l00608"></a>00608     };
<a name="l00609"></a>00609 
<a name="l00610"></a><a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#ac5806ad1f238083ac59d6f3d21673e94">00610</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#ac5806ad1f238083ac59d6f3d21673e94">SColorHSL::fromRGB</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1video_1_1_s_colorf.html" title="Class representing a color with four floats.">SColorf</a> &amp;color)
<a name="l00611"></a>00611     {
<a name="l00612"></a>00612         <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> maxVal = <a class="code" href="namespaceirr_1_1core.html#afca1ce7ac54e0c31a9047947f4c7319b" title="returns maximum of two values. Own implementation to get rid of the STL (VS6 problems)">core::max_</a>(color.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#abf88944ab00a08054cecaefe65e6d485" title="Returns the red component of the color in the range 0.0 to 1.0.">getRed</a>(), color.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#a9b12565067e4606afe7dcdf3c34c232d" title="Returns the green component of the color in the range 0.0 to 1.0.">getGreen</a>(), color.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#ad4c669bb1966d58ec9b5eb6b564531c0" title="Returns the blue component of the color in the range 0.0 to 1.0.">getBlue</a>());
<a name="l00613"></a>00613         <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> minVal = (<a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a>)<a class="code" href="namespaceirr_1_1core.html#a9d34bfdbbe9c136b01ae04974572bc11" title="returns minimum of two values. Own implementation to get rid of the STL (VS6 problems)">core::min_</a>(color.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#abf88944ab00a08054cecaefe65e6d485" title="Returns the red component of the color in the range 0.0 to 1.0.">getRed</a>(), color.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#a9b12565067e4606afe7dcdf3c34c232d" title="Returns the green component of the color in the range 0.0 to 1.0.">getGreen</a>(), color.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#ad4c669bb1966d58ec9b5eb6b564531c0" title="Returns the blue component of the color in the range 0.0 to 1.0.">getBlue</a>());
<a name="l00614"></a>00614         <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#acc584a689cf0e4a312c07d58f2a9f2b4">Luminance</a> = (maxVal+minVal)*50;
<a name="l00615"></a>00615         <span class="keywordflow">if</span> (<a class="code" href="namespaceirr_1_1core.html#abf9b9b140cc365908ea4c8c47451e4e3" title="returns if a equals b, taking possible rounding errors into account">core::equals</a>(maxVal, minVal))
<a name="l00616"></a>00616         {
<a name="l00617"></a>00617             <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a76d317e46d5a30982ed3da58401d319f">Hue</a>=0.f;
<a name="l00618"></a>00618             <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a61a3b30e3a7724ec9d091001e411987e">Saturation</a>=0.f;
<a name="l00619"></a>00619             <span class="keywordflow">return</span>;
<a name="l00620"></a>00620         }
<a name="l00621"></a>00621 
<a name="l00622"></a>00622         <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> delta = maxVal-minVal;
<a name="l00623"></a>00623         <span class="keywordflow">if</span> ( <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#acc584a689cf0e4a312c07d58f2a9f2b4">Luminance</a> &lt;= 50 )
<a name="l00624"></a>00624         {
<a name="l00625"></a>00625             <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a61a3b30e3a7724ec9d091001e411987e">Saturation</a> = (delta)/(maxVal+minVal);
<a name="l00626"></a>00626         }
<a name="l00627"></a>00627         <span class="keywordflow">else</span>
<a name="l00628"></a>00628         {
<a name="l00629"></a>00629             <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a61a3b30e3a7724ec9d091001e411987e">Saturation</a> = (delta)/(2-maxVal-minVal);
<a name="l00630"></a>00630         }
<a name="l00631"></a>00631         <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a61a3b30e3a7724ec9d091001e411987e">Saturation</a> *= 100;
<a name="l00632"></a>00632 
<a name="l00633"></a>00633         <span class="keywordflow">if</span> (<a class="code" href="namespaceirr_1_1core.html#abf9b9b140cc365908ea4c8c47451e4e3" title="returns if a equals b, taking possible rounding errors into account">core::equals</a>(maxVal, color.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#abf88944ab00a08054cecaefe65e6d485" title="Returns the red component of the color in the range 0.0 to 1.0.">getRed</a>()))
<a name="l00634"></a>00634             <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a76d317e46d5a30982ed3da58401d319f">Hue</a> = (color.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#a9b12565067e4606afe7dcdf3c34c232d" title="Returns the green component of the color in the range 0.0 to 1.0.">getGreen</a>()-color.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#ad4c669bb1966d58ec9b5eb6b564531c0" title="Returns the blue component of the color in the range 0.0 to 1.0.">getBlue</a>())/delta;
<a name="l00635"></a>00635         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="namespaceirr_1_1core.html#abf9b9b140cc365908ea4c8c47451e4e3" title="returns if a equals b, taking possible rounding errors into account">core::equals</a>(maxVal, color.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#a9b12565067e4606afe7dcdf3c34c232d" title="Returns the green component of the color in the range 0.0 to 1.0.">getGreen</a>()))
<a name="l00636"></a>00636             <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a76d317e46d5a30982ed3da58401d319f">Hue</a> = 2+((color.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#ad4c669bb1966d58ec9b5eb6b564531c0" title="Returns the blue component of the color in the range 0.0 to 1.0.">getBlue</a>()-color.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#abf88944ab00a08054cecaefe65e6d485" title="Returns the red component of the color in the range 0.0 to 1.0.">getRed</a>())/delta);
<a name="l00637"></a>00637         <span class="keywordflow">else</span> <span class="comment">// blue is max</span>
<a name="l00638"></a>00638             <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a76d317e46d5a30982ed3da58401d319f">Hue</a> = 4+((color.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#abf88944ab00a08054cecaefe65e6d485" title="Returns the red component of the color in the range 0.0 to 1.0.">getRed</a>()-color.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#a9b12565067e4606afe7dcdf3c34c232d" title="Returns the green component of the color in the range 0.0 to 1.0.">getGreen</a>())/delta);
<a name="l00639"></a>00639 
<a name="l00640"></a>00640         <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a76d317e46d5a30982ed3da58401d319f">Hue</a> *= 60.0f;
<a name="l00641"></a>00641         <span class="keywordflow">while</span> ( <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a76d317e46d5a30982ed3da58401d319f">Hue</a> &lt; 0.f )
<a name="l00642"></a>00642             <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a76d317e46d5a30982ed3da58401d319f">Hue</a> += 360;
<a name="l00643"></a>00643     }
<a name="l00644"></a>00644 
<a name="l00645"></a>00645 
<a name="l00646"></a><a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#ad0dc9336487c0912d4d72ba3b803f6c6">00646</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#ad0dc9336487c0912d4d72ba3b803f6c6">SColorHSL::toRGB</a>(<a class="code" href="classirr_1_1video_1_1_s_colorf.html" title="Class representing a color with four floats.">SColorf</a> &amp;color)<span class="keyword"> const</span>
<a name="l00647"></a>00647 <span class="keyword">    </span>{
<a name="l00648"></a>00648         <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> l = <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#acc584a689cf0e4a312c07d58f2a9f2b4">Luminance</a>/100;
<a name="l00649"></a>00649         <span class="keywordflow">if</span> (<a class="code" href="namespaceirr_1_1core.html#afc24e6ba26469ec7ca7001ed272dc3b2" title="returns if a equals zero, taking rounding errors into account">core::iszero</a>(<a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a61a3b30e3a7724ec9d091001e411987e">Saturation</a>)) <span class="comment">// grey</span>
<a name="l00650"></a>00650         {
<a name="l00651"></a>00651             color.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#a99fe5c7d261d288d9afe301d4b90d41c" title="Sets three color components to new values at once.">set</a>(l, l, l);
<a name="l00652"></a>00652             <span class="keywordflow">return</span>;
<a name="l00653"></a>00653         }
<a name="l00654"></a>00654 
<a name="l00655"></a>00655         <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> rm2;
<a name="l00656"></a>00656 
<a name="l00657"></a>00657         <span class="keywordflow">if</span> ( <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#acc584a689cf0e4a312c07d58f2a9f2b4">Luminance</a> &lt;= 50 )
<a name="l00658"></a>00658         {
<a name="l00659"></a>00659             rm2 = l + l * (<a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a61a3b30e3a7724ec9d091001e411987e">Saturation</a>/100);
<a name="l00660"></a>00660         }
<a name="l00661"></a>00661         <span class="keywordflow">else</span>
<a name="l00662"></a>00662         {
<a name="l00663"></a>00663             rm2 = l + (1 - l) * (<a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a61a3b30e3a7724ec9d091001e411987e">Saturation</a>/100);
<a name="l00664"></a>00664         }
<a name="l00665"></a>00665 
<a name="l00666"></a>00666         <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> rm1 = 2.0f * l - rm2;
<a name="l00667"></a>00667 
<a name="l00668"></a>00668         <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> h = <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a76d317e46d5a30982ed3da58401d319f">Hue</a> / 360.0f;
<a name="l00669"></a>00669         color.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#a99fe5c7d261d288d9afe301d4b90d41c" title="Sets three color components to new values at once.">set</a>( toRGB1(rm1, rm2, h + 1.f/3.f),
<a name="l00670"></a>00670             toRGB1(rm1, rm2, h),
<a name="l00671"></a>00671             toRGB1(rm1, rm2, h - 1.f/3.f)
<a name="l00672"></a>00672             );
<a name="l00673"></a>00673     }
<a name="l00674"></a>00674 
<a name="l00675"></a>00675 
<a name="l00676"></a>00676     <span class="comment">// algorithm from Foley/Van-Dam</span>
<a name="l00677"></a>00677     <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> SColorHSL::toRGB1(<a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> rm1, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> rm2, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> rh)<span class="keyword"> const</span>
<a name="l00678"></a>00678 <span class="keyword">    </span>{
<a name="l00679"></a>00679         <span class="keywordflow">if</span> (rh&lt;0)
<a name="l00680"></a>00680             rh += 1;
<a name="l00681"></a>00681         <span class="keywordflow">if</span> (rh&gt;1)
<a name="l00682"></a>00682             rh -= 1;
<a name="l00683"></a>00683 
<a name="l00684"></a>00684         <span class="keywordflow">if</span> (rh &lt; 1.f/6.f)
<a name="l00685"></a>00685             rm1 = rm1 + (rm2 - rm1) * rh*6.f;
<a name="l00686"></a>00686         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (rh &lt; 0.5f)
<a name="l00687"></a>00687             rm1 = rm2;
<a name="l00688"></a>00688         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (rh &lt; 2.f/3.f)
<a name="l00689"></a>00689             rm1 = rm1 + (rm2 - rm1) * ((2.f/3.f)-rh)*6.f;
<a name="l00690"></a>00690 
<a name="l00691"></a>00691         <span class="keywordflow">return</span> rm1;
<a name="l00692"></a>00692     }
<a name="l00693"></a>00693 
<a name="l00694"></a>00694 } <span class="comment">// end namespace video</span>
<a name="l00695"></a>00695 } <span class="comment">// end namespace irr</span>
<a name="l00696"></a>00696 
<a name="l00697"></a>00697 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="_s_color_8h.html">SColor.h</a>      </li>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>


    <li class="footer">
<a href="http://irrlicht.sourceforge.net" target="_blank">Irrlicht 
Engine</a> Documentation &copy; 2003-2012 by Nikolaus Gebhardt. Generated on Sun Nov 17 2013 20:18:40 for Irrlicht 3D Engine by
<a href="http://www.doxygen.org/index.html" target="_blank">Doxygen</a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>