Sophie

Sophie

distrib > Mandriva > 2011.0 > i586 > by-pkgid > a16d689bc65aac5d987d5129109e6de5 > files > 295

irrlicht-doc-1.7.2-1.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Irrlicht Engine: SColor.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<table class="irrlicht" >
  <tr valign="middle"> 
    <td><font size="2"><a class="qindex" href="index.html"><font color="#FFFFFF">Home</font></a> 
      | <a class="qindex" href="namespaces.html"><font color="#FFFFFF">Namespaces</font></a> 
      | <a class="qindex" href="hierarchy.html"><font color="#FFFFFF">Hierarchy</font></a> 
      | <a class="qindex" href="classes.html"><font color="#FFFFFF">Alphabetical 
      List</font></a> | <a class="qindex" href="annotated.html"><font color="#FFFFFF"> 
      Class list</font></a> | <a class="qindex" href="files.html"><font color="#FFFFFF">Files</font></a> 
      | <a class="qindex" href="namespacemembers.html"><font color="#FFFFFF"> 
      Namespace&nbsp;Members</font></a> | <a class="qindex" href="functions.html"><font color="#FFFFFF">Class 
      members</font></a> | <a class="qindex" href="globals.html"><font color="#FFFFFF">File 
      members</font></a> | <a class="qindex" href="pages.html"><font color="#FFFFFF">Tutorials</font></a></font> </td>
  </tr>
