aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/others/irrlicht-1.8.1/doc/html/_s_color_8h_source.html
diff options
context:
space:
mode:
Diffstat (limited to 'src/others/irrlicht-1.8.1/doc/html/_s_color_8h_source.html')
-rw-r--r--src/others/irrlicht-1.8.1/doc/html/_s_color_8h_source.html667
1 files changed, 667 insertions, 0 deletions
diff --git a/src/others/irrlicht-1.8.1/doc/html/_s_color_8h_source.html b/src/others/irrlicht-1.8.1/doc/html/_s_color_8h_source.html
new file mode 100644
index 0000000..a14db32
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/doc/html/_s_color_8h_source.html
@@ -0,0 +1,667 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5<title>Irrlicht 3D Engine: SColor.h Source File</title>
6
7<link href="tabs.css" rel="stylesheet" type="text/css"/>
8<link href="doxygen.css" rel="stylesheet" type="text/css" />
9<link href="navtree.css" rel="stylesheet" type="text/css"/>
10<script type="text/javascript" src="jquery.js"></script>
11<script type="text/javascript" src="resize.js"></script>
12<script type="text/javascript" src="navtree.js"></script>
13<script type="text/javascript">
14 $(document).ready(initResizable);
15</script>
16<link href="search/search.css" rel="stylesheet" type="text/css"/>
17<script type="text/javascript" src="search/search.js"></script>
18<script type="text/javascript">
19 $(document).ready(function() { searchBox.OnSelectItem(0); });
20</script>
21
22</head>
23<body>
24<div id="top"><!-- do not remove this div! -->
25
26
27<div id="titlearea">
28<table cellspacing="0" cellpadding="0">
29 <tbody>
30 <tr style="height: 56px;">
31
32 <td id="projectlogo"><img alt="Logo" src="irrlichtlogo.png"/></td>
33
34
35 <td style="padding-left: 0.5em;">
36 <div id="projectname">Irrlicht 3D Engine
37
38 </div>
39
40 </td>
41
42
43
44
45 <td> <div id="MSearchBox" class="MSearchBoxInactive">
46 <span class="left">
47 <img id="MSearchSelect" src="search/mag_sel.png"
48 onmouseover="return searchBox.OnSearchSelectShow()"
49 onmouseout="return searchBox.OnSearchSelectHide()"
50 alt=""/>
51 <input type="text" id="MSearchField" value="Search" accesskey="S"
52 onfocus="searchBox.OnSearchFieldFocus(true)"
53 onblur="searchBox.OnSearchFieldFocus(false)"
54 onkeyup="searchBox.OnSearchFieldChange(event)"/>
55 </span><span class="right">
56 <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
57 </span>
58 </div>
59</td>
60
61
62 </tr>
63 </tbody>
64</table>
65</div>
66
67<!-- Generated by Doxygen 1.7.5.1 -->
68<script type="text/javascript">
69var searchBox = new SearchBox("searchBox", "search",false,'Search');
70</script>
71<script type="text/javascript" src="dynsections.js"></script>
72</div>
73<div id="side-nav" class="ui-resizable side-nav-resizable">
74 <div id="nav-tree">
75 <div id="nav-tree-contents">
76 </div>
77 </div>
78 <div id="splitbar" style="-moz-user-select:none;"
79 class="ui-resizable-handle">
80 </div>
81</div>
82<script type="text/javascript">
83 initNavTree('_s_color_8h.html','');
84</script>
85<div id="doc-content">
86<div class="header">
87 <div class="headertitle">
88<div class="title">SColor.h</div> </div>
89</div>
90<div class="contents">
91<a href="_s_color_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// Copyright (C) 2002-2012 Nikolaus Gebhardt</span>
92<a name="l00002"></a>00002 <span class="comment">// This file is part of the &quot;Irrlicht Engine&quot;.</span>
93<a name="l00003"></a>00003 <span class="comment">// For conditions of distribution and use, see copyright notice in irrlicht.h</span>
94<a name="l00004"></a>00004
95<a name="l00005"></a>00005 <span class="preprocessor">#ifndef __COLOR_H_INCLUDED__</span>
96<a name="l00006"></a>00006 <span class="preprocessor"></span><span class="preprocessor">#define __COLOR_H_INCLUDED__</span>
97<a name="l00007"></a>00007 <span class="preprocessor"></span>
98<a name="l00008"></a>00008 <span class="preprocessor">#include &quot;<a class="code" href="irr_types_8h.html">irrTypes.h</a>&quot;</span>
99<a name="l00009"></a>00009 <span class="preprocessor">#include &quot;<a class="code" href="irr_math_8h.html">irrMath.h</a>&quot;</span>
100<a name="l00010"></a>00010
101<a name="l00011"></a>00011 <span class="keyword">namespace </span>irr
102<a name="l00012"></a>00012 {
103<a name="l00013"></a>00013 <span class="keyword">namespace </span>video
104<a name="l00014"></a>00014 {
105<a name="l00016"></a>00016
106<a name="l00017"></a><a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829ed">00017</a> <span class="keyword">enum</span> <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829ed" title="An enum for the color format of textures used by the Irrlicht Engine.">ECOLOR_FORMAT</a>
107<a name="l00018"></a>00018 {
108<a name="l00020"></a>00020
109<a name="l00023"></a><a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda1207765b5eab1701111b5dc37b68b4bf">00023</a> <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda1207765b5eab1701111b5dc37b68b4bf" title="16 bit color format used by the software driver.">ECF_A1R5G5B5</a> = 0,
110<a name="l00024"></a>00024
111<a name="l00026"></a><a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda49b4fe9d0ba395456dcd7c76a1ae9775">00026</a> <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda49b4fe9d0ba395456dcd7c76a1ae9775" title="Standard 16 bit color format.">ECF_R5G6B5</a>,
112<a name="l00027"></a>00027
113<a name="l00029"></a><a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda3f0380aafb1e1fd59f5419a95d630a6d">00029</a> <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda3f0380aafb1e1fd59f5419a95d630a6d" title="24 bit color, no alpha channel, but 8 bit for red, green and blue.">ECF_R8G8B8</a>,
114<a name="l00030"></a>00030
115<a name="l00032"></a><a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda55c57d63efff39efe33ee733fe962df0">00032</a> <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda55c57d63efff39efe33ee733fe962df0" title="Default 32 bit color format. 8 bits are used for every component: red, green, blue and alpha...">ECF_A8R8G8B8</a>,
116<a name="l00033"></a>00033
117<a name="l00036"></a>00036
118<a name="l00037"></a><a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829edaaa87f3817817a302753b8dbb26fc72ec">00037</a> <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829edaaa87f3817817a302753b8dbb26fc72ec" title="16 bit floating point format using 16 bits for the red channel.">ECF_R16F</a>,
119<a name="l00038"></a>00038
120<a name="l00040"></a><a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829edafc5bcc8f47e78d073130300229c22113">00040</a> <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829edafc5bcc8f47e78d073130300229c22113" title="32 bit floating point format using 16 bits for the red channel and 16 bits for the green channel...">ECF_G16R16F</a>,
121<a name="l00041"></a>00041
122<a name="l00043"></a><a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda91a9f2eeac94b28d4e1421625b53ab5e">00043</a> <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda91a9f2eeac94b28d4e1421625b53ab5e" title="64 bit floating point format 16 bits are used for the red, green, blue and alpha channels.">ECF_A16B16G16R16F</a>,
123<a name="l00044"></a>00044
124<a name="l00046"></a><a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829edad271018ac22c4ff6c76c8ebb870a6c96">00046</a> <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829edad271018ac22c4ff6c76c8ebb870a6c96" title="32 bit floating point format using 32 bits for the red channel.">ECF_R32F</a>,
125<a name="l00047"></a>00047
126<a name="l00049"></a><a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda92ab57e6c0b93f96b08db4dc5656aea2">00049</a> <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda92ab57e6c0b93f96b08db4dc5656aea2" title="64 bit floating point format using 32 bits for the red channel and 32 bits for the green channel...">ECF_G32R32F</a>,
127<a name="l00050"></a>00050
128<a name="l00052"></a><a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda22958f549a8322e81b5210edaa172157">00052</a> <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda22958f549a8322e81b5210edaa172157" title="128 bit floating point format. 32 bits are used for the red, green, blue and alpha channels...">ECF_A32B32G32R32F</a>,
129<a name="l00053"></a>00053
130<a name="l00055"></a><a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda209608685f06c86c6ae489896a246e77">00055</a> <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda209608685f06c86c6ae489896a246e77" title="Unknown color format:">ECF_UNKNOWN</a>
131<a name="l00056"></a>00056 };
132<a name="l00057"></a>00057
133<a name="l00058"></a>00058
134<a name="l00060"></a><a class="code" href="namespaceirr_1_1video.html#a65997ac1b7b7544acc0f4757be7860d1">00060</a> <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> <a class="code" href="namespaceirr_1_1video.html#a65997ac1b7b7544acc0f4757be7860d1" title="Creates a 16 bit A1R5G5B5 color.">RGBA16</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> r, <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> g, <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> b, <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> a=0xFF)
135<a name="l00061"></a>00061 {
136<a name="l00062"></a>00062 <span class="keywordflow">return</span> (<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a>)((a &amp; 0x80) &lt;&lt; 8 |
137<a name="l00063"></a>00063 (r &amp; 0xF8) &lt;&lt; 7 |
138<a name="l00064"></a>00064 (g &amp; 0xF8) &lt;&lt; 2 |
139<a name="l00065"></a>00065 (b &amp; 0xF8) &gt;&gt; 3);
140<a name="l00066"></a>00066 }
141<a name="l00067"></a>00067
142<a name="l00068"></a>00068
143<a name="l00070"></a><a class="code" href="namespaceirr_1_1video.html#a55f59b4905cab236a03cb420fd55830d">00070</a> <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> <a class="code" href="namespaceirr_1_1video.html#a55f59b4905cab236a03cb420fd55830d" title="Creates a 16 bit A1R5G5B5 color.">RGB16</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> r, <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> g, <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> b)
144<a name="l00071"></a>00071 {
145<a name="l00072"></a>00072 <span class="keywordflow">return</span> <a class="code" href="namespaceirr_1_1video.html#a65997ac1b7b7544acc0f4757be7860d1" title="Creates a 16 bit A1R5G5B5 color.">RGBA16</a>(r,g,b);
146<a name="l00073"></a>00073 }
147<a name="l00074"></a>00074
148<a name="l00075"></a>00075
149<a name="l00077"></a><a class="code" href="namespaceirr_1_1video.html#a1f8b2e9ef461d76c0723536f776c2e36">00077</a> <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> <a class="code" href="namespaceirr_1_1video.html#a1f8b2e9ef461d76c0723536f776c2e36" title="Creates a 16bit A1R5G5B5 color, based on 16bit input values.">RGB16from16</a>(<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> r, <a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> g, <a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> b)
150<a name="l00078"></a>00078 {
151<a name="l00079"></a>00079 <span class="keywordflow">return</span> (0x8000 |
152<a name="l00080"></a>00080 (r &amp; 0x1F) &lt;&lt; 10 |
153<a name="l00081"></a>00081 (g &amp; 0x1F) &lt;&lt; 5 |
154<a name="l00082"></a>00082 (b &amp; 0x1F));
155<a name="l00083"></a>00083 }
156<a name="l00084"></a>00084
157<a name="l00085"></a>00085
158<a name="l00087"></a><a class="code" href="namespaceirr_1_1video.html#a6824dfc9c71a7fd9d7a3e704b1267ddc">00087</a> <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> <a class="code" href="namespaceirr_1_1video.html#a6824dfc9c71a7fd9d7a3e704b1267ddc" title="Converts a 32bit (X8R8G8B8) color to a 16bit A1R5G5B5 color.">X8R8G8B8toA1R5G5B5</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> color)
159<a name="l00088"></a>00088 {
160<a name="l00089"></a>00089 <span class="keywordflow">return</span> (<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a>)(0x8000 |
161<a name="l00090"></a>00090 ( color &amp; 0x00F80000) &gt;&gt; 9 |
162<a name="l00091"></a>00091 ( color &amp; 0x0000F800) &gt;&gt; 6 |
163<a name="l00092"></a>00092 ( color &amp; 0x000000F8) &gt;&gt; 3);
164<a name="l00093"></a>00093 }
165<a name="l00094"></a>00094
166<a name="l00095"></a>00095
167<a name="l00097"></a><a class="code" href="namespaceirr_1_1video.html#a929c6758a0edc772cf69b2c674e4f5cd">00097</a> <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> <a class="code" href="namespaceirr_1_1video.html#a929c6758a0edc772cf69b2c674e4f5cd" title="Converts a 32bit (A8R8G8B8) color to a 16bit A1R5G5B5 color.">A8R8G8B8toA1R5G5B5</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> color)
168<a name="l00098"></a>00098 {
169<a name="l00099"></a>00099 <span class="keywordflow">return</span> (<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a>)(( color &amp; 0x80000000) &gt;&gt; 16|
170<a name="l00100"></a>00100 ( color &amp; 0x00F80000) &gt;&gt; 9 |
171<a name="l00101"></a>00101 ( color &amp; 0x0000F800) &gt;&gt; 6 |
172<a name="l00102"></a>00102 ( color &amp; 0x000000F8) &gt;&gt; 3);
173<a name="l00103"></a>00103 }
174<a name="l00104"></a>00104
175<a name="l00105"></a>00105
176<a name="l00107"></a><a class="code" href="namespaceirr_1_1video.html#a10636302b225d7f525fa46bbd3f747a4">00107</a> <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> <a class="code" href="namespaceirr_1_1video.html#a10636302b225d7f525fa46bbd3f747a4" title="Converts a 32bit (A8R8G8B8) color to a 16bit R5G6B5 color.">A8R8G8B8toR5G6B5</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> color)
177<a name="l00108"></a>00108 {
178<a name="l00109"></a>00109 <span class="keywordflow">return</span> (<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a>)(( color &amp; 0x00F80000) &gt;&gt; 8 |
179<a name="l00110"></a>00110 ( color &amp; 0x0000FC00) &gt;&gt; 5 |
180<a name="l00111"></a>00111 ( color &amp; 0x000000F8) &gt;&gt; 3);
181<a name="l00112"></a>00112 }
182<a name="l00113"></a>00113
183<a name="l00114"></a>00114
184<a name="l00116"></a>00116
185<a name="l00117"></a><a class="code" href="namespaceirr_1_1video.html#a8aa9e69faa25064379df5a91273b9fbe">00117</a> <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="namespaceirr_1_1video.html#a8aa9e69faa25064379df5a91273b9fbe" title="Convert A8R8G8B8 Color from A1R5G5B5 color.">A1R5G5B5toA8R8G8B8</a>(<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> color)
186<a name="l00118"></a>00118 {
187<a name="l00119"></a>00119 <span class="keywordflow">return</span> ( (( -( (<a class="code" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a>) color &amp; 0x00008000 ) &gt;&gt; (<a class="code" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a>) 31 ) &amp; 0xFF000000 ) |
188<a name="l00120"></a>00120 (( color &amp; 0x00007C00 ) &lt;&lt; 9) | (( color &amp; 0x00007000 ) &lt;&lt; 4) |
189<a name="l00121"></a>00121 (( color &amp; 0x000003E0 ) &lt;&lt; 6) | (( color &amp; 0x00000380 ) &lt;&lt; 1) |
190<a name="l00122"></a>00122 (( color &amp; 0x0000001F ) &lt;&lt; 3) | (( color &amp; 0x0000001C ) &gt;&gt; 2)
191<a name="l00123"></a>00123 );
192<a name="l00124"></a>00124 }
193<a name="l00125"></a>00125
194<a name="l00126"></a>00126
195<a name="l00128"></a><a class="code" href="namespaceirr_1_1video.html#a421971627afe81533a3c2b51907b72bd">00128</a> <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="namespaceirr_1_1video.html#a421971627afe81533a3c2b51907b72bd" title="Returns A8R8G8B8 Color from R5G6B5 color.">R5G6B5toA8R8G8B8</a>(<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> color)
196<a name="l00129"></a>00129 {
197<a name="l00130"></a>00130 <span class="keywordflow">return</span> 0xFF000000 |
198<a name="l00131"></a>00131 ((color &amp; 0xF800) &lt;&lt; 8)|
199<a name="l00132"></a>00132 ((color &amp; 0x07E0) &lt;&lt; 5)|
200<a name="l00133"></a>00133 ((color &amp; 0x001F) &lt;&lt; 3);
201<a name="l00134"></a>00134 }
202<a name="l00135"></a>00135
203<a name="l00136"></a>00136
204<a name="l00138"></a><a class="code" href="namespaceirr_1_1video.html#aaeb39c8fc1b9c4e78b68e2da210f70ff">00138</a> <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> <a class="code" href="namespaceirr_1_1video.html#aaeb39c8fc1b9c4e78b68e2da210f70ff" title="Returns A1R5G5B5 Color from R5G6B5 color.">R5G6B5toA1R5G5B5</a>(<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> color)
205<a name="l00139"></a>00139 {
206<a name="l00140"></a>00140 <span class="keywordflow">return</span> 0x8000 | (((color &amp; 0xFFC0) &gt;&gt; 1) | (color &amp; 0x1F));
207<a name="l00141"></a>00141 }
208<a name="l00142"></a>00142
209<a name="l00143"></a>00143
210<a name="l00145"></a><a class="code" href="namespaceirr_1_1video.html#a4906b4425165ee533dab17506fe98ce8">00145</a> <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> <a class="code" href="namespaceirr_1_1video.html#a4906b4425165ee533dab17506fe98ce8" title="Returns R5G6B5 Color from A1R5G5B5 color.">A1R5G5B5toR5G6B5</a>(<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> color)
211<a name="l00146"></a>00146 {
212<a name="l00147"></a>00147 <span class="keywordflow">return</span> (((color &amp; 0x7FE0) &lt;&lt; 1) | (color &amp; 0x1F));
213<a name="l00148"></a>00148 }
214<a name="l00149"></a>00149
215<a name="l00150"></a>00150
216<a name="l00151"></a>00151
217<a name="l00153"></a>00153
218<a name="l00155"></a><a class="code" href="namespaceirr_1_1video.html#a23358b142a005c4a4c747d227a4d77ab">00155</a> <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="namespaceirr_1_1video.html#a23358b142a005c4a4c747d227a4d77ab" title="Returns the alpha component from A1R5G5B5 color.">getAlpha</a>(<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> color)
219<a name="l00156"></a>00156 {
220<a name="l00157"></a>00157 <span class="keywordflow">return</span> ((color &gt;&gt; 15)&amp;0x1);
221<a name="l00158"></a>00158 }
222<a name="l00159"></a>00159
223<a name="l00160"></a>00160
224<a name="l00162"></a>00162
225<a name="l00163"></a><a class="code" href="namespaceirr_1_1video.html#aa98234702c65c82ce29115b12e89dafe">00163</a> <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="namespaceirr_1_1video.html#aa98234702c65c82ce29115b12e89dafe" title="Returns the red component from A1R5G5B5 color.">getRed</a>(<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> color)
226<a name="l00164"></a>00164 {
227<a name="l00165"></a>00165 <span class="keywordflow">return</span> ((color &gt;&gt; 10)&amp;0x1F);
228<a name="l00166"></a>00166 }
229<a name="l00167"></a>00167
230<a name="l00168"></a>00168
231<a name="l00170"></a>00170
232<a name="l00171"></a><a class="code" href="namespaceirr_1_1video.html#a3e64185c36326ed33a494ba14cac00a5">00171</a> <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="namespaceirr_1_1video.html#a3e64185c36326ed33a494ba14cac00a5" title="Returns the green component from A1R5G5B5 color.">getGreen</a>(<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> color)
233<a name="l00172"></a>00172 {
234<a name="l00173"></a>00173 <span class="keywordflow">return</span> ((color &gt;&gt; 5)&amp;0x1F);
235<a name="l00174"></a>00174 }
236<a name="l00175"></a>00175
237<a name="l00176"></a>00176
238<a name="l00178"></a>00178
239<a name="l00179"></a><a class="code" href="namespaceirr_1_1video.html#ae8dc9edd5a3eb01de47933ac2d7f679e">00179</a> <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="namespaceirr_1_1video.html#ae8dc9edd5a3eb01de47933ac2d7f679e" title="Returns the blue component from A1R5G5B5 color.">getBlue</a>(<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> color)
240<a name="l00180"></a>00180 {
241<a name="l00181"></a>00181 <span class="keywordflow">return</span> (color &amp; 0x1F);
242<a name="l00182"></a>00182 }
243<a name="l00183"></a>00183
244<a name="l00184"></a>00184
245<a name="l00186"></a><a class="code" href="namespaceirr_1_1video.html#ab242fde6c6e19ae4100fe39b0dadd9d0">00186</a> <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> <a class="code" href="namespaceirr_1_1video.html#ab242fde6c6e19ae4100fe39b0dadd9d0" title="Returns the average from a 16 bit A1R5G5B5 color.">getAverage</a>(<a class="code" href="namespaceirr.html#a43ace0af066371ac0862bac3f7314220" title="16 bit signed variable.">s16</a> color)
246<a name="l00187"></a>00187 {
247<a name="l00188"></a>00188 <span class="keywordflow">return</span> ((<a class="code" href="namespaceirr_1_1video.html#aa98234702c65c82ce29115b12e89dafe" title="Returns the red component from A1R5G5B5 color.">getRed</a>(color)&lt;&lt;3) + (<a class="code" href="namespaceirr_1_1video.html#a3e64185c36326ed33a494ba14cac00a5" title="Returns the green component from A1R5G5B5 color.">getGreen</a>(color)&lt;&lt;3) + (<a class="code" href="namespaceirr_1_1video.html#ae8dc9edd5a3eb01de47933ac2d7f679e" title="Returns the blue component from A1R5G5B5 color.">getBlue</a>(color)&lt;&lt;3)) / 3;
248<a name="l00189"></a>00189 }
249<a name="l00190"></a>00190
250<a name="l00191"></a>00191
251<a name="l00193"></a>00193
252<a name="l00201"></a><a class="code" href="classirr_1_1video_1_1_s_color.html">00201</a> <span class="keyword">class </span><a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">SColor</a>
253<a name="l00202"></a>00202 {
254<a name="l00203"></a>00203 <span class="keyword">public</span>:
255<a name="l00204"></a>00204
256<a name="l00206"></a>00206
257<a name="l00207"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#ab001c0c2515ff5f8a0b324d1345485f4">00207</a> <a class="code" href="classirr_1_1video_1_1_s_color.html#ab001c0c2515ff5f8a0b324d1345485f4" title="Constructor of the Color. Does nothing.">SColor</a>() {}
258<a name="l00208"></a>00208
259<a name="l00210"></a>00210
260<a name="l00211"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#aa2ca1fcb9b11375282bb407b635b3dd6">00211</a> <a class="code" href="classirr_1_1video_1_1_s_color.html#ab001c0c2515ff5f8a0b324d1345485f4" title="Constructor of the Color. Does nothing.">SColor</a> (<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> a, <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> r, <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> g, <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> b)
261<a name="l00212"></a>00212 : <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a>(((a &amp; 0xff)&lt;&lt;24) | ((r &amp; 0xff)&lt;&lt;16) | ((g &amp; 0xff)&lt;&lt;8) | (b &amp; 0xff)) {}
262<a name="l00213"></a>00213
263<a name="l00215"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a56dd5677c3e36d3b33d5d796be2597da">00215</a> <a class="code" href="classirr_1_1video_1_1_s_color.html#ab001c0c2515ff5f8a0b324d1345485f4" title="Constructor of the Color. Does nothing.">SColor</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> clr)
264<a name="l00216"></a>00216 : <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a>(clr) {}
265<a name="l00217"></a>00217
266<a name="l00219"></a>00219
267<a name="l00221"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a9647d09a9d4b9c6fb48a8fa1f2da425c">00221</a> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="classirr_1_1video_1_1_s_color.html#a9647d09a9d4b9c6fb48a8fa1f2da425c" title="Returns the alpha component of the color.">getAlpha</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a>&gt;&gt;24; }
268<a name="l00222"></a>00222
269<a name="l00224"></a>00224
270<a name="l00226"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#af10d2deaccbde5c958032ed9ec81b59f">00226</a> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="classirr_1_1video_1_1_s_color.html#af10d2deaccbde5c958032ed9ec81b59f" title="Returns the red component of the color.">getRed</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> (<a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a>&gt;&gt;16) &amp; 0xff; }
271<a name="l00227"></a>00227
272<a name="l00229"></a>00229
273<a name="l00231"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d">00231</a> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d" title="Returns the green component of the color.">getGreen</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> (<a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a>&gt;&gt;8) &amp; 0xff; }
274<a name="l00232"></a>00232
275<a name="l00234"></a>00234
276<a name="l00236"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a26fdbde73081b35a1686f8d21a549544">00236</a> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="classirr_1_1video_1_1_s_color.html#a26fdbde73081b35a1686f8d21a549544" title="Returns the blue component of the color.">getBlue</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> &amp; 0xff; }
277<a name="l00237"></a>00237
278<a name="l00239"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#aa96bfc155c181104c61df9d58ad8be0f">00239</a> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="classirr_1_1video_1_1_s_color.html#aa96bfc155c181104c61df9d58ad8be0f" title="Get lightness of the color in the range [0,255].">getLightness</a>()<span class="keyword"> const</span>
279<a name="l00240"></a>00240 <span class="keyword"> </span>{
280<a name="l00241"></a>00241 <span class="keywordflow">return</span> 0.5f*(<a class="code" href="namespaceirr_1_1core.html#afca1ce7ac54e0c31a9047947f4c7319b" title="returns maximum of two values. Own implementation to get rid of the STL (VS6 problems)">core::max_</a>(<a class="code" href="namespaceirr_1_1core.html#afca1ce7ac54e0c31a9047947f4c7319b" title="returns maximum of two values. Own implementation to get rid of the STL (VS6 problems)">core::max_</a>(<a class="code" href="classirr_1_1video_1_1_s_color.html#af10d2deaccbde5c958032ed9ec81b59f" title="Returns the red component of the color.">getRed</a>(),<a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d" title="Returns the green component of the color.">getGreen</a>()),<a class="code" href="classirr_1_1video_1_1_s_color.html#a26fdbde73081b35a1686f8d21a549544" title="Returns the blue component of the color.">getBlue</a>())+<a class="code" href="namespaceirr_1_1core.html#a9d34bfdbbe9c136b01ae04974572bc11" title="returns minimum of two values. Own implementation to get rid of the STL (VS6 problems)">core::min_</a>(<a class="code" href="namespaceirr_1_1core.html#a9d34bfdbbe9c136b01ae04974572bc11" title="returns minimum of two values. Own implementation to get rid of the STL (VS6 problems)">core::min_</a>(<a class="code" href="classirr_1_1video_1_1_s_color.html#af10d2deaccbde5c958032ed9ec81b59f" title="Returns the red component of the color.">getRed</a>(),<a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d" title="Returns the green component of the color.">getGreen</a>()),<a class="code" href="classirr_1_1video_1_1_s_color.html#a26fdbde73081b35a1686f8d21a549544" title="Returns the blue component of the color.">getBlue</a>()));
281<a name="l00242"></a>00242 }
282<a name="l00243"></a>00243
283<a name="l00245"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#ad0a78b90a97e8444a1d12e93e7e929ba">00245</a> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="classirr_1_1video_1_1_s_color.html#ad0a78b90a97e8444a1d12e93e7e929ba" title="Get luminance of the color in the range [0,255].">getLuminance</a>()<span class="keyword"> const</span>
284<a name="l00246"></a>00246 <span class="keyword"> </span>{
285<a name="l00247"></a>00247 <span class="keywordflow">return</span> 0.3f*<a class="code" href="classirr_1_1video_1_1_s_color.html#af10d2deaccbde5c958032ed9ec81b59f" title="Returns the red component of the color.">getRed</a>() + 0.59f*<a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d" title="Returns the green component of the color.">getGreen</a>() + 0.11f*<a class="code" href="classirr_1_1video_1_1_s_color.html#a26fdbde73081b35a1686f8d21a549544" title="Returns the blue component of the color.">getBlue</a>();
286<a name="l00248"></a>00248 }
287<a name="l00249"></a>00249
288<a name="l00251"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a29a672f4bae9805970b84c4aef81b9ab">00251</a> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="classirr_1_1video_1_1_s_color.html#a29a672f4bae9805970b84c4aef81b9ab" title="Get average intensity of the color in the range [0,255].">getAverage</a>()<span class="keyword"> const</span>
289<a name="l00252"></a>00252 <span class="keyword"> </span>{
290<a name="l00253"></a>00253 <span class="keywordflow">return</span> ( <a class="code" href="classirr_1_1video_1_1_s_color.html#af10d2deaccbde5c958032ed9ec81b59f" title="Returns the red component of the color.">getRed</a>() + <a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d" title="Returns the green component of the color.">getGreen</a>() + <a class="code" href="classirr_1_1video_1_1_s_color.html#a26fdbde73081b35a1686f8d21a549544" title="Returns the blue component of the color.">getBlue</a>() ) / 3;
291<a name="l00254"></a>00254 }
292<a name="l00255"></a>00255
293<a name="l00257"></a>00257
294<a name="l00259"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a7bfe4abc30d563668b947c8bdb055bab">00259</a> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1video_1_1_s_color.html#a7bfe4abc30d563668b947c8bdb055bab" title="Sets the alpha component of the Color.">setAlpha</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> a) { <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> = ((a &amp; 0xff)&lt;&lt;24) | (<a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> &amp; 0x00ffffff); }
295<a name="l00260"></a>00260
296<a name="l00262"></a>00262
297<a name="l00264"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a950c98714711ae9dd8c5219f83c07693">00264</a> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1video_1_1_s_color.html#a950c98714711ae9dd8c5219f83c07693" title="Sets the red component of the Color.">setRed</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> r) { <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> = ((r &amp; 0xff)&lt;&lt;16) | (<a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> &amp; 0xff00ffff); }
298<a name="l00265"></a>00265
299<a name="l00267"></a>00267
300<a name="l00269"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#af80cfedd5e761216b8bed259963ac948">00269</a> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1video_1_1_s_color.html#af80cfedd5e761216b8bed259963ac948" title="Sets the green component of the Color.">setGreen</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> g) { <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> = ((g &amp; 0xff)&lt;&lt;8) | (<a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> &amp; 0xffff00ff); }
301<a name="l00270"></a>00270
302<a name="l00272"></a>00272
303<a name="l00274"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a13d82e6b52d32f7394f3cce041dc2965">00274</a> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1video_1_1_s_color.html#a13d82e6b52d32f7394f3cce041dc2965" title="Sets the blue component of the Color.">setBlue</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> b) { <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> = (b &amp; 0xff) | (<a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> &amp; 0xffffff00); }
304<a name="l00275"></a>00275
305<a name="l00277"></a>00277
306<a name="l00278"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a9a6ad04081a1b15c07746cf84a971565">00278</a> <a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> <a class="code" href="classirr_1_1video_1_1_s_color.html#a9a6ad04081a1b15c07746cf84a971565" title="Calculates a 16 bit A1R5G5B5 value of this color.">toA1R5G5B5</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="namespaceirr_1_1video.html#a929c6758a0edc772cf69b2c674e4f5cd" title="Converts a 32bit (A8R8G8B8) color to a 16bit A1R5G5B5 color.">A8R8G8B8toA1R5G5B5</a>(<a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a>); }
307<a name="l00279"></a>00279
308<a name="l00281"></a>00281
309<a name="l00284"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a0196acc3dfded9f6161c41f0065267c1">00284</a> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1video_1_1_s_color.html#a0196acc3dfded9f6161c41f0065267c1" title="Converts color to OpenGL color format.">toOpenGLColor</a>(<a class="code" href="namespaceirr.html#a646874f69af8ff87fc10201b0254a761" title="8 bit unsigned variable.">u8</a>* dest)<span class="keyword"> const</span>
310<a name="l00285"></a>00285 <span class="keyword"> </span>{
311<a name="l00286"></a>00286 *dest = (<a class="code" href="namespaceirr.html#a646874f69af8ff87fc10201b0254a761" title="8 bit unsigned variable.">u8</a>)<a class="code" href="classirr_1_1video_1_1_s_color.html#af10d2deaccbde5c958032ed9ec81b59f" title="Returns the red component of the color.">getRed</a>();
312<a name="l00287"></a>00287 *++dest = (<a class="code" href="namespaceirr.html#a646874f69af8ff87fc10201b0254a761" title="8 bit unsigned variable.">u8</a>)<a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d" title="Returns the green component of the color.">getGreen</a>();
313<a name="l00288"></a>00288 *++dest = (<a class="code" href="namespaceirr.html#a646874f69af8ff87fc10201b0254a761" title="8 bit unsigned variable.">u8</a>)<a class="code" href="classirr_1_1video_1_1_s_color.html#a26fdbde73081b35a1686f8d21a549544" title="Returns the blue component of the color.">getBlue</a>();
314<a name="l00289"></a>00289 *++dest = (<a class="code" href="namespaceirr.html#a646874f69af8ff87fc10201b0254a761" title="8 bit unsigned variable.">u8</a>)<a class="code" href="classirr_1_1video_1_1_s_color.html#a9647d09a9d4b9c6fb48a8fa1f2da425c" title="Returns the alpha component of the color.">getAlpha</a>();
315<a name="l00290"></a>00290 }
316<a name="l00291"></a>00291
317<a name="l00293"></a>00293
318<a name="l00307"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a8cf295c05c7406cc249843acbb31ec5f">00307</a> <span class="keywordtype">void</span> <span class="keyword">set</span>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> a, <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> r, <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> g, <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> b)
319<a name="l00308"></a>00308 {
320<a name="l00309"></a>00309 <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> = (((a &amp; 0xff)&lt;&lt;24) | ((r &amp; 0xff)&lt;&lt;16) | ((g &amp; 0xff)&lt;&lt;8) | (b &amp; 0xff));
321<a name="l00310"></a>00310 }
322<a name="l00311"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a4966581260a89f10386bf9d06239c341">00311</a> <span class="keywordtype">void</span> <span class="keyword">set</span>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> col) { <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> = col; }
323<a name="l00312"></a>00312
324<a name="l00314"></a>00314
325<a name="l00315"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a68025038ef1c75c8b7ca64270216f79f">00315</a> <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1video_1_1_s_color.html#a68025038ef1c75c8b7ca64270216f79f" title="Compares the color to another color.">operator==</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">SColor</a>&amp; other)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> other.<a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> == <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a>; }
326<a name="l00316"></a>00316
327<a name="l00318"></a>00318
328<a name="l00319"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#abcacfc84b1a87f148570efb176999104">00319</a> <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1video_1_1_s_color.html#abcacfc84b1a87f148570efb176999104" title="Compares the color to another color.">operator!=</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">SColor</a>&amp; other)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> other.<a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> != <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a>; }
329<a name="l00320"></a>00320
330<a name="l00322"></a>00322
331<a name="l00323"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a8e7944ddc658076a2933861a1b99f1e7">00323</a> <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1video_1_1_s_color.html#a8e7944ddc658076a2933861a1b99f1e7" title="comparison operator">operator&lt;</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">SColor</a>&amp; other)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> (<a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> &lt; other.<a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a>); }
332<a name="l00324"></a>00324
333<a name="l00326"></a>00326
334<a name="l00328"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a1cd25e0e67050af13a15515b7d2c8782">00328</a> <a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">SColor</a> <a class="code" href="classirr_1_1video_1_1_s_color.html#a1cd25e0e67050af13a15515b7d2c8782" title="Adds two colors, result is clamped to 0..255 values.">operator+</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">SColor</a>&amp; other)<span class="keyword"> const</span>
335<a name="l00329"></a>00329 <span class="keyword"> </span>{
336<a name="l00330"></a>00330 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1video_1_1_s_color.html#ab001c0c2515ff5f8a0b324d1345485f4" title="Constructor of the Color. Does nothing.">SColor</a>(<a class="code" href="namespaceirr_1_1core.html#a9d34bfdbbe9c136b01ae04974572bc11" title="returns minimum of two values. Own implementation to get rid of the STL (VS6 problems)">core::min_</a>(<a class="code" href="classirr_1_1video_1_1_s_color.html#a9647d09a9d4b9c6fb48a8fa1f2da425c" title="Returns the alpha component of the color.">getAlpha</a>() + other.<a class="code" href="classirr_1_1video_1_1_s_color.html#a9647d09a9d4b9c6fb48a8fa1f2da425c" title="Returns the alpha component of the color.">getAlpha</a>(), 255u),
337<a name="l00331"></a>00331 <a class="code" href="namespaceirr_1_1core.html#a9d34bfdbbe9c136b01ae04974572bc11" title="returns minimum of two values. Own implementation to get rid of the STL (VS6 problems)">core::min_</a>(<a class="code" href="classirr_1_1video_1_1_s_color.html#af10d2deaccbde5c958032ed9ec81b59f" title="Returns the red component of the color.">getRed</a>() + other.<a class="code" href="classirr_1_1video_1_1_s_color.html#af10d2deaccbde5c958032ed9ec81b59f" title="Returns the red component of the color.">getRed</a>(), 255u),
338<a name="l00332"></a>00332 <a class="code" href="namespaceirr_1_1core.html#a9d34bfdbbe9c136b01ae04974572bc11" title="returns minimum of two values. Own implementation to get rid of the STL (VS6 problems)">core::min_</a>(<a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d" title="Returns the green component of the color.">getGreen</a>() + other.<a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d" title="Returns the green component of the color.">getGreen</a>(), 255u),
339<a name="l00333"></a>00333 <a class="code" href="namespaceirr_1_1core.html#a9d34bfdbbe9c136b01ae04974572bc11" title="returns minimum of two values. Own implementation to get rid of the STL (VS6 problems)">core::min_</a>(<a class="code" href="classirr_1_1video_1_1_s_color.html#a26fdbde73081b35a1686f8d21a549544" title="Returns the blue component of the color.">getBlue</a>() + other.<a class="code" href="classirr_1_1video_1_1_s_color.html#a26fdbde73081b35a1686f8d21a549544" title="Returns the blue component of the color.">getBlue</a>(), 255u));
340<a name="l00334"></a>00334 }
341<a name="l00335"></a>00335
342<a name="l00337"></a>00337
343<a name="l00340"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a880760bf37e7c2143cc0b1a0e90a85b1">00340</a> <a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">SColor</a> <a class="code" href="classirr_1_1video_1_1_s_color.html#a880760bf37e7c2143cc0b1a0e90a85b1" title="Interpolates the color with a f32 value to another color.">getInterpolated</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">SColor</a> &amp;other, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> d)<span class="keyword"> const</span>
344<a name="l00341"></a>00341 <span class="keyword"> </span>{
345<a name="l00342"></a>00342 d = <a class="code" href="namespaceirr_1_1core.html#a6162f685b68f629e77336081d3316969" title="clamps a value between low and high">core::clamp</a>(d, 0.f, 1.f);
346<a name="l00343"></a>00343 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> inv = 1.0f - d;
347<a name="l00344"></a>00344 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1video_1_1_s_color.html#ab001c0c2515ff5f8a0b324d1345485f4" title="Constructor of the Color. Does nothing.">SColor</a>((<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a>)<a class="code" href="namespaceirr_1_1core.html#ae46f57f03e9033c57c180fbe83b04cf2">core::round32</a>(other.<a class="code" href="classirr_1_1video_1_1_s_color.html#a9647d09a9d4b9c6fb48a8fa1f2da425c" title="Returns the alpha component of the color.">getAlpha</a>()*inv + <a class="code" href="classirr_1_1video_1_1_s_color.html#a9647d09a9d4b9c6fb48a8fa1f2da425c" title="Returns the alpha component of the color.">getAlpha</a>()*d),
348<a name="l00345"></a>00345 (<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a>)<a class="code" href="namespaceirr_1_1core.html#ae46f57f03e9033c57c180fbe83b04cf2">core::round32</a>(other.<a class="code" href="classirr_1_1video_1_1_s_color.html#af10d2deaccbde5c958032ed9ec81b59f" title="Returns the red component of the color.">getRed</a>()*inv + <a class="code" href="classirr_1_1video_1_1_s_color.html#af10d2deaccbde5c958032ed9ec81b59f" title="Returns the red component of the color.">getRed</a>()*d),
349<a name="l00346"></a>00346 (<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a>)<a class="code" href="namespaceirr_1_1core.html#ae46f57f03e9033c57c180fbe83b04cf2">core::round32</a>(other.<a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d" title="Returns the green component of the color.">getGreen</a>()*inv + <a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d" title="Returns the green component of the color.">getGreen</a>()*d),
350<a name="l00347"></a>00347 (<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a>)<a class="code" href="namespaceirr_1_1core.html#ae46f57f03e9033c57c180fbe83b04cf2">core::round32</a>(other.<a class="code" href="classirr_1_1video_1_1_s_color.html#a26fdbde73081b35a1686f8d21a549544" title="Returns the blue component of the color.">getBlue</a>()*inv + <a class="code" href="classirr_1_1video_1_1_s_color.html#a26fdbde73081b35a1686f8d21a549544" title="Returns the blue component of the color.">getBlue</a>()*d));
351<a name="l00348"></a>00348 }
352<a name="l00349"></a>00349
353<a name="l00351"></a>00351
354<a name="l00354"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a9e3832dd71062d1d200f11b91cd3a104">00354</a> <a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">SColor</a> <a class="code" href="classirr_1_1video_1_1_s_color.html#a9e3832dd71062d1d200f11b91cd3a104" title="Returns interpolated color. ( quadratic )">getInterpolated_quadratic</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">SColor</a>&amp; c1, <span class="keyword">const</span> <a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">SColor</a>&amp; c2, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> d)<span class="keyword"> const</span>
355<a name="l00355"></a>00355 <span class="keyword"> </span>{
356<a name="l00356"></a>00356 <span class="comment">// this*(1-d)*(1-d) + 2 * c1 * (1-d) + c2 * d * d;</span>
357<a name="l00357"></a>00357 d = <a class="code" href="namespaceirr_1_1core.html#a6162f685b68f629e77336081d3316969" title="clamps a value between low and high">core::clamp</a>(d, 0.f, 1.f);
358<a name="l00358"></a>00358 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> inv = 1.f - d;
359<a name="l00359"></a>00359 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> mul0 = inv * inv;
360<a name="l00360"></a>00360 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> mul1 = 2.f * d * inv;
361<a name="l00361"></a>00361 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> mul2 = d * d;
362<a name="l00362"></a>00362
363<a name="l00363"></a>00363 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1video_1_1_s_color.html#ab001c0c2515ff5f8a0b324d1345485f4" title="Constructor of the Color. Does nothing.">SColor</a>(
364<a name="l00364"></a>00364 <a class="code" href="namespaceirr_1_1core.html#a6162f685b68f629e77336081d3316969" title="clamps a value between low and high">core::clamp</a>( <a class="code" href="namespaceirr_1_1core.html#ac230a392b15e3d27c6e2a07a6925a8c4">core::floor32</a>(
365<a name="l00365"></a>00365 <a class="code" href="classirr_1_1video_1_1_s_color.html#a9647d09a9d4b9c6fb48a8fa1f2da425c" title="Returns the alpha component of the color.">getAlpha</a>() * mul0 + c1.<a class="code" href="classirr_1_1video_1_1_s_color.html#a9647d09a9d4b9c6fb48a8fa1f2da425c" title="Returns the alpha component of the color.">getAlpha</a>() * mul1 + c2.<a class="code" href="classirr_1_1video_1_1_s_color.html#a9647d09a9d4b9c6fb48a8fa1f2da425c" title="Returns the alpha component of the color.">getAlpha</a>() * mul2 ), 0, 255 ),
366<a name="l00366"></a>00366 <a class="code" href="namespaceirr_1_1core.html#a6162f685b68f629e77336081d3316969" title="clamps a value between low and high">core::clamp</a>( <a class="code" href="namespaceirr_1_1core.html#ac230a392b15e3d27c6e2a07a6925a8c4">core::floor32</a>(
367<a name="l00367"></a>00367 <a class="code" href="classirr_1_1video_1_1_s_color.html#af10d2deaccbde5c958032ed9ec81b59f" title="Returns the red component of the color.">getRed</a>() * mul0 + c1.<a class="code" href="classirr_1_1video_1_1_s_color.html#af10d2deaccbde5c958032ed9ec81b59f" title="Returns the red component of the color.">getRed</a>() * mul1 + c2.<a class="code" href="classirr_1_1video_1_1_s_color.html#af10d2deaccbde5c958032ed9ec81b59f" title="Returns the red component of the color.">getRed</a>() * mul2 ), 0, 255 ),
368<a name="l00368"></a>00368 <a class="code" href="namespaceirr_1_1core.html#a6162f685b68f629e77336081d3316969" title="clamps a value between low and high">core::clamp</a> ( <a class="code" href="namespaceirr_1_1core.html#ac230a392b15e3d27c6e2a07a6925a8c4">core::floor32</a>(
369<a name="l00369"></a>00369 <a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d" title="Returns the green component of the color.">getGreen</a>() * mul0 + c1.<a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d" title="Returns the green component of the color.">getGreen</a>() * mul1 + c2.<a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d" title="Returns the green component of the color.">getGreen</a>() * mul2 ), 0, 255 ),
370<a name="l00370"></a>00370 <a class="code" href="namespaceirr_1_1core.html#a6162f685b68f629e77336081d3316969" title="clamps a value between low and high">core::clamp</a> ( <a class="code" href="namespaceirr_1_1core.html#ac230a392b15e3d27c6e2a07a6925a8c4">core::floor32</a>(
371<a name="l00371"></a>00371 <a class="code" href="classirr_1_1video_1_1_s_color.html#a26fdbde73081b35a1686f8d21a549544" title="Returns the blue component of the color.">getBlue</a>() * mul0 + c1.<a class="code" href="classirr_1_1video_1_1_s_color.html#a26fdbde73081b35a1686f8d21a549544" title="Returns the blue component of the color.">getBlue</a>() * mul1 + c2.<a class="code" href="classirr_1_1video_1_1_s_color.html#a26fdbde73081b35a1686f8d21a549544" title="Returns the blue component of the color.">getBlue</a>() * mul2 ), 0, 255 ));
372<a name="l00372"></a>00372 }
373<a name="l00373"></a>00373
374<a name="l00375"></a>00375
375<a name="l00378"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a381f2db0ed17c6b06ba5c8809dce3370">00378</a> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1video_1_1_s_color.html#a381f2db0ed17c6b06ba5c8809dce3370" title="set the color by expecting data in the given format">setData</a>(<span class="keyword">const</span> <span class="keywordtype">void</span> *data, <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829ed" title="An enum for the color format of textures used by the Irrlicht Engine.">ECOLOR_FORMAT</a> format)
376<a name="l00379"></a>00379 {
377<a name="l00380"></a>00380 <span class="keywordflow">switch</span> (format)
378<a name="l00381"></a>00381 {
379<a name="l00382"></a>00382 <span class="keywordflow">case</span> <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda1207765b5eab1701111b5dc37b68b4bf" title="16 bit color format used by the software driver.">ECF_A1R5G5B5</a>:
380<a name="l00383"></a>00383 <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> = <a class="code" href="namespaceirr_1_1video.html#a8aa9e69faa25064379df5a91273b9fbe" title="Convert A8R8G8B8 Color from A1R5G5B5 color.">A1R5G5B5toA8R8G8B8</a>(*(<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a>*)data);
381<a name="l00384"></a>00384 <span class="keywordflow">break</span>;
382<a name="l00385"></a>00385 <span class="keywordflow">case</span> <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda49b4fe9d0ba395456dcd7c76a1ae9775" title="Standard 16 bit color format.">ECF_R5G6B5</a>:
383<a name="l00386"></a>00386 <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> = <a class="code" href="namespaceirr_1_1video.html#a421971627afe81533a3c2b51907b72bd" title="Returns A8R8G8B8 Color from R5G6B5 color.">R5G6B5toA8R8G8B8</a>(*(<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a>*)data);
384<a name="l00387"></a>00387 <span class="keywordflow">break</span>;
385<a name="l00388"></a>00388 <span class="keywordflow">case</span> <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda55c57d63efff39efe33ee733fe962df0" title="Default 32 bit color format. 8 bits are used for every component: red, green, blue and alpha...">ECF_A8R8G8B8</a>:
386<a name="l00389"></a>00389 <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> = *(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a>*)data;
387<a name="l00390"></a>00390 <span class="keywordflow">break</span>;
388<a name="l00391"></a>00391 <span class="keywordflow">case</span> <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda3f0380aafb1e1fd59f5419a95d630a6d" title="24 bit color, no alpha channel, but 8 bit for red, green and blue.">ECF_R8G8B8</a>:
389<a name="l00392"></a>00392 {
390<a name="l00393"></a>00393 <a class="code" href="namespaceirr.html#a646874f69af8ff87fc10201b0254a761" title="8 bit unsigned variable.">u8</a>* p = (<a class="code" href="namespaceirr.html#a646874f69af8ff87fc10201b0254a761" title="8 bit unsigned variable.">u8</a>*)data;
391<a name="l00394"></a>00394 <span class="keyword">set</span>(255, p[0],p[1],p[2]);
392<a name="l00395"></a>00395 }
393<a name="l00396"></a>00396 <span class="keywordflow">break</span>;
394<a name="l00397"></a>00397 <span class="keywordflow">default</span>:
395<a name="l00398"></a>00398 <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> = 0xffffffff;
396<a name="l00399"></a>00399 <span class="keywordflow">break</span>;
397<a name="l00400"></a>00400 }
398<a name="l00401"></a>00401 }
399<a name="l00402"></a>00402
400<a name="l00404"></a>00404
401<a name="l00407"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a7cba1b914230289de9c91ff28be96bc9">00407</a> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1video_1_1_s_color.html#a7cba1b914230289de9c91ff28be96bc9" title="Write the color to data in the defined format.">getData</a>(<span class="keywordtype">void</span> *data, <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829ed" title="An enum for the color format of textures used by the Irrlicht Engine.">ECOLOR_FORMAT</a> format)
402<a name="l00408"></a>00408 {
403<a name="l00409"></a>00409 <span class="keywordflow">switch</span>(format)
404<a name="l00410"></a>00410 {
405<a name="l00411"></a>00411 <span class="keywordflow">case</span> <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda1207765b5eab1701111b5dc37b68b4bf" title="16 bit color format used by the software driver.">ECF_A1R5G5B5</a>:
406<a name="l00412"></a>00412 {
407<a name="l00413"></a>00413 <a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> * dest = (<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a>*)data;
408<a name="l00414"></a>00414 *dest = <a class="code" href="namespaceirr_1_1video.html#a929c6758a0edc772cf69b2c674e4f5cd" title="Converts a 32bit (A8R8G8B8) color to a 16bit A1R5G5B5 color.">video::A8R8G8B8toA1R5G5B5</a>( <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> );
409<a name="l00415"></a>00415 }
410<a name="l00416"></a>00416 <span class="keywordflow">break</span>;
411<a name="l00417"></a>00417
412<a name="l00418"></a>00418 <span class="keywordflow">case</span> <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda49b4fe9d0ba395456dcd7c76a1ae9775" title="Standard 16 bit color format.">ECF_R5G6B5</a>:
413<a name="l00419"></a>00419 {
414<a name="l00420"></a>00420 <a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> * dest = (<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a>*)data;
415<a name="l00421"></a>00421 *dest = <a class="code" href="namespaceirr_1_1video.html#a10636302b225d7f525fa46bbd3f747a4" title="Converts a 32bit (A8R8G8B8) color to a 16bit R5G6B5 color.">video::A8R8G8B8toR5G6B5</a>( <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a> );
416<a name="l00422"></a>00422 }
417<a name="l00423"></a>00423 <span class="keywordflow">break</span>;
418<a name="l00424"></a>00424
419<a name="l00425"></a>00425 <span class="keywordflow">case</span> <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda3f0380aafb1e1fd59f5419a95d630a6d" title="24 bit color, no alpha channel, but 8 bit for red, green and blue.">ECF_R8G8B8</a>:
420<a name="l00426"></a>00426 {
421<a name="l00427"></a>00427 <a class="code" href="namespaceirr.html#a646874f69af8ff87fc10201b0254a761" title="8 bit unsigned variable.">u8</a>* dest = (<a class="code" href="namespaceirr.html#a646874f69af8ff87fc10201b0254a761" title="8 bit unsigned variable.">u8</a>*)data;
422<a name="l00428"></a>00428 dest[0] = (<a class="code" href="namespaceirr.html#a646874f69af8ff87fc10201b0254a761" title="8 bit unsigned variable.">u8</a>)<a class="code" href="classirr_1_1video_1_1_s_color.html#af10d2deaccbde5c958032ed9ec81b59f" title="Returns the red component of the color.">getRed</a>();
423<a name="l00429"></a>00429 dest[1] = (<a class="code" href="namespaceirr.html#a646874f69af8ff87fc10201b0254a761" title="8 bit unsigned variable.">u8</a>)<a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d" title="Returns the green component of the color.">getGreen</a>();
424<a name="l00430"></a>00430 dest[2] = (<a class="code" href="namespaceirr.html#a646874f69af8ff87fc10201b0254a761" title="8 bit unsigned variable.">u8</a>)<a class="code" href="classirr_1_1video_1_1_s_color.html#a26fdbde73081b35a1686f8d21a549544" title="Returns the blue component of the color.">getBlue</a>();
425<a name="l00431"></a>00431 }
426<a name="l00432"></a>00432 <span class="keywordflow">break</span>;
427<a name="l00433"></a>00433
428<a name="l00434"></a>00434 <span class="keywordflow">case</span> <a class="code" href="namespaceirr_1_1video.html#a1d5e487888c32b1674a8f75116d829eda55c57d63efff39efe33ee733fe962df0" title="Default 32 bit color format. 8 bits are used for every component: red, green, blue and alpha...">ECF_A8R8G8B8</a>:
429<a name="l00435"></a>00435 {
430<a name="l00436"></a>00436 <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> * dest = (<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a>*)data;
431<a name="l00437"></a>00437 *dest = <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a>;
432<a name="l00438"></a>00438 }
433<a name="l00439"></a>00439 <span class="keywordflow">break</span>;
434<a name="l00440"></a>00440
435<a name="l00441"></a>00441 <span class="keywordflow">default</span>:
436<a name="l00442"></a>00442 <span class="keywordflow">break</span>;
437<a name="l00443"></a>00443 }
438<a name="l00444"></a>00444 }
439<a name="l00445"></a>00445
440<a name="l00447"></a><a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf">00447</a> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="classirr_1_1video_1_1_s_color.html#a11f2b41eeff9e7f688d322735ca2cfcf" title="color in A8R8G8B8 Format">color</a>;
441<a name="l00448"></a>00448 };
442<a name="l00449"></a>00449
443<a name="l00450"></a>00450
444<a name="l00452"></a>00452
445<a name="l00458"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html">00458</a> <span class="keyword">class </span><a class="code" href="classirr_1_1video_1_1_s_colorf.html" title="Class representing a color with four floats.">SColorf</a>
446<a name="l00459"></a>00459 {
447<a name="l00460"></a>00460 <span class="keyword">public</span>:
448<a name="l00462"></a>00462
449<a name="l00463"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#a701ea1b449c2aae4a3dd44a13055ac3e">00463</a> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a701ea1b449c2aae4a3dd44a13055ac3e" title="Default constructor for SColorf.">SColorf</a>() : <a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaabdd1e2ef53f24e9dec70d5d531e425" title="red color component">r</a>(0.0f), <a class="code" href="classirr_1_1video_1_1_s_colorf.html#abcb076ccba5f994d6dca52aed397d59a" title="green color component">g</a>(0.0f), <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a82d235f32be8c4a5a07acb45abde726e" title="blue component">b</a>(0.0f), <a class="code" href="classirr_1_1video_1_1_s_colorf.html#add63387fd1fd80d09500b85ae679b050" title="alpha color component">a</a>(1.0f) {}
450<a name="l00464"></a>00464
451<a name="l00466"></a>00466
452<a name="l00476"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#adaf8df839d5174aedba17e61ba28fc64">00476</a> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#adaf8df839d5174aedba17e61ba28fc64" title="Constructs a color from up to four color values: red, green, blue, and alpha.">SColorf</a>(<a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaabdd1e2ef53f24e9dec70d5d531e425" title="red color component">r</a>, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#abcb076ccba5f994d6dca52aed397d59a" title="green color component">g</a>, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a82d235f32be8c4a5a07acb45abde726e" title="blue component">b</a>, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#add63387fd1fd80d09500b85ae679b050" title="alpha color component">a</a> = 1.0f) : r(r), g(g), b(b), <a class="code" href="classirr_1_1video_1_1_s_colorf.html#add63387fd1fd80d09500b85ae679b050" title="alpha color component">a</a>(<a class="code" href="classirr_1_1video_1_1_s_colorf.html#add63387fd1fd80d09500b85ae679b050" title="alpha color component">a</a>) {}
453<a name="l00477"></a>00477
454<a name="l00479"></a>00479
455<a name="l00481"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#a78bdda49d8605203acc99854cc9722b7">00481</a> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a701ea1b449c2aae4a3dd44a13055ac3e" title="Default constructor for SColorf.">SColorf</a>(<a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">SColor</a> c)
456<a name="l00482"></a>00482 {
457<a name="l00483"></a>00483 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> inv = 1.0f / 255.0f;
458<a name="l00484"></a>00484 <a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaabdd1e2ef53f24e9dec70d5d531e425" title="red color component">r</a> = c.<a class="code" href="classirr_1_1video_1_1_s_color.html#af10d2deaccbde5c958032ed9ec81b59f" title="Returns the red component of the color.">getRed</a>() * inv;
459<a name="l00485"></a>00485 <a class="code" href="classirr_1_1video_1_1_s_colorf.html#abcb076ccba5f994d6dca52aed397d59a" title="green color component">g</a> = c.<a class="code" href="classirr_1_1video_1_1_s_color.html#ad604ba81e061b0bfe2ccb5f16e29124d" title="Returns the green component of the color.">getGreen</a>() * inv;
460<a name="l00486"></a>00486 <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a82d235f32be8c4a5a07acb45abde726e" title="blue component">b</a> = c.<a class="code" href="classirr_1_1video_1_1_s_color.html#a26fdbde73081b35a1686f8d21a549544" title="Returns the blue component of the color.">getBlue</a>() * inv;
461<a name="l00487"></a>00487 <a class="code" href="classirr_1_1video_1_1_s_colorf.html#add63387fd1fd80d09500b85ae679b050" title="alpha color component">a</a> = c.<a class="code" href="classirr_1_1video_1_1_s_color.html#a9647d09a9d4b9c6fb48a8fa1f2da425c" title="Returns the alpha component of the color.">getAlpha</a>() * inv;
462<a name="l00488"></a>00488 }
463<a name="l00489"></a>00489
464<a name="l00491"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#a72ce02a50bf17d5a0017caa4cdddd4a1">00491</a> <a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">SColor</a> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a72ce02a50bf17d5a0017caa4cdddd4a1" title="Converts this color to a SColor without floats.">toSColor</a>()<span class="keyword"> const</span>
465<a name="l00492"></a>00492 <span class="keyword"> </span>{
466<a name="l00493"></a>00493 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">SColor</a>((<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a>)<a class="code" href="namespaceirr_1_1core.html#ae46f57f03e9033c57c180fbe83b04cf2">core::round32</a>(<a class="code" href="classirr_1_1video_1_1_s_colorf.html#add63387fd1fd80d09500b85ae679b050" title="alpha color component">a</a>*255.0f), (<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a>)<a class="code" href="namespaceirr_1_1core.html#ae46f57f03e9033c57c180fbe83b04cf2">core::round32</a>(<a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaabdd1e2ef53f24e9dec70d5d531e425" title="red color component">r</a>*255.0f), (<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a>)<a class="code" href="namespaceirr_1_1core.html#ae46f57f03e9033c57c180fbe83b04cf2">core::round32</a>(<a class="code" href="classirr_1_1video_1_1_s_colorf.html#abcb076ccba5f994d6dca52aed397d59a" title="green color component">g</a>*255.0f), (<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a>)<a class="code" href="namespaceirr_1_1core.html#ae46f57f03e9033c57c180fbe83b04cf2">core::round32</a>(<a class="code" href="classirr_1_1video_1_1_s_colorf.html#a82d235f32be8c4a5a07acb45abde726e" title="blue component">b</a>*255.0f));
467<a name="l00494"></a>00494 }
468<a name="l00495"></a>00495
469<a name="l00497"></a>00497
470<a name="l00503"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#a99fe5c7d261d288d9afe301d4b90d41c">00503</a> <span class="keywordtype">void</span> <span class="keyword">set</span>(<a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> rr, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> gg, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> bb) {<a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaabdd1e2ef53f24e9dec70d5d531e425" title="red color component">r</a> = rr; <a class="code" href="classirr_1_1video_1_1_s_colorf.html#abcb076ccba5f994d6dca52aed397d59a" title="green color component">g</a> =gg; <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a82d235f32be8c4a5a07acb45abde726e" title="blue component">b</a> = bb; }
471<a name="l00504"></a>00504
472<a name="l00506"></a>00506
473<a name="l00514"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#ae5a082e95ff2631651356f8a6daa2e73">00514</a> <span class="keywordtype">void</span> <span class="keyword">set</span>(<a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> aa, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> rr, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> gg, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> bb) {<a class="code" href="classirr_1_1video_1_1_s_colorf.html#add63387fd1fd80d09500b85ae679b050" title="alpha color component">a</a> = aa; <a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaabdd1e2ef53f24e9dec70d5d531e425" title="red color component">r</a> = rr; <a class="code" href="classirr_1_1video_1_1_s_colorf.html#abcb076ccba5f994d6dca52aed397d59a" title="green color component">g</a> =gg; <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a82d235f32be8c4a5a07acb45abde726e" title="blue component">b</a> = bb; }
474<a name="l00515"></a>00515
475<a name="l00517"></a>00517
476<a name="l00520"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#a7167069deeacd120985dedfc578e98f3">00520</a> <a class="code" href="classirr_1_1video_1_1_s_colorf.html" title="Class representing a color with four floats.">SColorf</a> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a7167069deeacd120985dedfc578e98f3" title="Interpolates the color with a f32 value to another color.">getInterpolated</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1video_1_1_s_colorf.html" title="Class representing a color with four floats.">SColorf</a> &amp;other, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> d)<span class="keyword"> const</span>
477<a name="l00521"></a>00521 <span class="keyword"> </span>{
478<a name="l00522"></a>00522 d = <a class="code" href="namespaceirr_1_1core.html#a6162f685b68f629e77336081d3316969" title="clamps a value between low and high">core::clamp</a>(d, 0.f, 1.f);
479<a name="l00523"></a>00523 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> inv = 1.0f - d;
480<a name="l00524"></a>00524 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a701ea1b449c2aae4a3dd44a13055ac3e" title="Default constructor for SColorf.">SColorf</a>(other.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaabdd1e2ef53f24e9dec70d5d531e425" title="red color component">r</a>*inv + <a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaabdd1e2ef53f24e9dec70d5d531e425" title="red color component">r</a>*d,
481<a name="l00525"></a>00525 other.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#abcb076ccba5f994d6dca52aed397d59a" title="green color component">g</a>*inv + <a class="code" href="classirr_1_1video_1_1_s_colorf.html#abcb076ccba5f994d6dca52aed397d59a" title="green color component">g</a>*d, other.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#a82d235f32be8c4a5a07acb45abde726e" title="blue component">b</a>*inv + <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a82d235f32be8c4a5a07acb45abde726e" title="blue component">b</a>*d, other.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#add63387fd1fd80d09500b85ae679b050" title="alpha color component">a</a>*inv + <a class="code" href="classirr_1_1video_1_1_s_colorf.html#add63387fd1fd80d09500b85ae679b050" title="alpha color component">a</a>*d);
482<a name="l00526"></a>00526 }
483<a name="l00527"></a>00527
484<a name="l00529"></a>00529
485<a name="l00532"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaba8f592ab29c706a57ef4fdeccf362a">00532</a> <span class="keyword">inline</span> <a class="code" href="classirr_1_1video_1_1_s_colorf.html" title="Class representing a color with four floats.">SColorf</a> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaba8f592ab29c706a57ef4fdeccf362a" title="Returns interpolated color. ( quadratic )">getInterpolated_quadratic</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1video_1_1_s_colorf.html" title="Class representing a color with four floats.">SColorf</a>&amp; c1, <span class="keyword">const</span> <a class="code" href="classirr_1_1video_1_1_s_colorf.html" title="Class representing a color with four floats.">SColorf</a>&amp; c2,
486<a name="l00533"></a>00533 <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> d)<span class="keyword"> const</span>
487<a name="l00534"></a>00534 <span class="keyword"> </span>{
488<a name="l00535"></a>00535 d = <a class="code" href="namespaceirr_1_1core.html#a6162f685b68f629e77336081d3316969" title="clamps a value between low and high">core::clamp</a>(d, 0.f, 1.f);
489<a name="l00536"></a>00536 <span class="comment">// this*(1-d)*(1-d) + 2 * c1 * (1-d) + c2 * d * d;</span>
490<a name="l00537"></a>00537 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> inv = 1.f - d;
491<a name="l00538"></a>00538 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> mul0 = inv * inv;
492<a name="l00539"></a>00539 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> mul1 = 2.f * d * inv;
493<a name="l00540"></a>00540 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> mul2 = d * d;
494<a name="l00541"></a>00541
495<a name="l00542"></a>00542 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a701ea1b449c2aae4a3dd44a13055ac3e" title="Default constructor for SColorf.">SColorf</a> (<a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaabdd1e2ef53f24e9dec70d5d531e425" title="red color component">r</a> * mul0 + c1.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaabdd1e2ef53f24e9dec70d5d531e425" title="red color component">r</a> * mul1 + c2.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaabdd1e2ef53f24e9dec70d5d531e425" title="red color component">r</a> * mul2,
496<a name="l00543"></a>00543 <a class="code" href="classirr_1_1video_1_1_s_colorf.html#abcb076ccba5f994d6dca52aed397d59a" title="green color component">g</a> * mul0 + c1.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#abcb076ccba5f994d6dca52aed397d59a" title="green color component">g</a> * mul1 + c2.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#abcb076ccba5f994d6dca52aed397d59a" title="green color component">g</a> * mul2,
497<a name="l00544"></a>00544 <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a82d235f32be8c4a5a07acb45abde726e" title="blue component">b</a> * mul0 + c1.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#a82d235f32be8c4a5a07acb45abde726e" title="blue component">b</a> * mul1 + c2.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#a82d235f32be8c4a5a07acb45abde726e" title="blue component">b</a> * mul2,
498<a name="l00545"></a>00545 <a class="code" href="classirr_1_1video_1_1_s_colorf.html#add63387fd1fd80d09500b85ae679b050" title="alpha color component">a</a> * mul0 + c1.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#add63387fd1fd80d09500b85ae679b050" title="alpha color component">a</a> * mul1 + c2.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#add63387fd1fd80d09500b85ae679b050" title="alpha color component">a</a> * mul2);
499<a name="l00546"></a>00546 }
500<a name="l00547"></a>00547
501<a name="l00548"></a>00548
502<a name="l00550"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#a79c420ed7052d68d3827f455881535af">00550</a> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a79c420ed7052d68d3827f455881535af" title="Sets a color component by index. R=0, G=1, B=2, A=3.">setColorComponentValue</a>(<a class="code" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> index, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> value)
503<a name="l00551"></a>00551 {
504<a name="l00552"></a>00552 <span class="keywordflow">switch</span>(index)
505<a name="l00553"></a>00553 {
506<a name="l00554"></a>00554 <span class="keywordflow">case</span> 0: <a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaabdd1e2ef53f24e9dec70d5d531e425" title="red color component">r</a> = value; <span class="keywordflow">break</span>;
507<a name="l00555"></a>00555 <span class="keywordflow">case</span> 1: <a class="code" href="classirr_1_1video_1_1_s_colorf.html#abcb076ccba5f994d6dca52aed397d59a" title="green color component">g</a> = value; <span class="keywordflow">break</span>;
508<a name="l00556"></a>00556 <span class="keywordflow">case</span> 2: <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a82d235f32be8c4a5a07acb45abde726e" title="blue component">b</a> = value; <span class="keywordflow">break</span>;
509<a name="l00557"></a>00557 <span class="keywordflow">case</span> 3: <a class="code" href="classirr_1_1video_1_1_s_colorf.html#add63387fd1fd80d09500b85ae679b050" title="alpha color component">a</a> = value; <span class="keywordflow">break</span>;
510<a name="l00558"></a>00558 }
511<a name="l00559"></a>00559 }
512<a name="l00560"></a>00560
513<a name="l00562"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#a01e38f4fee055d085530baac54dacb67">00562</a> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a01e38f4fee055d085530baac54dacb67" title="Returns the alpha component of the color in the range 0.0 (transparent) to 1.0 (opaque)">getAlpha</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#add63387fd1fd80d09500b85ae679b050" title="alpha color component">a</a>; }
514<a name="l00563"></a>00563
515<a name="l00565"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#abf88944ab00a08054cecaefe65e6d485">00565</a> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#abf88944ab00a08054cecaefe65e6d485" title="Returns the red component of the color in the range 0.0 to 1.0.">getRed</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaabdd1e2ef53f24e9dec70d5d531e425" title="red color component">r</a>; }
516<a name="l00566"></a>00566
517<a name="l00568"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#a9b12565067e4606afe7dcdf3c34c232d">00568</a> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a9b12565067e4606afe7dcdf3c34c232d" title="Returns the green component of the color in the range 0.0 to 1.0.">getGreen</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#abcb076ccba5f994d6dca52aed397d59a" title="green color component">g</a>; }
518<a name="l00569"></a>00569
519<a name="l00571"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#ad4c669bb1966d58ec9b5eb6b564531c0">00571</a> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#ad4c669bb1966d58ec9b5eb6b564531c0" title="Returns the blue component of the color in the range 0.0 to 1.0.">getBlue</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a82d235f32be8c4a5a07acb45abde726e" title="blue component">b</a>; }
520<a name="l00572"></a>00572
521<a name="l00574"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaabdd1e2ef53f24e9dec70d5d531e425">00574</a> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#aaabdd1e2ef53f24e9dec70d5d531e425" title="red color component">r</a>;
522<a name="l00575"></a>00575
523<a name="l00577"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#abcb076ccba5f994d6dca52aed397d59a">00577</a> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#abcb076ccba5f994d6dca52aed397d59a" title="green color component">g</a>;
524<a name="l00578"></a>00578
525<a name="l00580"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#a82d235f32be8c4a5a07acb45abde726e">00580</a> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#a82d235f32be8c4a5a07acb45abde726e" title="blue component">b</a>;
526<a name="l00581"></a>00581
527<a name="l00583"></a><a class="code" href="classirr_1_1video_1_1_s_colorf.html#add63387fd1fd80d09500b85ae679b050">00583</a> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="classirr_1_1video_1_1_s_colorf.html#add63387fd1fd80d09500b85ae679b050" title="alpha color component">a</a>;
528<a name="l00584"></a>00584 };
529<a name="l00585"></a>00585
530<a name="l00586"></a>00586
531<a name="l00588"></a>00588
532<a name="l00592"></a><a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html">00592</a> <span class="keyword">class </span><a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html" title="Class representing a color in HSL format.">SColorHSL</a>
533<a name="l00593"></a>00593 {
534<a name="l00594"></a>00594 <span class="keyword">public</span>:
535<a name="l00595"></a><a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#ad75a96f226bcbb38a2237fb7be22f537">00595</a> <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#ad75a96f226bcbb38a2237fb7be22f537">SColorHSL</a> ( <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> h = 0.f, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> s = 0.f, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> l = 0.f )
536<a name="l00596"></a>00596 : <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a76d317e46d5a30982ed3da58401d319f">Hue</a> ( h ), <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a61a3b30e3a7724ec9d091001e411987e">Saturation</a> ( s ), <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#acc584a689cf0e4a312c07d58f2a9f2b4">Luminance</a> ( l ) {}
537<a name="l00597"></a>00597
538<a name="l00598"></a>00598 <span class="keywordtype">void</span> <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#ac5806ad1f238083ac59d6f3d21673e94">fromRGB</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1video_1_1_s_colorf.html" title="Class representing a color with four floats.">SColorf</a> &amp;color);
539<a name="l00599"></a>00599 <span class="keywordtype">void</span> <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#ad0dc9336487c0912d4d72ba3b803f6c6">toRGB</a>(<a class="code" href="classirr_1_1video_1_1_s_colorf.html" title="Class representing a color with four floats.">SColorf</a> &amp;color) <span class="keyword">const</span>;
540<a name="l00600"></a>00600
541<a name="l00601"></a><a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a76d317e46d5a30982ed3da58401d319f">00601</a> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a76d317e46d5a30982ed3da58401d319f">Hue</a>;
542<a name="l00602"></a><a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a61a3b30e3a7724ec9d091001e411987e">00602</a> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a61a3b30e3a7724ec9d091001e411987e">Saturation</a>;
543<a name="l00603"></a><a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#acc584a689cf0e4a312c07d58f2a9f2b4">00603</a> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#acc584a689cf0e4a312c07d58f2a9f2b4">Luminance</a>;
544<a name="l00604"></a>00604
545<a name="l00605"></a>00605 <span class="keyword">private</span>:
546<a name="l00606"></a>00606 <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> toRGB1(<a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> rm1, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> rm2, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> rh) <span class="keyword">const</span>;
547<a name="l00607"></a>00607
548<a name="l00608"></a>00608 };
549<a name="l00609"></a>00609
550<a name="l00610"></a><a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#ac5806ad1f238083ac59d6f3d21673e94">00610</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#ac5806ad1f238083ac59d6f3d21673e94">SColorHSL::fromRGB</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1video_1_1_s_colorf.html" title="Class representing a color with four floats.">SColorf</a> &amp;color)
551<a name="l00611"></a>00611 {
552<a name="l00612"></a>00612 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> maxVal = <a class="code" href="namespaceirr_1_1core.html#afca1ce7ac54e0c31a9047947f4c7319b" title="returns maximum of two values. Own implementation to get rid of the STL (VS6 problems)">core::max_</a>(color.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#abf88944ab00a08054cecaefe65e6d485" title="Returns the red component of the color in the range 0.0 to 1.0.">getRed</a>(), color.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#a9b12565067e4606afe7dcdf3c34c232d" title="Returns the green component of the color in the range 0.0 to 1.0.">getGreen</a>(), color.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#ad4c669bb1966d58ec9b5eb6b564531c0" title="Returns the blue component of the color in the range 0.0 to 1.0.">getBlue</a>());
553<a name="l00613"></a>00613 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> minVal = (<a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a>)<a class="code" href="namespaceirr_1_1core.html#a9d34bfdbbe9c136b01ae04974572bc11" title="returns minimum of two values. Own implementation to get rid of the STL (VS6 problems)">core::min_</a>(color.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#abf88944ab00a08054cecaefe65e6d485" title="Returns the red component of the color in the range 0.0 to 1.0.">getRed</a>(), color.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#a9b12565067e4606afe7dcdf3c34c232d" title="Returns the green component of the color in the range 0.0 to 1.0.">getGreen</a>(), color.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#ad4c669bb1966d58ec9b5eb6b564531c0" title="Returns the blue component of the color in the range 0.0 to 1.0.">getBlue</a>());
554<a name="l00614"></a>00614 <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#acc584a689cf0e4a312c07d58f2a9f2b4">Luminance</a> = (maxVal+minVal)*50;
555<a name="l00615"></a>00615 <span class="keywordflow">if</span> (<a class="code" href="namespaceirr_1_1core.html#abf9b9b140cc365908ea4c8c47451e4e3" title="returns if a equals b, taking possible rounding errors into account">core::equals</a>(maxVal, minVal))
556<a name="l00616"></a>00616 {
557<a name="l00617"></a>00617 <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a76d317e46d5a30982ed3da58401d319f">Hue</a>=0.f;
558<a name="l00618"></a>00618 <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a61a3b30e3a7724ec9d091001e411987e">Saturation</a>=0.f;
559<a name="l00619"></a>00619 <span class="keywordflow">return</span>;
560<a name="l00620"></a>00620 }
561<a name="l00621"></a>00621
562<a name="l00622"></a>00622 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> delta = maxVal-minVal;
563<a name="l00623"></a>00623 <span class="keywordflow">if</span> ( <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#acc584a689cf0e4a312c07d58f2a9f2b4">Luminance</a> &lt;= 50 )
564<a name="l00624"></a>00624 {
565<a name="l00625"></a>00625 <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a61a3b30e3a7724ec9d091001e411987e">Saturation</a> = (delta)/(maxVal+minVal);
566<a name="l00626"></a>00626 }
567<a name="l00627"></a>00627 <span class="keywordflow">else</span>
568<a name="l00628"></a>00628 {
569<a name="l00629"></a>00629 <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a61a3b30e3a7724ec9d091001e411987e">Saturation</a> = (delta)/(2-maxVal-minVal);
570<a name="l00630"></a>00630 }
571<a name="l00631"></a>00631 <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a61a3b30e3a7724ec9d091001e411987e">Saturation</a> *= 100;
572<a name="l00632"></a>00632
573<a name="l00633"></a>00633 <span class="keywordflow">if</span> (<a class="code" href="namespaceirr_1_1core.html#abf9b9b140cc365908ea4c8c47451e4e3" title="returns if a equals b, taking possible rounding errors into account">core::equals</a>(maxVal, color.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#abf88944ab00a08054cecaefe65e6d485" title="Returns the red component of the color in the range 0.0 to 1.0.">getRed</a>()))
574<a name="l00634"></a>00634 <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a76d317e46d5a30982ed3da58401d319f">Hue</a> = (color.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#a9b12565067e4606afe7dcdf3c34c232d" title="Returns the green component of the color in the range 0.0 to 1.0.">getGreen</a>()-color.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#ad4c669bb1966d58ec9b5eb6b564531c0" title="Returns the blue component of the color in the range 0.0 to 1.0.">getBlue</a>())/delta;
575<a name="l00635"></a>00635 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="namespaceirr_1_1core.html#abf9b9b140cc365908ea4c8c47451e4e3" title="returns if a equals b, taking possible rounding errors into account">core::equals</a>(maxVal, color.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#a9b12565067e4606afe7dcdf3c34c232d" title="Returns the green component of the color in the range 0.0 to 1.0.">getGreen</a>()))
576<a name="l00636"></a>00636 <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a76d317e46d5a30982ed3da58401d319f">Hue</a> = 2+((color.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#ad4c669bb1966d58ec9b5eb6b564531c0" title="Returns the blue component of the color in the range 0.0 to 1.0.">getBlue</a>()-color.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#abf88944ab00a08054cecaefe65e6d485" title="Returns the red component of the color in the range 0.0 to 1.0.">getRed</a>())/delta);
577<a name="l00637"></a>00637 <span class="keywordflow">else</span> <span class="comment">// blue is max</span>
578<a name="l00638"></a>00638 <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a76d317e46d5a30982ed3da58401d319f">Hue</a> = 4+((color.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#abf88944ab00a08054cecaefe65e6d485" title="Returns the red component of the color in the range 0.0 to 1.0.">getRed</a>()-color.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#a9b12565067e4606afe7dcdf3c34c232d" title="Returns the green component of the color in the range 0.0 to 1.0.">getGreen</a>())/delta);
579<a name="l00639"></a>00639
580<a name="l00640"></a>00640 <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a76d317e46d5a30982ed3da58401d319f">Hue</a> *= 60.0f;
581<a name="l00641"></a>00641 <span class="keywordflow">while</span> ( <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a76d317e46d5a30982ed3da58401d319f">Hue</a> &lt; 0.f )
582<a name="l00642"></a>00642 <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a76d317e46d5a30982ed3da58401d319f">Hue</a> += 360;
583<a name="l00643"></a>00643 }
584<a name="l00644"></a>00644
585<a name="l00645"></a>00645
586<a name="l00646"></a><a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#ad0dc9336487c0912d4d72ba3b803f6c6">00646</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#ad0dc9336487c0912d4d72ba3b803f6c6">SColorHSL::toRGB</a>(<a class="code" href="classirr_1_1video_1_1_s_colorf.html" title="Class representing a color with four floats.">SColorf</a> &amp;color)<span class="keyword"> const</span>
587<a name="l00647"></a>00647 <span class="keyword"> </span>{
588<a name="l00648"></a>00648 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> l = <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#acc584a689cf0e4a312c07d58f2a9f2b4">Luminance</a>/100;
589<a name="l00649"></a>00649 <span class="keywordflow">if</span> (<a class="code" href="namespaceirr_1_1core.html#afc24e6ba26469ec7ca7001ed272dc3b2" title="returns if a equals zero, taking rounding errors into account">core::iszero</a>(<a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a61a3b30e3a7724ec9d091001e411987e">Saturation</a>)) <span class="comment">// grey</span>
590<a name="l00650"></a>00650 {
591<a name="l00651"></a>00651 color.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#a99fe5c7d261d288d9afe301d4b90d41c" title="Sets three color components to new values at once.">set</a>(l, l, l);
592<a name="l00652"></a>00652 <span class="keywordflow">return</span>;
593<a name="l00653"></a>00653 }
594<a name="l00654"></a>00654
595<a name="l00655"></a>00655 <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> rm2;
596<a name="l00656"></a>00656
597<a name="l00657"></a>00657 <span class="keywordflow">if</span> ( <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#acc584a689cf0e4a312c07d58f2a9f2b4">Luminance</a> &lt;= 50 )
598<a name="l00658"></a>00658 {
599<a name="l00659"></a>00659 rm2 = l + l * (<a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a61a3b30e3a7724ec9d091001e411987e">Saturation</a>/100);
600<a name="l00660"></a>00660 }
601<a name="l00661"></a>00661 <span class="keywordflow">else</span>
602<a name="l00662"></a>00662 {
603<a name="l00663"></a>00663 rm2 = l + (1 - l) * (<a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a61a3b30e3a7724ec9d091001e411987e">Saturation</a>/100);
604<a name="l00664"></a>00664 }
605<a name="l00665"></a>00665
606<a name="l00666"></a>00666 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> rm1 = 2.0f * l - rm2;
607<a name="l00667"></a>00667
608<a name="l00668"></a>00668 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> h = <a class="code" href="classirr_1_1video_1_1_s_color_h_s_l.html#a76d317e46d5a30982ed3da58401d319f">Hue</a> / 360.0f;
609<a name="l00669"></a>00669 color.<a class="code" href="classirr_1_1video_1_1_s_colorf.html#a99fe5c7d261d288d9afe301d4b90d41c" title="Sets three color components to new values at once.">set</a>( toRGB1(rm1, rm2, h + 1.f/3.f),
610<a name="l00670"></a>00670 toRGB1(rm1, rm2, h),
611<a name="l00671"></a>00671 toRGB1(rm1, rm2, h - 1.f/3.f)
612<a name="l00672"></a>00672 );
613<a name="l00673"></a>00673 }
614<a name="l00674"></a>00674
615<a name="l00675"></a>00675
616<a name="l00676"></a>00676 <span class="comment">// algorithm from Foley/Van-Dam</span>
617<a name="l00677"></a>00677 <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> SColorHSL::toRGB1(<a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> rm1, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> rm2, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> rh)<span class="keyword"> const</span>
618<a name="l00678"></a>00678 <span class="keyword"> </span>{
619<a name="l00679"></a>00679 <span class="keywordflow">if</span> (rh&lt;0)
620<a name="l00680"></a>00680 rh += 1;
621<a name="l00681"></a>00681 <span class="keywordflow">if</span> (rh&gt;1)
622<a name="l00682"></a>00682 rh -= 1;
623<a name="l00683"></a>00683
624<a name="l00684"></a>00684 <span class="keywordflow">if</span> (rh &lt; 1.f/6.f)
625<a name="l00685"></a>00685 rm1 = rm1 + (rm2 - rm1) * rh*6.f;
626<a name="l00686"></a>00686 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (rh &lt; 0.5f)
627<a name="l00687"></a>00687 rm1 = rm2;
628<a name="l00688"></a>00688 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (rh &lt; 2.f/3.f)
629<a name="l00689"></a>00689 rm1 = rm1 + (rm2 - rm1) * ((2.f/3.f)-rh)*6.f;
630<a name="l00690"></a>00690
631<a name="l00691"></a>00691 <span class="keywordflow">return</span> rm1;
632<a name="l00692"></a>00692 }
633<a name="l00693"></a>00693
634<a name="l00694"></a>00694 } <span class="comment">// end namespace video</span>
635<a name="l00695"></a>00695 } <span class="comment">// end namespace irr</span>
636<a name="l00696"></a>00696
637<a name="l00697"></a>00697 <span class="preprocessor">#endif</span>
638</pre></div></div>
639</div>
640 <div id="nav-path" class="navpath">
641 <ul>
642 <li class="navelem"><a class="el" href="_s_color_8h.html">SColor.h</a> </li>
643<!-- window showing the filter options -->
644<div id="MSearchSelectWindow"
645 onmouseover="return searchBox.OnSearchSelectShow()"
646 onmouseout="return searchBox.OnSearchSelectHide()"
647 onkeydown="return searchBox.OnSearchSelectKey(event)">
648<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Defines</a></div>
649
650<!-- iframe showing the search results (closed by default) -->
651<div id="MSearchResultsWindow">
652<iframe src="javascript:void(0)" frameborder="0"
653 name="MSearchResults" id="MSearchResults">
654</iframe>
655</div>
656
657
658 <li class="footer">
659<a href="http://irrlicht.sourceforge.net" target="_blank">Irrlicht
660Engine</a> Documentation &copy; 2003-2012 by Nikolaus Gebhardt. Generated on Sun Nov 17 2013 20:18:40 for Irrlicht 3D Engine by
661<a href="http://www.doxygen.org/index.html" target="_blank">Doxygen</a> 1.7.5.1 </li>
662 </ul>
663 </div>
664
665
666</body>
667</html>