1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
---|
2 | <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> |
---|
3 | <title>FCollada: FMath/FMColor.h Source File</title> |
---|
4 | <link href="doxygen.css" rel="stylesheet" type="text/css"> |
---|
5 | <link href="tabs.css" rel="stylesheet" type="text/css"> |
---|
6 | </head><body> |
---|
7 | <!-- Generated by Doxygen 1.4.6-NO --> |
---|
8 | <div class="tabs"> |
---|
9 | <ul> |
---|
10 | <li><a href="index.html"><span>Main Page</span></a></li> |
---|
11 | <li><a href="modules.html"><span>Modules</span></a></li> |
---|
12 | <li><a href="namespaces.html"><span>Namespaces</span></a></li> |
---|
13 | <li><a href="classes.html"><span>Classes</span></a></li> |
---|
14 | <li id="current"><a href="files.html"><span>Files</span></a></li> |
---|
15 | <li><a href="pages.html"><span>Related Pages</span></a></li> |
---|
16 | </ul></div> |
---|
17 | <div class="tabs"> |
---|
18 | <ul> |
---|
19 | <li><a href="files.html"><span>File List</span></a></li> |
---|
20 | <li><a href="globals.html"><span>File Members</span></a></li> |
---|
21 | </ul></div> |
---|
22 | <h1>FMath/FMColor.h</h1><a href="_f_m_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">/*</span> |
---|
23 | <a name="l00002"></a>00002 <span class="comment"> Copyright (C) 2005-2006 Feeling Software Inc.</span> |
---|
24 | <a name="l00003"></a>00003 <span class="comment"> MIT License: http://www.opensource.org/licenses/mit-license.php</span> |
---|
25 | <a name="l00004"></a>00004 <span class="comment">*/</span> |
---|
26 | <a name="l00005"></a>00005 |
---|
27 | <a name="l00011"></a>00011 <span class="preprocessor">#ifndef _FM_COLOR_H_</span> |
---|
28 | <a name="l00012"></a>00012 <span class="preprocessor"></span><span class="preprocessor">#define _FM_COLOR_H_</span> |
---|
29 | <a name="l00013"></a>00013 <span class="preprocessor"></span> |
---|
30 | <a name="l00020"></a><a class="code" href="class_f_m_color.html">00020</a> <span class="keyword">class </span>FCOLLADA_EXPORT <a class="code" href="class_f_m_color.html">FMColor</a> |
---|
31 | <a name="l00021"></a>00021 { |
---|
32 | <a name="l00022"></a>00022 <span class="keyword">public</span>: |
---|
33 | <a name="l00023"></a><a class="code" href="class_f_m_color.html#36789d346608eb0c778d58204ea1f406">00023</a> uint8 r; |
---|
34 | <a name="l00024"></a><a class="code" href="class_f_m_color.html#0868b26c7d46f6fd5fb753e63010c377">00024</a> uint8 g; |
---|
35 | <a name="l00025"></a><a class="code" href="class_f_m_color.html#ba4a975fc1d71d6f0065cf67f90d3c45">00025</a> uint8 b; |
---|
36 | <a name="l00026"></a><a class="code" href="class_f_m_color.html#42355f56b082b874c5580a9b4625be7c">00026</a> uint8 a; |
---|
37 | <a name="l00033"></a><a class="code" href="class_f_m_color.html#9acb710671c50f603c90e06ec2ed86b8">00033</a> <a class="code" href="class_f_m_color.html">FMColor</a>() {} |
---|
38 | <a name="l00034"></a>00034 |
---|
39 | <a name="l00048"></a><a class="code" href="class_f_m_color.html#acadee74c5d62bb4329d4c737991e0e0">00048</a> <a class="code" href="class_f_m_color.html">FMColor</a>(uint8 _r, uint8 _g, uint8 _b, uint8 _a) { r = _r; g = _g; b = _b; a = _a; } |
---|
40 | <a name="l00049"></a>00049 |
---|
41 | <a name="l00059"></a><a class="code" href="class_f_m_color.html#ed846f140eef6e7379d2a4d7e11e0ce3">00059</a> <a class="code" href="class_f_m_color.html">FMColor</a>(uint32 hex) { r = uint8((hex & 0xFF000000) >> 24); g = uint8((hex & 0xFF0000) >> 16); b = uint8((hex & 0xFF00) >> 8); a = uint8(hex & 0xFF); } |
---|
42 | <a name="l00060"></a>00060 |
---|
43 | <a name="l00076"></a>00076 <a class="code" href="class_f_m_color.html">FMColor</a>(<span class="keyword">const</span> <span class="keywordtype">float</span>* components, uint32 componentCount); |
---|
44 | <a name="l00077"></a>00077 |
---|
45 | <a name="l00087"></a>00087 <span class="keywordtype">void</span> ToFloats(<span class="keywordtype">float</span>* components, uint32 componentCount); |
---|
46 | <a name="l00088"></a>00088 |
---|
47 | <a name="l00094"></a><a class="code" href="class_f_m_color.html#911f0f47225a8c9c89246dd01280f789">00094</a> <span class="keyword">inline</span> uint8 ComponentAverage() { <span class="keywordflow">return</span> uint8((uint32(r) + uint32(g) + uint32(b)) / 3); } |
---|
48 | <a name="l00095"></a>00095 |
---|
49 | <a name="l00101"></a><a class="code" href="class_f_m_color.html#4cbe7fa247d38162d700fabe70240b0a">00101</a> operator uint8*() { <span class="keywordflow">return</span> &b; } |
---|
50 | <a name="l00102"></a>00102 }; |
---|
51 | <a name="l00103"></a>00103 |
---|
52 | <a name="l00111"></a><a class="code" href="_f_m_color_8h.html#58f3a16b2bf52b6aab8c7143d202a02a">00111</a> <span class="keyword">inline</span> <a class="code" href="class_f_m_color.html">FMColor</a> <a class="code" href="_f_m_color_8h.html#58f3a16b2bf52b6aab8c7143d202a02a">operator*</a>(<span class="keywordtype">float</span> s, <span class="keyword">const</span> <a class="code" href="class_f_m_color.html">FMColor</a>& c) { <span class="keywordflow">return</span> <a class="code" href="class_f_m_color.html">FMColor</a>(uint8(c.<a class="code" href="class_f_m_color.html#36789d346608eb0c778d58204ea1f406">r</a> * s), uint8(c.<a class="code" href="class_f_m_color.html#0868b26c7d46f6fd5fb753e63010c377">g</a> * s), uint8(c.<a class="code" href="class_f_m_color.html#ba4a975fc1d71d6f0065cf67f90d3c45">b</a> * s), uint8(c.<a class="code" href="class_f_m_color.html#42355f56b082b874c5580a9b4625be7c">a</a> * s)); } |
---|
53 | <a name="l00112"></a>00112 |
---|
54 | <a name="l00113"></a>00113 <span class="preprocessor">#endif // _FM_COLOR_H_</span> |
---|
55 | </pre></div><hr size="1"><address style="align: right;"><small>Generated on Fri May 12 16:44:39 2006 for FCollada by |
---|
56 | <a href="http://www.doxygen.org/index.html"> |
---|
57 | <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.6-NO </small></address> |
---|
58 | </body> |
---|
59 | </html> |
---|