</table>
<!-- Generated by Doxygen 1.6.2 -->
<h1>SColor.h</h1><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-2010 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><a class="code" href="namespaceirr_1_1video.html#a65997ac1b7b7544acc0f4757be7860d1">00016</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="l00017"></a>00017         {
<a name="l00018"></a>00018                 <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="l00019"></a>00019                         (r &amp; 0xF8) &lt;&lt; 7 |
<a name="l00020"></a>00020                         (g &amp; 0xF8) &lt;&lt; 2 |
<a name="l00021"></a>00021                         (b &amp; 0xF8) &gt;&gt; 3);
<a name="l00022"></a>00022         }
<a name="l00023"></a>00023 
<a name="l00024"></a>00024 
<a name="l00026"></a><a class="code" href="namespaceirr_1_1video.html#a55f59b4905cab236a03cb420fd55830d">00026</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="l00027"></a>00027         {
<a name="l00028"></a>00028                 <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="l00029"></a>00029         }
<a name="l00030"></a>00030 
<a name="l00031"></a>00031 
<a name="l00033"></a><a class="code" href="namespaceirr_1_1video.html#a1f8b2e9ef461d76c0723536f776c2e36">00033</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="l00034"></a>00034         {
<a name="l00035"></a>00035                 <span class="keywordflow">return</span> (0x8000 |
<a name="l00036"></a>00036                                 (r &amp; 0x1F) &lt;&lt; 10 |
<a name="l00037"></a>00037                                 (g &amp; 0x1F) &lt;&lt; 5  |
<a name="l00038"></a>00038                                 (b &amp; 0x1F));
<a name="l00039"></a>00039         }
<a name="l00040"></a>00040 
<a name="l00041"></a>00041 
<a name="l00043"></a><a class="code" href="namespaceirr_1_1video.html#a6824dfc9c71a7fd9d7a3e704b1267ddc">00043</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="l00044"></a>00044         {
<a name="l00045"></a>00045                 <span class="keywordflow">return</span> (<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a>)(0x8000 |
<a name="l00046"></a>00046                         ( color &amp; 0x00F80000) &gt;&gt; 9 |
<a name="l00047"></a>00047                         ( color &amp; 0x0000F800) &gt;&gt; 6 |
<a name="l00048"></a>00048                         ( color &amp; 0x000000F8) &gt;&gt; 3);
<a name="l00049"></a>00049         }
<a name="l00050"></a>00050 
<a name="l00051"></a>00051 
<a name="l00053"></a><a class="code" href="namespaceirr_1_1video.html#a929c6758a0edc772cf69b2c674e4f5cd">00053</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="l00054"></a>00054         {
<a name="l00055"></a>00055                 <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="l00056"></a>00056                         ( color &amp; 0x00F80000) &gt;&gt; 9 |
<a name="l00057"></a>00057                         ( color &amp; 0x0000F800) &gt;&gt; 6 |
<a name="l00058"></a>00058                         ( color &amp; 0x000000F8) &gt;&gt; 3);
<a name="l00059"></a>00059         }
<a name="l00060"></a>00060 
<a name="l00061"></a>00061 
<a name="l00063"></a><a class="code" href="namespaceirr_1_1video.html#a10636302b225d7f525fa46bbd3f747a4">00063</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="l00064"></a>00064         {
<a name="l00065"></a>00065                 <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="l00066"></a>00066                         ( color &amp; 0x0000FC00) &gt;&gt; 5 |
<a name="l00067"></a>00067                         ( color &amp; 0x000000F8) &gt;&gt; 3);
<a name="l00068"></a>00068         }
<a name="l00069"></a>00069 
<a name="l00070"></a>00070 
<a name="l00072"></a>00072 
<a name="l00073"></a><a class="code" href="namespaceirr_1_1video.html#a8aa9e69faa25064379df5a91273b9fbe">00073</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="l00074"></a>00074         {
<a name="l00075"></a>00075                 <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="l00076"></a>00076                                 (( color &amp; 0x00007C00 ) &lt;&lt; 9) | (( color &amp; 0x00007000 ) &lt;&lt; 4) |
<a name="l00077"></a>00077                                 (( color &amp; 0x000003E0 ) &lt;&lt; 6) | (( color &amp; 0x00000380 ) &lt;&lt; 1) |
<a name="l00078"></a>00078                                 (( color &amp; 0x0000001F ) &lt;&lt; 3) | (( color &amp; 0x0000001C ) &gt;&gt; 2)
<a name="l00079"></a>00079                                 );
<a name="l00080"></a>00080         }
<a name="l00081"></a>00081 
<a name="l00082"></a>00082 
<a name="l00084"></a><a class="code" href="namespaceirr_1_1video.html#a421971627afe81533a3c2b51907b72bd">00084</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="l00085"></a>00085         {
<a name="l00086"></a>00086                 <span class="keywordflow">return</span> 0xFF000000 |
<a name="l00087"></a>00087                         ((color &amp; 0xF800) &lt;&lt; 8)|
<a name="l00088"></a>00088                         ((color &amp; 0x07E0) &lt;&lt; 5)|
<a name="l00089"></a>00089                         ((color &amp; 0x001F) &lt;&lt; 3);
<a name="l00090"></a>00090         }
<a name="l00091"></a>00091 
<a name="l00092"></a>00092 
<a name="l00094"></a><a class="code" href="namespaceirr_1_1video.html#aaeb39c8fc1b9c4e78b68e2da210f70ff">00094</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="l00095"></a>00095         {
<a name="l00096"></a>00096                 <span class="keywordflow">return</span> 0x8000 | (((color &amp; 0xFFC0) &gt;&gt; 1) | (color &amp; 0x1F));
<a name="l00097"></a>00097         }
<a name="l00098"></a>00098 
<a name="l00099"></a>00099 
<a name="l00101"></a><a class="code" href="namespaceirr_1_1video.html#a4906b4425165ee533dab17506fe98ce8">00101</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="l00102"></a>00102         {
<a name="l00103"></a>00103                 <span class="keywordflow">return</span> (((color &amp; 0x7FE0) &lt;&lt; 1) | (color &amp; 0x1F));
<a name="l00104"></a>00104         }
<a name="l00105"></a>00105 
<a name="l00106"></a>00106 
<a name="l00107"></a>00107 
<a name="l00109"></a>00109 
<a name="l00111"></a><a class="code" href="namespaceirr_1_1video.html#a23358b142a005c4a4c747d227a4d77ab">00111</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="l00112"></a>00112         {
<a name="l00113"></a>00113                 <span class="keywordflow">return</span> ((color &gt;&gt; 15)&amp;0x1);
<a name="l00114"></a>00114         }
<a name="l00115"></a>00115 
<a name="l00116"></a>00116 
<a name="l00118"></a>00118 
<a name="l00119"></a><a class="code" href="namespaceirr_1_1video.html#aa98234702c65c82ce29115b12e89dafe">00119</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="l00120"></a>00120         {
<a name="l00121"></a>00121                 <span class="keywordflow">return</span> ((color &gt;&gt; 10)&amp;0x1F);
<a name="l00122"></a>00122         }
<a name="l00123"></a>00123 
<a name="l00124"></a>00124 
<a name="l00126"></a>00126 
<a name="l00127"></a><a class="code" href="namespaceirr_1_1video.html#a3e64185c36326ed33a494ba14cac00a5">00127</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="l00128"></a>00128         {
<a name="l00129"></a>00129                 <span class="keywordflow">return</span> ((color &gt;&gt; 5)&amp;0x1F);
<a name="l00130"></a>00130         }
<a name="l00131"></a>00131 
<a name="l00132"></a>00132 
<a name="l00134"></a>00134 
<a name="l00135"></a><a class="code" href="namespaceirr_1_1video.html#ae8dc9edd5a3eb01de47933ac2d7f679e">00135</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="l00136"></a>00136         {
<a name="l00137"></a>00137                 <span class="keywordflow">return</span> (color &amp; 0x1F);
<a name="l00138"></a>00138         }
<a name="l00139"></a>00139 
<a name="l00140"></a>00140 
<a name="l00142"></a><a class="code" href="namespaceirr_1_1video.html#ab242fde6c6e19ae4100fe39b0dadd9d0">00142</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="l00143"></a>00143         {
<a name="l00144"></a>00144                 <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="l00145"></a>00145         }
<a name="l00146"></a>00146 
<a name="l00147"></a>00147 
<a name="l00149"></a>00149 
<a name="l00157"></a><a class="code" href="classirr_1_1video_1_1_s_color.html">00157</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="l00158"></a>00158         {
<a name="l00159"></a>00159         <span class="keyword">public</span>:
<a name="l00160"></a>00160 
<a name="l00162"></a>00162 
<a name="l00163"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#ab001c0c2515ff5f8a0b324d1345485f4">00163</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="l00164"></a>00164 
<a name="l00166"></a>00166 
<a name="l00167"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#aa2ca1fcb9b11375282bb407b635b3dd6">00167</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="l00168"></a>00168                         : <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="l00169"></a>00169 
<a name="l00171"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a56dd5677c3e36d3b33d5d796be2597da">00171</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="l00172"></a>00172                         : <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a>(clr) {}
<a name="l00173"></a>00173 
<a name="l00175"></a>00175 
<a name="l00177"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a9647d09a9d4b9c6fb48a8fa1f2da425c">00177</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="l00178"></a>00178 
<a name="l00180"></a>00180 
<a name="l00182"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#af10d2deaccbde5c958032ed9ec81b59f">00182</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="l00183"></a>00183 
<a name="l00185"></a>00185 
<a name="l00187"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d">00187</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="l00188"></a>00188 
<a name="l00190"></a>00190 
<a name="l00192"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a26fdbde73081b35a1686f8d21a549544">00192</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="l00193"></a>00193 
<a name="l00195"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#aa96bfc155c181104c61df9d58ad8be0f">00195</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="l00196"></a>00196 <span class="keyword">                </span>{
<a name="l00197"></a>00197                         <span class="keywordflow">return</span> 0.5f*(<a class="code" href="namespaceirr_1_1core.html#afc29e2de032d68f1d26fd81d11073a95" 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#afc29e2de032d68f1d26fd81d11073a95" 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#a307354570474ae7d399cb1c536c3546d" 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#a307354570474ae7d399cb1c536c3546d" 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="l00198"></a>00198                 }
<a name="l00199"></a>00199 
<a name="l00201"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#ad0a78b90a97e8444a1d12e93e7e929ba">00201</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="l00202"></a>00202 <span class="keyword">                </span>{
<a name="l00203"></a>00203                         <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="l00204"></a>00204                 }
<a name="l00205"></a>00205 
<a name="l00207"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a29a672f4bae9805970b84c4aef81b9ab">00207</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="l00208"></a>00208 <span class="keyword">                </span>{
<a name="l00209"></a>00209                         <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="l00210"></a>00210                 }
<a name="l00211"></a>00211 
<a name="l00213"></a>00213 
<a name="l00215"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a7bfe4abc30d563668b947c8bdb055bab">00215</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="l00216"></a>00216 
<a name="l00218"></a>00218 
<a name="l00220"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a950c98714711ae9dd8c5219f83c07693">00220</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="l00221"></a>00221 
<a name="l00223"></a>00223 
<a name="l00225"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#af80cfedd5e761216b8bed259963ac948">00225</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="l00226"></a>00226 
<a name="l00228"></a>00228 
<a name="l00230"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a13d82e6b52d32f7394f3cce041dc2965">00230</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="l00231"></a>00231 
<a name="l00233"></a>00233 
<a name="l00234"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a9a6ad04081a1b15c07746cf84a971565">00234</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="l00235"></a>00235 
<a name="l00237"></a>00237 
<a name="l00240"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a0196acc3dfded9f6161c41f0065267c1">00240</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="l00241"></a>00241 <span class="keyword">                </span>{
<a name="l00242"></a>00242                         *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="l00243"></a>00243                         *++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="l00244"></a>00244                         *++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="l00245"></a>00245                         *++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="l00246"></a>00246                 }
<a name="l00247"></a>00247 
<a name="l00249"></a>00249 
<a name="l00263"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a8cf295c05c7406cc249843acbb31ec5f">00263</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="l00264"></a>00264                 {
<a name="l00265"></a>00265                         <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="l00266"></a>00266                 }
<a name="l00267"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a4966581260a89f10386bf9d06239c341">00267</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="l00268"></a>00268 
<a name="l00270"></a>00270 
<a name="l00271"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a68025038ef1c75c8b7ca64270216f79f">00271</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="l00272"></a>00272 
<a name="l00274"></a>00274 
<a name="l00275"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#abcacfc84b1a87f148570efb176999104">00275</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="l00276"></a>00276 
<a name="l00278"></a>00278 
<a name="l00279"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a8e7944ddc658076a2933861a1b99f1e7">00279</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="l00280"></a>00280 
<a name="l00282"></a>00282 
<a name="l00284"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a1cd25e0e67050af13a15515b7d2c8782">00284</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="l00285"></a>00285 <span class="keyword">                </span>{
<a name="l00286"></a>00286                         <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#a307354570474ae7d399cb1c536c3546d" 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="l00287"></a>00287                                         <a class="code" href="namespaceirr_1_1core.html#a307354570474ae7d399cb1c536c3546d" 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="l00288"></a>00288                                         <a class="code" href="namespaceirr_1_1core.html#a307354570474ae7d399cb1c536c3546d" 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="l00289"></a>00289                                         <a class="code" href="namespaceirr_1_1core.html#a307354570474ae7d399cb1c536c3546d" 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="l00290"></a>00290                 }
<a name="l00291"></a>00291 
<a name="l00293"></a>00293 
<a name="l00296"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a880760bf37e7c2143cc0b1a0e90a85b1">00296</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="l00297"></a>00297 <span class="keyword">                </span>{
<a name="l00298"></a>00298                         d = <a class="code" href="namespaceirr_1_1core.html#a91284ddd030b8651cab294e16aa5f6bc" title="clamps a value between low and high">core::clamp</a>(d, 0.f, 1.f);
<a name="l00299"></a>00299                         <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="l00300"></a>00300                         <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="l00301"></a>00301                                 (<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="l00302"></a>00302                                 (<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="l00303"></a>00303                                 (<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="l00304"></a>00304                 }
<a name="l00305"></a>00305 
<a name="l00307"></a>00307 
<a name="l00310"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a9e3832dd71062d1d200f11b91cd3a104">00310</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="l00311"></a>00311 <span class="keyword">                </span>{
<a name="l00312"></a>00312                         <span class="comment">// this*(1-d)*(1-d) + 2 * c1 * (1-d) + c2 * d * d;</span>
<a name="l00313"></a>00313                         d = <a class="code" href="namespaceirr_1_1core.html#a91284ddd030b8651cab294e16aa5f6bc" title="clamps a value between low and high">core::clamp</a>(d, 0.f, 1.f);
<a name="l00314"></a>00314                         <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="l00315"></a>00315                         <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="l00316"></a>00316                         <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="l00317"></a>00317                         <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="l00318"></a>00318 
<a name="l00319"></a>00319                         <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="l00320"></a>00320                                         <a class="code" href="namespaceirr_1_1core.html#a91284ddd030b8651cab294e16aa5f6bc" 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="l00321"></a>00321                                                         <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="l00322"></a>00322                                         <a class="code" href="namespaceirr_1_1core.html#a91284ddd030b8651cab294e16aa5f6bc" 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="l00323"></a>00323                                                         <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="l00324"></a>00324                                         <a class="code" href="namespaceirr_1_1core.html#a91284ddd030b8651cab294e16aa5f6bc" 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="l00325"></a>00325                                                         <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="l00326"></a>00326                                         <a class="code" href="namespaceirr_1_1core.html#a91284ddd030b8651cab294e16aa5f6bc" 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="l00327"></a>00327                                                         <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="l00328"></a>00328                 }
<a name="l00329"></a>00329 
<a name="l00331"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf">00331</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="l00332"></a>00332         };
<a name="l00333"></a>00333 
<a name="l00334"></a>00334 
<a name="l00336"></a>00336 
<a name="l00342"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html">00342</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="l00343"></a>00343         {
<a name="l00344"></a>00344         <span class="keyword">public</span>:
<a name="l00346"></a>00346 
<a name="l00347"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#a701ea1b449c2aae4a3dd44a13055ac3e">00347</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="l00348"></a>00348 
<a name="l00350"></a>00350 
<a name="l00360"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#adaf8df839d5174aedba17e61ba28fc64">00360</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="l00361"></a>00361 
<a name="l00363"></a>00363 
<a name="l00365"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#a78bdda49d8605203acc99854cc9722b7">00365</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="l00366"></a>00366                 {
<a name="l00367"></a>00367                         <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="l00368"></a>00368                         <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="l00369"></a>00369                         <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="l00370"></a>00370                         <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="l00371"></a>00371                         <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="l00372"></a>00372                 }
<a name="l00373"></a>00373 
<a name="l00375"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#a72ce02a50bf17d5a0017caa4cdddd4a1">00375</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="l00376"></a>00376 <span class="keyword">                </span>{
<a name="l00377"></a>00377                         <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="l00378"></a>00378                 }
<a name="l00379"></a>00379 
<a name="l00381"></a>00381 
<a name="l00387"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#a99fe5c7d261d288d9afe301d4b90d41c">00387</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="l00388"></a>00388 
<a name="l00390"></a>00390 
<a name="l00398"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#ae5a082e95ff2631651356f8a6daa2e73">00398</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="l00399"></a>00399 
<a name="l00401"></a>00401 
<a name="l00404"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#a7167069deeacd120985dedfc578e98f3">00404</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="l00405"></a>00405 <span class="keyword">                </span>{
<a name="l00406"></a>00406                         d = <a class="code" href="namespaceirr_1_1core.html#a91284ddd030b8651cab294e16aa5f6bc" title="clamps a value between low and high">core::clamp</a>(d, 0.f, 1.f);
<a name="l00407"></a>00407                         <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="l00408"></a>00408                         <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="l00409"></a>00409                                 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="l00410"></a>00410                 }
<a name="l00411"></a>00411 
<a name="l00413"></a>00413 
<a name="l00416"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaba8f592ab29c706a57ef4fdeccf362a">00416</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="l00417"></a>00417                                 <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> d)<span class="keyword"> const</span>
<a name="l00418"></a>00418 <span class="keyword">                </span>{
<a name="l00419"></a>00419                         d = <a class="code" href="namespaceirr_1_1core.html#a91284ddd030b8651cab294e16aa5f6bc" title="clamps a value between low and high">core::clamp</a>(d, 0.f, 1.f);
<a name="l00420"></a>00420                         <span class="comment">// this*(1-d)*(1-d) + 2 * c1 * (1-d) + c2 * d * d;</span>
<a name="l00421"></a>00421                         <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="l00422"></a>00422                         <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="l00423"></a>00423                         <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="l00424"></a>00424                         <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="l00425"></a>00425 
<a name="l00426"></a>00426                         <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="l00427"></a>00427                                         <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="l00428"></a>00428                                         <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#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="l00429"></a>00429                                         <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="l00430"></a>00430                 }
<a name="l00431"></a>00431 
<a name="l00432"></a>00432 
<a name="l00434"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#a79c420ed7052d68d3827f455881535af">00434</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="l00435"></a>00435                 {
<a name="l00436"></a>00436                         <span class="keywordflow">switch</span>(index)
<a name="l00437"></a>00437                         {
<a name="l00438"></a>00438                         <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="l00439"></a>00439                         <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="l00440"></a>00440                         <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="l00441"></a>00441                         <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="l00442"></a>00442                         }
<a name="l00443"></a>00443                 }
<a name="l00444"></a>00444 
<a name="l00446"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#a01e38f4fee055d085530baac54dacb67">00446</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="l00447"></a>00447 
<a name="l00449"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#abf88944ab00a08054cecaefe65e6d485">00449</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="l00450"></a>00450 
<a name="l00452"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#a9b12565067e4606afe7dcdf3c34c232d">00452</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="l00453"></a>00453 
<a name="l00455"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#ad4c669bb1966d58ec9b5eb6b564531c0">00455</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="l00456"></a>00456 
<a name="l00458"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaabdd1e2ef53f24e9dec70d5d531e425">00458</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="l00459"></a>00459 
<a name="l00461"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#abcb076ccba5f994d6dca52aed397d59a">00461</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="l00462"></a>00462 
<a name="l00464"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#a82d235f32be8c4a5a07acb45abde726e">00464</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="l00465"></a>00465 
<a name="l00467"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#add63387fd1fd80d09500b85ae679b050">00467</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="l00468"></a>00468         };
<a name="l00469"></a>00469 
<a name="l00470"></a>00470 
<a name="l00472"></a>00472 
<a name="l00475"></a><a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html">00475</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 HSV format.">SColorHSL</a>
<a name="l00476"></a>00476         {
<a name="l00477"></a>00477         <span class="keyword">public</span>:
<a name="l00478"></a><a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#ad75a96f226bcbb38a2237fb7be22f537">00478</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="l00479"></a>00479                         : <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="l00480"></a>00480 
<a name="l00481"></a>00481                 <span class="keywordtype">void</span> <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#abf2c1297b5282b8991e4f02960609a7a">fromRGB</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;color);
<a name="l00482"></a>00482                 <span class="keywordtype">void</span> <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#ad4c53aa1be2594250927dd68d29be163">toRGB</a>(<a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">SColor</a> &amp;color) <span class="keyword">const</span>;
<a name="l00483"></a>00483 
<a name="l00484"></a><a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a76d317e46d5a30982ed3da58401d319f">00484</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="l00485"></a><a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a61a3b30e3a7724ec9d091001e411987e">00485</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="l00486"></a><a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#acc584a689cf0e4a312c07d58f2a9f2b4">00486</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="l00487"></a>00487 
<a name="l00488"></a>00488         <span class="keyword">private</span>:
<a name="l00489"></a>00489                 <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</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="l00490"></a>00490 
<a name="l00491"></a>00491         };
<a name="l00492"></a>00492 
<a name="l00493"></a><a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#abf2c1297b5282b8991e4f02960609a7a">00493</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#abf2c1297b5282b8991e4f02960609a7a">SColorHSL::fromRGB</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;color)
<a name="l00494"></a>00494         {
<a name="l00495"></a>00495                 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> maxValInt = <a class="code" href="namespaceirr_1_1core.html#afc29e2de032d68f1d26fd81d11073a95" 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_color.html#af10d2deaccbde5c958032ed9ec81b59f" title="Returns the red component of the color.">getRed</a>(), color.<a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d" title="Returns the green component of the color.">getGreen</a>(), color.<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="l00496"></a>00496                 <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.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a>)maxValInt;
<a name="l00497"></a>00497                 <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#a307354570474ae7d399cb1c536c3546d" 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_color.html#af10d2deaccbde5c958032ed9ec81b59f" title="Returns the red component of the color.">getRed</a>(), color.<a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d" title="Returns the green component of the color.">getGreen</a>(), color.<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="l00498"></a>00498                 <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#acc584a689cf0e4a312c07d58f2a9f2b4">Luminance</a> = (maxVal/minVal)*0.5f;
<a name="l00499"></a>00499                 <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="l00500"></a>00500                 {
<a name="l00501"></a>00501                         <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a76d317e46d5a30982ed3da58401d319f">Hue</a>=0.f;
<a name="l00502"></a>00502                         <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a61a3b30e3a7724ec9d091001e411987e">Saturation</a>=0.f;
<a name="l00503"></a>00503                         <span class="keywordflow">return</span>;
<a name="l00504"></a>00504                 }
<a name="l00505"></a>00505 
<a name="l00506"></a>00506                 <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="l00507"></a>00507                 <span class="keywordflow">if</span> ( <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#acc584a689cf0e4a312c07d58f2a9f2b4">Luminance</a> &lt;= 0.5f )
<a name="l00508"></a>00508                 {
<a name="l00509"></a>00509                         <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a61a3b30e3a7724ec9d091001e411987e">Saturation</a> = (delta)/(maxVal+minVal);
<a name="l00510"></a>00510                 }
<a name="l00511"></a>00511                 <span class="keywordflow">else</span>
<a name="l00512"></a>00512                 {
<a name="l00513"></a>00513                         <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a61a3b30e3a7724ec9d091001e411987e">Saturation</a> = (delta)/(2-maxVal-minVal);
<a name="l00514"></a>00514                 }
<a name="l00515"></a>00515 
<a name="l00516"></a>00516                 <span class="keywordflow">if</span> (maxValInt == color.<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="l00517"></a>00517                         <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_color.html#ad604ba81e061b0bfe2ccb5f16e29124d" title="Returns the green component of the color.">getGreen</a>()-color.<a class="code" href="classirr_1_1video_1_1_s_color.html#a26fdbde73081b35a1686f8d21a549544" title="Returns the blue component of the color.">getBlue</a>())/delta;
<a name="l00518"></a>00518                 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (maxValInt == color.<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="l00519"></a>00519                         <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_color.html#a26fdbde73081b35a1686f8d21a549544" title="Returns the blue component of the color.">getBlue</a>()-color.<a class="code" href="classirr_1_1video_1_1_s_color.html#af10d2deaccbde5c958032ed9ec81b59f" title="Returns the red component of the color.">getRed</a>())/delta;
<a name="l00520"></a>00520                 <span class="keywordflow">else</span> <span class="comment">// blue is max</span>
<a name="l00521"></a>00521                         <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_color.html#af10d2deaccbde5c958032ed9ec81b59f" title="Returns the red component of the color.">getRed</a>()-color.<a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d" title="Returns the green component of the color.">getGreen</a>())/delta;
<a name="l00522"></a>00522 
<a name="l00523"></a>00523                 <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a76d317e46d5a30982ed3da58401d319f">Hue</a> *= (60.0f * <a class="code" href="namespaceirr_1_1core.html#a4b91e69e51a2e374aec940cba3869028" title="32bit Constant for converting from degrees to radians">core::DEGTORAD</a>);
<a name="l00524"></a>00524                 <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="l00525"></a>00525                         <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a76d317e46d5a30982ed3da58401d319f">Hue</a> += 2.f * <a class="code" href="namespaceirr_1_1core.html#a26d877e2caf3e6f31c298a0417a0707e" title="Constant for PI.">core::PI</a>;
<a name="l00526"></a>00526         }
<a name="l00527"></a>00527 
<a name="l00528"></a>00528 
<a name="l00529"></a><a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#ad4c53aa1be2594250927dd68d29be163">00529</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#ad4c53aa1be2594250927dd68d29be163">SColorHSL::toRGB</a>(<a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">SColor</a> &amp;color)<span class="keyword"> const</span>
<a name="l00530"></a>00530 <span class="keyword">        </span>{
<a name="l00531"></a>00531                 <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="l00532"></a>00532                 {
<a name="l00533"></a>00533                         <a class="code" href="namespaceirr.html#a646874f69af8ff87fc10201b0254a761" title="8 bit unsigned variable.">u8</a> c = (<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_h_s_l.html#acc584a689cf0e4a312c07d58f2a9f2b4">Luminance</a> * 255.0 );
<a name="l00534"></a>00534                         color.<a class="code" href="classirr_1_1video_1_1_s_color.html#a950c98714711ae9dd8c5219f83c07693" title="Sets the red component of the Color.">setRed</a>(c);
<a name="l00535"></a>00535                         color.<a class="code" href="classirr_1_1video_1_1_s_color.html#af80cfedd5e761216b8bed259963ac948" title="Sets the green component of the Color.">setGreen</a>(c);
<a name="l00536"></a>00536                         color.<a class="code" href="classirr_1_1video_1_1_s_color.html#a13d82e6b52d32f7394f3cce041dc2965" title="Sets the blue component of the Color.">setBlue</a>(c);
<a name="l00537"></a>00537                         <span class="keywordflow">return</span>;
<a name="l00538"></a>00538                 }
<a name="l00539"></a>00539 
<a name="l00540"></a>00540                 <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> rm2;
<a name="l00541"></a>00541 
<a name="l00542"></a>00542                 <span class="keywordflow">if</span> ( <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#acc584a689cf0e4a312c07d58f2a9f2b4">Luminance</a> &lt;= 0.5f )
<a name="l00543"></a>00543                 {
<a name="l00544"></a>00544                         rm2 = <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#acc584a689cf0e4a312c07d58f2a9f2b4">Luminance</a> + <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#acc584a689cf0e4a312c07d58f2a9f2b4">Luminance</a> * <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a61a3b30e3a7724ec9d091001e411987e">Saturation</a>;
<a name="l00545"></a>00545                 }
<a name="l00546"></a>00546                 <span class="keywordflow">else</span>
<a name="l00547"></a>00547                 {
<a name="l00548"></a>00548                         rm2 = <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#acc584a689cf0e4a312c07d58f2a9f2b4">Luminance</a> + <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a61a3b30e3a7724ec9d091001e411987e">Saturation</a> - <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#acc584a689cf0e4a312c07d58f2a9f2b4">Luminance</a> * <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a61a3b30e3a7724ec9d091001e411987e">Saturation</a>;
<a name="l00549"></a>00549                 }
<a name="l00550"></a>00550 
<a name="l00551"></a>00551                 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> rm1 = 2.0f * <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#acc584a689cf0e4a312c07d58f2a9f2b4">Luminance</a> - rm2;
<a name="l00552"></a>00552 
<a name="l00553"></a>00553                 color.<a class="code" href="classirr_1_1video_1_1_s_color.html#a950c98714711ae9dd8c5219f83c07693" title="Sets the red component of the Color.">setRed</a> ( toRGB1(rm1, rm2, <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a76d317e46d5a30982ed3da58401d319f">Hue</a> + (120.0f * <a class="code" href="namespaceirr_1_1core.html#a4b91e69e51a2e374aec940cba3869028" title="32bit Constant for converting from degrees to radians">core::DEGTORAD</a> )) );
<a name="l00554"></a>00554                 color.<a class="code" href="classirr_1_1video_1_1_s_color.html#af80cfedd5e761216b8bed259963ac948" title="Sets the green component of the Color.">setGreen</a> ( toRGB1(rm1, rm2, <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a76d317e46d5a30982ed3da58401d319f">Hue</a>) );
<a name="l00555"></a>00555                 color.<a class="code" href="classirr_1_1video_1_1_s_color.html#a13d82e6b52d32f7394f3cce041dc2965" title="Sets the blue component of the Color.">setBlue</a> ( toRGB1(rm1, rm2, <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a76d317e46d5a30982ed3da58401d319f">Hue</a> - (120.0f * core::DEGTORAD) ) );
<a name="l00556"></a>00556         }
<a name="l00557"></a>00557 
<a name="l00558"></a>00558 
<a name="l00559"></a>00559         <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</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="l00560"></a>00560 <span class="keyword">        </span>{
<a name="l00561"></a>00561                 <span class="keywordflow">while</span> ( rh &gt; 2.f * <a class="code" href="namespaceirr_1_1core.html#a26d877e2caf3e6f31c298a0417a0707e" title="Constant for PI.">core::PI</a> )
<a name="l00562"></a>00562                         rh -= 2.f * core::PI;
<a name="l00563"></a>00563 
<a name="l00564"></a>00564                 <span class="keywordflow">while</span> ( rh &lt; 0.f )
<a name="l00565"></a>00565                         rh += 2.f * core::PI;
<a name="l00566"></a>00566 
<a name="l00567"></a>00567                 <span class="keywordflow">if</span> (rh &lt; 60.0f * <a class="code" href="namespaceirr_1_1core.html#a4b91e69e51a2e374aec940cba3869028" title="32bit Constant for converting from degrees to radians">core::DEGTORAD</a> )
<a name="l00568"></a>00568                         rm1 = rm1 + (rm2 - rm1) * rh / (60.0f * core::DEGTORAD);
<a name="l00569"></a>00569                 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (rh &lt; 180.0f * core::DEGTORAD )
<a name="l00570"></a>00570                         rm1 = rm2;
<a name="l00571"></a>00571                 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (rh &lt; 240.0f * core::DEGTORAD )
<a name="l00572"></a>00572                         rm1 = rm1 + (rm2 - rm1) * ( ( 240.0f * core::DEGTORAD ) - rh) /
<a name="l00573"></a>00573                                 (60.0f * core::DEGTORAD);
<a name="l00574"></a>00574 
<a name="l00575"></a>00575                 <span class="keywordflow">return</span> (<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>(rm1 * 255.f);
<a name="l00576"></a>00576         }
<a name="l00577"></a>00577 
<a name="l00578"></a>00578 } <span class="comment">// end namespace video</span>
<a name="l00579"></a>00579 } <span class="comment">// end namespace irr</span>
<a name="l00580"></a>00580 
<a name="l00581"></a>00581 <span class="preprocessor">#endif</span>
<a name="l00582"></a>00582 <span class="preprocessor"></span>
</pre></div></div>
<hr size="1">
<address style="align: right;">
<small> </small>
</address>
<table width="100%" border="0" cellspacing="0" cellpadding="2">
  <tr> 
    <td width="0"> <div align="left"><small><a href="http://irrlicht.sourceforge.net" target="_blank"><img src="irrlicht.png" alt="The Irrlicht Engine" align="middle" border=0 width=88 height=31></a></small></div></td>
    <td> <div align="left"><small><em><font size="2">The <a href="http://irrlicht.sourceforge.net" target="_blank">Irrlicht 
        Engine</a> Documentation &copy; 2003-2010 by Nikolaus Gebhardt. Generated 
        on Sun Oct 24 12:41:58 2010 by <a href="http://www.doxygen.org" target="_blank">Doxygen</a> 
        (1.6.2)</font></em></small></div></td>
  </tr>
</table>
<address style="align: right;">
</address>
</body>
</html>