aboutsummaryrefslogtreecommitdiff
path: root/docs/doxygen/nel/bitmap_8cpp-source.html
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2018-08-11 20:21:34 +0200
committerneodarz <neodarz@neodarz.net>2018-08-11 20:21:34 +0200
commit0ea5fc66924303d1bf73ba283a383e2aadee02f2 (patch)
tree2568e71a7ccc44ec23b8bb3f0ff97fb6bf2ed709 /docs/doxygen/nel/bitmap_8cpp-source.html
downloadnevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.tar.xz
nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.zip
Initial commit
Diffstat (limited to '')
-rw-r--r--docs/doxygen/nel/bitmap_8cpp-source.html3062
1 files changed, 3062 insertions, 0 deletions
diff --git a/docs/doxygen/nel/bitmap_8cpp-source.html b/docs/doxygen/nel/bitmap_8cpp-source.html
new file mode 100644
index 00000000..f05e0624
--- /dev/null
+++ b/docs/doxygen/nel/bitmap_8cpp-source.html
@@ -0,0 +1,3062 @@
+<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
+<HTML>
+<HEAD>
+ <TITLE>nevrax.org : docs</TITLE>
+ <LINK REL=stylesheet TYPE="text/css" HREF="http://www.nevrax.org/inc/css/nevrax.css">
+ <link href="doxygen.css" rel="stylesheet" type="text/css">
+</HEAD>
+<BODY MARGINHEIGHT="0" MARGINWIDTH="0">
+
+<!-- uplinks -->
+<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0>
+ <TR>
+ <TD WIDTH=16><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
+ <TD WIDTH=140 BGCOLOR=#dddddd><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="16" BORDER=0 ALT=""></TD>
+ <TD WIDTH=16><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
+ <TD><IMG width=6 height=14 SRC="http://www.nevrax.org/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle>&nbsp;<A CLASS=uplinks HREF=http://www.nevrax.org><b>Home</B></FONT></A>&nbsp;&nbsp;&nbsp;</TD>
+ <TD><IMG width=6 height=14 SRC="http://www.nevrax.org/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle>&nbsp;<A CLASS=uplinks HREF=http://www.nevrax.com><b>nevrax.com</B></FONT></A>&nbsp;&nbsp;&nbsp;</TD>
+ </TR>
+</TABLE>
+
+<!-- banner Nevrax -->
+<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%>
+ <TR><TD BGCOLOR="#000000" BACKGROUND="http://www.nevrax.org/inc/img/black_banner.jpg"><A HREF="http://www.nevrax.org"><IMG SRC="http://www.nevrax.org/inc/img/nevrax.gif" WIDTH="170" HEIGHT="45" BORDER=0 ALT="Nevrax" ></A></TD></TR>
+</TABLE>
+
+<!-- main table -->
+<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 height=100%>
+ <TR>
+ <TD WIDTH=16><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="10" BORDER=0 ALT=""></TD>
+ <TD WIDTH=140 BGCOLOR=#dddddd VALIGN=TOP ALIGN=middle><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT="">
+
+ <!------ Begin Box ------>
+ <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 BGCOLOR=black><TR><TD><TABLE border=0 cellspacing=2 cellpadding=0 width=120><tr><TD ALIGN=middle bgcolor=black>
+ <FONT COLOR=white FACE="sans-serif"><B>Nevrax.org</B></FONT></TD></TR><tr><td colspan=2 bgcolor=#FFFFFF>
+ <TABLE cellspacing=0 cellpadding=1 border=0>
+ <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/news/" TITLE="Rubrique news"><img width=13 height=15 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-news.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/news/" TITLE="News">News</a></td></tr>
+ <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/mail/" TITLE="Rubrique mail"><img width=15 height=11 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-mail.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/mail/" TITLE="Mailing list archive">Mailing-list</a></td></tr>
+ <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/docs/" TITLE="Rubrique docs"><img width=14 height=16 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-docs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/docs/" TITLE="Documentation">Documentation</a></td></tr>
+ <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/cvs/" TITLE="Rubrique cvs"><img width=13 height=17 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-cvs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/cvs/" TITLE="CVS Web">CVS</a></td></tr>
+ <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/bugs/" TITLE="Rubrique bugs"><img width=20 height=16 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-bugs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/bugs/" TITLE="Bugtracking">Bugs</a></td></tr>
+ <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/GPL.php3" TITLE="Rubrique license"><img width=18 height=12 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-gpl.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/GPL.php3" TITLE="License">License</a></td></tr>
+ </TABLE>
+ </TD></TR></TABLE></TD></TR></TABLE>
+ <!------ End Box ------>
+
+ </TD>
+ <TD WIDTH=15><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
+ <TD ALIGN=left valign=top><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT="">
+
+<!-- title -->
+<TABLE background="http://www.nevrax.org/inc/img/redline.gif" CELLSPACING=0 CELLPADDING=0 BORDER=0 width=100%><tr><td>
+<A HREF="http://www.nevrax.org/docs/"><img src="http://www.nevrax.org/inc/img/t_docs.gif" ALT="Docs" HEIGHT=20 BORDER=0></A>
+</td><td><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="1" HEIGHT="1" BORDER=0 ALT="">
+</td></tr></table>
+&nbsp;
+
+<!-- block -->
+<TABLE bgcolor="#dddddd" CELLSPACING=0 CELLPADDING=0 BORDER=0 width=100%><tr><td width=1% valign=middle><img width=6 height=14 hspace=2 vspace=2 src="http://www.nevrax.org/inc/img/reddots.gif"></TD>
+ <TD><B>Documentation</B></TD>
+ <TD ALIGN=RIGHT>&nbsp;</td>
+</tr></table>
+<!-- Generated by Doxygen 1.2.14 -->
+<center>
+<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="namespacemembers.html">Namespace Members</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; <a class="qindex" href="pages.html">Related Pages</a> &nbsp; <a class="qindexRef" doxygen="_cgi:http://www.nevrax.org/cgi-bin/nel-search.cgi" href="http://www.nevrax.org/cgi-bin/nel-search.cgi">Search</a> &nbsp; </center>
+<hr><h1>bitmap.cpp</h1><a href="bitmap_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001
+00009 <font class="comment">/* Copyright, 2000 Nevrax Ltd.</font>
+00010 <font class="comment"> *</font>
+00011 <font class="comment"> * This file is part of NEVRAX NEL.</font>
+00012 <font class="comment"> * NEVRAX NEL is free software; you can redistribute it and/or modify</font>
+00013 <font class="comment"> * it under the terms of the GNU General Public License as published by</font>
+00014 <font class="comment"> * the Free Software Foundation; either version 2, or (at your option)</font>
+00015 <font class="comment"> * any later version.</font>
+00016 <font class="comment"></font>
+00017 <font class="comment"> * NEVRAX NEL is distributed in the hope that it will be useful, but</font>
+00018 <font class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of</font>
+00019 <font class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</font>
+00020 <font class="comment"> * General Public License for more details.</font>
+00021 <font class="comment"></font>
+00022 <font class="comment"> * You should have received a copy of the GNU General Public License</font>
+00023 <font class="comment"> * along with NEVRAX NEL; see the file COPYING. If not, write to the</font>
+00024 <font class="comment"> * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,</font>
+00025 <font class="comment"> * MA 02111-1307, USA.</font>
+00026 <font class="comment"> */</font>
+00027
+00028 <font class="preprocessor">#include "<a class="code" href="stdmisc_8h.html">stdmisc.h</a>"</font>
+00029
+00030 <font class="preprocessor">#include &lt;memory&gt;</font>
+00031 <font class="preprocessor">#include &lt;algorithm&gt;</font>
+00032
+00033 <font class="comment">/*extern "C"</font>
+00034 <font class="comment">{</font>
+00035 <font class="comment">#include &lt;jpeglib.h&gt;</font>
+00036 <font class="comment">}</font>
+00037 <font class="comment">*/</font>
+00038
+00039 <font class="preprocessor">#include "<a class="code" href="bitmap_8h.html">nel/misc/bitmap.h</a>"</font>
+00040 <font class="preprocessor">#include "<a class="code" href="stream_8h.html">nel/misc/stream.h</a>"</font>
+00041 <font class="preprocessor">#include "<a class="code" href="file_8h.html">nel/misc/file.h</a>"</font>
+00042
+00043
+00044 <font class="keyword">using</font> <font class="keyword">namespace </font>std;
+00045
+00046 <font class="keyword">namespace </font>NLMISC
+00047 {
+00048
+00049
+<a name="l00050"></a><a class="code" href="structNLMISC_1_1EDDSBadHeader.html">00050</a> <font class="keyword">struct </font>EDDSBadHeader : <font class="keyword">public</font> NLMISC::EStream
+00051 {
+<a name="l00052"></a><a class="code" href="structNLMISC_1_1EDDSBadHeader.html#a0">00052</a> <a class="code" href="structNLMISC_1_1EDDSBadHeader.html#a0">EDDSBadHeader</a>() : <a class="code" href="structNLMISC_1_1EStream.html#a0">EStream</a>( "Bad or unrecognized <a class="code" href="namespaceNLMISC.html#a2">DDS</a> <a class="code" href="cf__lexical_8cpp.html#a95">file</a> header" ) {}
+00053 };
+00054
+<a name="l00055"></a><a class="code" href="structNLMISC_1_1ESeekFailed.html">00055</a> <font class="keyword">struct </font>ESeekFailed : <font class="keyword">public</font> NLMISC::EStream
+00056 {
+<a name="l00057"></a><a class="code" href="structNLMISC_1_1ESeekFailed.html#a0">00057</a> <a class="code" href="structNLMISC_1_1ESeekFailed.html#a0">ESeekFailed</a>() : <a class="code" href="structNLMISC_1_1EStream.html#a0">EStream</a>( "Seek failed" ) {}
+00058 };
+00059
+<a name="l00060"></a><a class="code" href="structNLMISC_1_1EAllocationFailure.html">00060</a> <font class="keyword">struct </font>EAllocationFailure : <font class="keyword">public</font> Exception
+00061 {
+<a name="l00062"></a><a class="code" href="structNLMISC_1_1EAllocationFailure.html#a0">00062</a> <a class="code" href="structNLMISC_1_1EAllocationFailure.html#a0">EAllocationFailure</a>() : <a class="code" href="classNLMISC_1_1Exception.html#a0">Exception</a>( "Can'<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a> allocate memory" ) {}
+00063 };
+00064
+00065 <font class="keywordtype">void</font> <a class="code" href="namespaceNLMISC.html#a285">blendFromui</a>(<a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a> &amp;c0, <a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a> &amp;c1, uint coef);
+00066 uint32 <a class="code" href="namespaceNLMISC.html#a286">blend</a>(uint32 &amp;n0, uint32 &amp;n1, uint32 coef0);
+00067
+<a name="l00068"></a><a class="code" href="classNLMISC_1_1CBitmap.html#p0">00068</a> <font class="keyword">const</font> uint32 CBitmap::bitPerPixels[ModeCount]=
+00069 {
+00070 32, <font class="comment">// RGBA</font>
+00071 8, <font class="comment">// Luminance</font>
+00072 8, <font class="comment">// Alpha</font>
+00073 16, <font class="comment">// AlphaLuminance</font>
+00074 4, <font class="comment">// DXTC1</font>
+00075 4, <font class="comment">// DXTC1Alpha</font>
+00076 8, <font class="comment">// DXTC3</font>
+00077 8, <font class="comment">// DXTC5</font>
+00078 16 <font class="comment">// DsDt</font>
+00079 };
+00080
+<a name="l00081"></a><a class="code" href="classNLMISC_1_1CBitmap.html#p1">00081</a> <font class="keyword">const</font> uint32 CBitmap::DXTC1HEADER = <a class="code" href="bitmap_8h.html#a0">NL_MAKEFOURCC</a>(<font class="charliteral">'D'</font>,<font class="charliteral">'X'</font>, <font class="charliteral">'T'</font>, <font class="charliteral">'1'</font>);
+<a name="l00082"></a><a class="code" href="classNLMISC_1_1CBitmap.html#p2">00082</a> <font class="keyword">const</font> uint32 CBitmap::DXTC3HEADER = <a class="code" href="bitmap_8h.html#a0">NL_MAKEFOURCC</a>(<font class="charliteral">'D'</font>,<font class="charliteral">'X'</font>, <font class="charliteral">'T'</font>, <font class="charliteral">'3'</font>);
+<a name="l00083"></a><a class="code" href="classNLMISC_1_1CBitmap.html#p3">00083</a> <font class="keyword">const</font> uint32 CBitmap::DXTC5HEADER = <a class="code" href="bitmap_8h.html#a0">NL_MAKEFOURCC</a>(<font class="charliteral">'D'</font>,<font class="charliteral">'X'</font>, <font class="charliteral">'T'</font>, <font class="charliteral">'5'</font>);
+00084
+00085 <font class="comment">// static data for jpeg compression (used by writeJPG())</font>
+00086 <a class="code" href="classNLMISC_1_1IStream.html">NLMISC::IStream</a> *<a class="code" href="namespaceNLMISC.html#a185">JPGStream</a> = NULL;
+00087 <font class="keyword">const</font> uint32 <a class="code" href="namespaceNLMISC.html#a186">JPGBufferSize</a> = 1000;
+00088 <font class="keywordtype">char</font> <a class="code" href="namespaceNLMISC.html#a187">JPGBuffer</a>[<a class="code" href="namespaceNLMISC.html#a186">JPGBufferSize</a>];
+00089
+00090
+00091 <font class="comment">/*-------------------------------------------------------------------*\</font>
+00092 <font class="comment"> load </font>
+00093 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l00094"></a><a class="code" href="classNLMISC_1_1CBitmap.html#a2">00094</a> uint8 CBitmap::load(<a class="code" href="classNLMISC_1_1IStream.html">NLMISC::IStream</a> &amp;f, uint mipMapSkip)
+00095 {
+00096 <a class="code" href="debug_8h.html#a6">nlassert</a>(f.<a class="code" href="classNLMISC_1_1IStream.html#a4">isReading</a>());
+00097
+00098 <font class="comment">// testing if DDS</font>
+00099 uint32 fileType = 0;;
+00100 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(fileType);
+00101 <font class="keywordflow">if</font>(fileType == <a class="code" href="namespaceNLMISC.html#a2">DDS</a>)
+00102 {
+00103 <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1CBitmap.html#c1">readDDS</a>(f, mipMapSkip);
+00104 }
+00105 <font class="comment">// assuming it's TGA</font>
+00106 <font class="keywordflow">else</font>
+00107 {
+00108 <a class="code" href="classNLMISC_1_1IStream.html#s3">NLMISC::IStream::TSeekOrigin</a> origin= f.<a class="code" href="classNLMISC_1_1IStream.html#s3s0">begin</a>;
+00109 <font class="keywordflow">if</font>(!f.<a class="code" href="classNLMISC_1_1IStream.html#a31">seek</a> (0, origin))
+00110 {
+00111 <font class="keywordflow">throw</font> ESeekFailed();
+00112 }
+00113
+00114 <font class="comment">// Reading header, </font>
+00115 <font class="comment">// To make sure that the bitmap is TGA, we check imageType and imageDepth.</font>
+00116 uint8 lengthID;
+00117 uint8 cMapType;
+00118 uint8 imageType;
+00119 uint16 tgaOrigin;
+00120 uint16 length;
+00121 uint8 <a class="code" href="driver__opengl__extension__def_8h.html#a391">depth</a>;
+00122 uint16 xOrg;
+00123 uint16 yOrg;
+00124 uint16 <a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>;
+00125 uint16 <a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>;
+00126 uint8 imageDepth;
+00127 uint8 desc;
+00128
+00129 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(lengthID);
+00130 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(cMapType);
+00131 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(imageType);
+00132 <font class="keywordflow">if</font>(imageType!=2 &amp;&amp; imageType!=3 &amp;&amp; imageType!=10 &amp;&amp; imageType!=11) <font class="keywordflow">return</font> 0;
+00133 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(tgaOrigin);
+00134 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(length);
+00135 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a391">depth</a>);
+00136 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(xOrg);
+00137 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(yOrg);
+00138 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>);
+00139 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>);
+00140 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(imageDepth);
+00141 <font class="keywordflow">if</font>(imageDepth!=8 &amp;&amp; imageDepth!=16 &amp;&amp; imageDepth!=24 &amp;&amp; imageDepth!=32) <font class="keywordflow">return</font> 0;
+00142 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(desc);
+00143
+00144 <font class="keywordflow">if</font>(!f.<a class="code" href="classNLMISC_1_1IStream.html#a31">seek</a> (0, origin))
+00145 {
+00146 <font class="keywordflow">throw</font> ESeekFailed();
+00147 }
+00148 <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1CBitmap.html#c2">readTGA</a>(f);
+00149 }
+00150 }
+00151
+00152
+00153 <font class="comment">/*-------------------------------------------------------------------*\</font>
+00154 <font class="comment"> makeDummy </font>
+00155 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l00156"></a><a class="code" href="classNLMISC_1_1CBitmap.html#a3">00156</a> <font class="keywordtype">void</font> CBitmap::makeDummy()
+00157 {
+00158 <font class="keyword">static</font> <font class="keyword">const</font> uint8 bitmap[1024]= {
+00159 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+00160 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,
+00161 0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,
+00162 0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,
+00163 0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,
+00164 0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,
+00165 0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,
+00166 0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,
+00167 0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,
+00168 0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,
+00169 0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,
+00170 0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,
+00171 0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,
+00172 0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,
+00173 0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,
+00174 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+00175 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+00176 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,
+00177 0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,
+00178 0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,
+00179 0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,
+00180 0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,
+00181 0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,
+00182 0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,
+00183 0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,
+00184 0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,
+00185 0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,
+00186 0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,
+00187 0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,
+00188 0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,
+00189 0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,
+00190 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+00191 };
+00192
+00193 <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#s11s0">RGBA</a>;
+00194 <a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a> = 1;
+00195 <a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>= 32;
+00196 <a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a>= 32;
+00197 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0].resize(<a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>*<a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a>*<font class="keyword">sizeof</font>(<a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a>));
+00198 <a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a> *pix= (<a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a>*)(&amp;(*<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0].begin()));
+00199
+00200 <font class="keywordflow">for</font>(sint i=0;i&lt;(sint)(<a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>*<a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a>);i++)
+00201 {
+00202 <font class="keywordflow">if</font>(bitmap[i])
+00203 pix[i].<a class="code" href="classNLMISC_1_1CRGBA.html#a10">set</a>(255,255,255,255);
+00204 <font class="keywordflow">else</font>
+00205 pix[i].<a class="code" href="classNLMISC_1_1CRGBA.html#a10">set</a>(0,0,0,255);
+00206 }
+00207
+00208 }
+00209
+00210
+00211
+00212
+00213 <font class="comment">/*-------------------------------------------------------------------*\</font>
+00214 <font class="comment"> readDDS </font>
+00215 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l00216"></a><a class="code" href="classNLMISC_1_1CBitmap.html#c1">00216</a> uint8 CBitmap::readDDS(<a class="code" href="classNLMISC_1_1IStream.html">NLMISC::IStream</a> &amp;f, uint mipMapSkip)
+00217 {
+00218 <font class="comment">//------------------ Reading Header ------------------------</font>
+00219
+00220 <font class="comment">//-------------- reading entire header</font>
+00221
+00222 uint32 size = 0;
+00223 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(size); <font class="comment">// size in Bytes of header(without "DDS")</font>
+00224 uint32 * _DDSSurfaceDesc = <font class="keyword">new</font> uint32[size];
+00225 std::auto_ptr&lt;uint32&gt; _DDSSurfaceDescAuto(_DDSSurfaceDesc);
+00226 _DDSSurfaceDesc[0]= size;
+00227
+00228 <font class="preprocessor">#ifdef NL_LITTLE_ENDIAN</font>
+00229 <font class="preprocessor"></font> f.<a class="code" href="classNLMISC_1_1IStream.html#z327_0">serialBuffer</a>((uint8*)(_DDSSurfaceDesc+1), size-4);
+00230 <font class="preprocessor">#else</font>
+00231 <font class="preprocessor"></font> <font class="keywordflow">for</font>(uint i= 0; i&lt;size/4 - 1; i++)
+00232 {
+00233 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(_DDSSurfaceDesc[i+1]);
+00234 }
+00235 <font class="preprocessor">#endif</font>
+00236 <font class="preprocessor"></font>
+00237 <font class="comment">// flags determines which members of the header structure contain valid data</font>
+00238 uint32 flags = _DDSSurfaceDesc[1];
+00239
+00240 <font class="comment">//verify if file have linearsize set</font>
+00241 <font class="keywordflow">if</font>(!(flags &amp; <a class="code" href="bitmap_8h.html#a1">DDSD_LINEARSIZE</a>))
+00242 {
+00243 <font class="keywordflow">throw</font> EDDSBadHeader();
+00244 }
+00245
+00246 <font class="comment">//-------------- extracting and testing useful info</font>
+00247
+00248 <a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a> = _DDSSurfaceDesc[2];
+00249 <a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a> = _DDSSurfaceDesc[3];
+00250 <a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>= (uint8) _DDSSurfaceDesc[6];
+00251 <font class="comment">// If no mipmap.</font>
+00252 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>==0)
+00253 <a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>=1;
+00254 <font class="keywordflow">switch</font> (_DDSSurfaceDesc[20])
+00255 {
+00256 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#p1">DXTC1HEADER</a>:
+00257 <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a>=<a class="code" href="classNLMISC_1_1CBitmap.html#s11s4">DXTC1</a>;
+00258 <font class="keywordflow">break</font>;
+00259 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#p2">DXTC3HEADER</a>:
+00260 <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a>=<a class="code" href="classNLMISC_1_1CBitmap.html#s11s6">DXTC3</a>;
+00261 <font class="keywordflow">break</font>;
+00262 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#p3">DXTC5HEADER</a>:
+00263 <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a>=<a class="code" href="classNLMISC_1_1CBitmap.html#s11s7">DXTC5</a>;
+00264 <font class="keywordflow">break</font>;
+00265 }
+00266
+00267 flags = _DDSSurfaceDesc[19]; <font class="comment">//PixelFormat flags</font>
+00268
+00269 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a>==<a class="code" href="classNLMISC_1_1CBitmap.html#s11s4">DXTC1</a> &amp;&amp; _DDSSurfaceDesc[21]&gt;0) <font class="comment">//AlphaBitDepth</font>
+00270 {
+00271 <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#s11s5">DXTC1Alpha</a>;
+00272 }
+00273
+00274 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a>!= <a class="code" href="classNLMISC_1_1CBitmap.html#s11s4">DXTC1</a> &amp;&amp; <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a>!= <a class="code" href="classNLMISC_1_1CBitmap.html#s11s5">DXTC1Alpha</a> &amp;&amp; <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a>!= <a class="code" href="classNLMISC_1_1CBitmap.html#s11s6">DXTC3</a> &amp;&amp; <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a>!= <a class="code" href="classNLMISC_1_1CBitmap.html#s11s7">DXTC5</a>)
+00275 {
+00276 <font class="keywordflow">throw</font> EDDSBadHeader();
+00277 }
+00278
+00279 <font class="comment">// compute the min power of 2 between width and height</font>
+00280 uint minSizeLevel= <a class="code" href="bit__set_8cpp.html#a0">min</a>(<a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>, <a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a>);
+00281 minSizeLevel= <a class="code" href="namespaceNLMISC.html#a224">getPowerOf2</a>(minSizeLevel);
+00282
+00283 <font class="comment">//------------- manage mipMapSkip </font>
+00284 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>&gt;1 &amp;&amp; mipMapSkip&gt;0 &amp;&amp; minSizeLevel&gt;2)
+00285 {
+00286 <font class="comment">// Keep at least the level where width and height are at leat 4.</font>
+00287 mipMapSkip= <a class="code" href="bit__set_8cpp.html#a0">min</a>(mipMapSkip, minSizeLevel-2);
+00288 <font class="comment">// skip any mipmap</font>
+00289 uint seekSize= 0;
+00290 <font class="keywordflow">while</font>(mipMapSkip&gt;0)
+00291 {
+00292 uint32 mipMapSz;
+00293 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a>==<a class="code" href="classNLMISC_1_1CBitmap.html#s11s4">DXTC1</a> || <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a>==<a class="code" href="classNLMISC_1_1CBitmap.html#s11s5">DXTC1Alpha</a>)
+00294 mipMapSz = <a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>*<a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a>/2;
+00295 <font class="keywordflow">else</font>
+00296 mipMapSz = <a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>*<a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a>;
+00297
+00298 <font class="comment">// add to how many to skip</font>
+00299 seekSize+= mipMapSz;
+00300
+00301 <font class="comment">// Size of final bitmap is reduced.</font>
+00302 <a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>&gt;&gt;=1;
+00303 <a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a>&gt;&gt;=1;
+00304 <a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>--;
+00305 mipMapSkip--;
+00306 }
+00307 <font class="comment">// skip data in file</font>
+00308 <font class="keywordflow">if</font>(seekSize&gt;0)
+00309 {
+00310 <font class="keywordflow">if</font>(!f.<a class="code" href="classNLMISC_1_1IStream.html#a31">seek</a>(seekSize, IStream::current))
+00311 {
+00312 <font class="keywordflow">throw</font> ESeekFailed();
+00313 }
+00314 }
+00315
+00316 }
+00317
+00318 <font class="comment">//------------- preload all the mipmaps (one serialBuffer() is faster)</font>
+00319 uint32 <a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>;
+00320 uint32 h = <a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a>;
+00321 uint32 totalSize= 0;
+00322
+00323 uint8 m;
+00324 <font class="keywordflow">for</font>(m= 0; m&lt;<a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>; m++)
+00325 {
+00326 uint32 wtmp, htmp;
+00327 <font class="keywordflow">if</font>(<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>&lt;4)
+00328 wtmp = 4;
+00329 <font class="keywordflow">else</font>
+00330 wtmp = <a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>;
+00331 <font class="keywordflow">if</font>(h &lt; 4)
+00332 htmp = 4;
+00333 <font class="keywordflow">else</font>
+00334 htmp = h;
+00335
+00336 uint32 mipMapSz;
+00337 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a>==<a class="code" href="classNLMISC_1_1CBitmap.html#s11s4">DXTC1</a> || <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a>==<a class="code" href="classNLMISC_1_1CBitmap.html#s11s5">DXTC1Alpha</a>)
+00338 mipMapSz = wtmp*htmp/2;
+00339 <font class="keywordflow">else</font>
+00340 mipMapSz = wtmp*htmp;
+00341
+00342
+00343 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].resize(mipMapSz);
+00344 totalSize+= mipMapSz;
+00345
+00346 <a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a> = (<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>+1)/2;
+00347 h = (h+1)/2;
+00348 }
+00349
+00350 <font class="comment">// Read all the data in one block.</font>
+00351 vector&lt;uint8&gt; pixData;
+00352 pixData.resize(totalSize);
+00353 f.<a class="code" href="classNLMISC_1_1IStream.html#z327_0">serialBuffer</a>(&amp;(*pixData.begin()), totalSize);
+00354
+00355
+00356 <font class="comment">//------------- reading mipmap levels from pixData</font>
+00357
+00358 uint32 pixIndex= 0;
+00359
+00360 <font class="keywordflow">for</font>(m= 0; m&lt;<a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>; m++)
+00361 {
+00362 uint32 mipMapSz= <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].size();
+00363 memcpy(&amp;(*<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].begin()), &amp;(pixData[pixIndex]), mipMapSz);
+00364 pixIndex+= mipMapSz;
+00365 }
+00366
+00367 <font class="comment">//------------- End</font>
+00368
+00369 <font class="keywordflow">switch</font>(PixelFormat)
+00370 {
+00371 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s4">DXTC1</a> : <font class="keywordflow">return</font> 24;
+00372 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s5">DXTC1Alpha</a> : <font class="keywordflow">return</font> 32;
+00373 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s6">DXTC3</a> : <font class="keywordflow">return</font> 32;
+00374 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s7">DXTC5</a> : <font class="keywordflow">return</font> 32;
+00375 <font class="keywordflow">default</font> : <font class="keywordflow">break</font>;
+00376 }
+00377
+00378 <font class="keywordflow">return</font> 0;
+00379 }
+00380
+00381
+00382
+00383
+00384 <font class="comment">/*-------------------------------------------------------------------*\</font>
+00385 <font class="comment"> convertToDXTC5</font>
+00386 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l00387"></a><a class="code" href="classNLMISC_1_1CBitmap.html#z275_0">00387</a> <font class="keywordtype">bool</font> CBitmap::convertToDXTC5()
+00388 {
+00389 <font class="comment">/* Yoyo: RGB encoding for DXTC1 and DXTC5/3 are actually different!!</font>
+00390 <font class="comment"> DXTC3/5 don't rely on sign of color0&gt;color1 to setup special encoding (ie use a special compression for Black)</font>
+00391 <font class="comment"> Since this can arise if the src is DXTC1 , we can't simply compress it into DXTC5 without doing a </font>
+00392 <font class="comment"> heavy compression...</font>
+00393 <font class="comment"> (the inverse is false: DXTC5 to DXTC1 is possible, with maybe swap color0/color1 and bits).</font>
+00394 <font class="comment"> */</font>
+00395
+00396 <font class="keywordflow">return</font> <font class="keyword">false</font>;
+00397
+00398 <font class="comment">/* uint32 i,j;</font>
+00399 <font class="comment"></font>
+00400 <font class="comment"> if(PixelFormat!=DXTC1) return false;</font>
+00401 <font class="comment"></font>
+00402 <font class="comment"> for(uint8 m= 0; m&lt;_MipMapCount; m++)</font>
+00403 <font class="comment"> {</font>
+00404 <font class="comment"> std::vector&lt;uint8&gt; dataTmp;</font>
+00405 <font class="comment"> dataTmp.reserve(2*_Data[m].size());</font>
+00406 <font class="comment"></font>
+00407 <font class="comment"> for(i=0; i&lt;_Data[m].size(); i+=8)</font>
+00408 <font class="comment"> {</font>
+00409 <font class="comment"> //64 bits alpha</font>
+00410 <font class="comment"> for(j=0; j&lt;8; j++)</font>
+00411 <font class="comment"> {</font>
+00412 <font class="comment"> dataTmp.push_back(255);</font>
+00413 <font class="comment"> }</font>
+00414 <font class="comment"></font>
+00415 <font class="comment"> //64 bits RGB</font>
+00416 <font class="comment"> for(j=0; j&lt;8; j++)</font>
+00417 <font class="comment"> {</font>
+00418 <font class="comment"> dataTmp.push_back(_Data[m][i+j]);</font>
+00419 <font class="comment"> }</font>
+00420 <font class="comment"> }</font>
+00421 <font class="comment"> _Data[m] = dataTmp;</font>
+00422 <font class="comment"> }</font>
+00423 <font class="comment"> PixelFormat = DXTC5;</font>
+00424 <font class="comment"> return true;</font>
+00425 <font class="comment">*/</font>
+00426 }
+00427
+00428
+00429
+00430 <font class="comment">/*-------------------------------------------------------------------*\</font>
+00431 <font class="comment"> luminanceToRGBA()</font>
+00432 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l00433"></a><a class="code" href="classNLMISC_1_1CBitmap.html#z275_2">00433</a> <font class="keywordtype">bool</font> CBitmap::luminanceToRGBA()
+00434 {
+00435 uint32 i;
+00436
+00437 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>*<a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a> == 0) <font class="keywordflow">return</font> <font class="keyword">false</font>;
+00438
+00439 <font class="keywordflow">for</font>(uint8 m= 0; m&lt;<a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>; m++)
+00440 {
+00441 std::vector&lt;uint8&gt; dataTmp;
+00442 dataTmp.reserve(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].<a class="code" href="cf__lexical_8cpp.html#a94">size</a>()*4);
+00443
+00444 <font class="keywordflow">for</font>(i=0; i&lt;<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].size(); i++)
+00445 {
+00446 dataTmp.push_back(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][i]);
+00447 dataTmp.push_back(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][i]);
+00448 dataTmp.push_back(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][i]);
+00449 dataTmp.push_back(255);
+00450 }
+00451 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m] = dataTmp;
+00452 }
+00453 <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#s11s0">RGBA</a>;
+00454 <font class="keywordflow">return</font> <font class="keyword">true</font>;
+00455 }
+00456
+00457 <font class="comment">/*-------------------------------------------------------------------*\</font>
+00458 <font class="comment"> alphaToRGBA()</font>
+00459 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l00460"></a><a class="code" href="classNLMISC_1_1CBitmap.html#z275_3">00460</a> <font class="keywordtype">bool</font> CBitmap::alphaToRGBA()
+00461 {
+00462 uint32 i;
+00463
+00464 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>*<a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a> == 0) <font class="keywordflow">return</font> <font class="keyword">false</font>;
+00465
+00466 <font class="keywordflow">for</font>(uint8 m= 0; m&lt;<a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>; m++)
+00467 {
+00468 std::vector&lt;uint8&gt; dataTmp;
+00469 dataTmp.reserve(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].<a class="code" href="cf__lexical_8cpp.html#a94">size</a>()*4);
+00470
+00471 <font class="keywordflow">for</font>(i=0; i&lt;<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].size(); i++)
+00472 {
+00473 dataTmp.push_back(255);
+00474 dataTmp.push_back(255);
+00475 dataTmp.push_back(255);
+00476 dataTmp.push_back(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][i]);
+00477 }
+00478 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m] = dataTmp;
+00479 }
+00480 <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#s11s0">RGBA</a>;
+00481 <font class="keywordflow">return</font> <font class="keyword">true</font>;
+00482 }
+00483
+00484
+00485 <font class="comment">/*-------------------------------------------------------------------*\</font>
+00486 <font class="comment"> alphaLuminanceToRGBA()</font>
+00487 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l00488"></a><a class="code" href="classNLMISC_1_1CBitmap.html#z275_4">00488</a> <font class="keywordtype">bool</font> CBitmap::alphaLuminanceToRGBA()
+00489 {
+00490 uint32 i;
+00491
+00492 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>*<a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a> == 0) <font class="keywordflow">return</font> <font class="keyword">false</font>;
+00493
+00494 <font class="keywordflow">for</font>(uint8 m= 0; m&lt;<a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>; m++)
+00495 {
+00496 std::vector&lt;uint8&gt; dataTmp;
+00497 dataTmp.reserve(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].<a class="code" href="cf__lexical_8cpp.html#a94">size</a>()*2);
+00498
+00499 <font class="keywordflow">for</font>(i=0; i&lt;<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].size(); i+=2)
+00500 {
+00501 dataTmp.push_back(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][i]);
+00502 dataTmp.push_back(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][i]);
+00503 dataTmp.push_back(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][i]);
+00504 dataTmp.push_back(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][i+1]);
+00505 }
+00506 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m] = dataTmp;
+00507 }
+00508 <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#s11s0">RGBA</a>;
+00509 <font class="keywordflow">return</font> <font class="keyword">true</font>;
+00510 }
+00511
+00512
+00513
+00514
+00515 <font class="comment">/*-------------------------------------------------------------------*\</font>
+00516 <font class="comment"> rgbaToAlphaLuminance</font>
+00517 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l00518"></a><a class="code" href="classNLMISC_1_1CBitmap.html#z275_14">00518</a> <font class="keywordtype">bool</font> CBitmap::rgbaToAlphaLuminance()
+00519 {
+00520 uint32 i;
+00521
+00522 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>*<a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a> == 0) <font class="keywordflow">return</font> <font class="keyword">false</font>;
+00523
+00524 <font class="keywordflow">for</font>(uint8 m= 0; m&lt;<a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>; m++)
+00525 {
+00526 std::vector&lt;uint8&gt; dataTmp;
+00527 dataTmp.reserve(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].<a class="code" href="cf__lexical_8cpp.html#a94">size</a>()/2);
+00528
+00529 <font class="keywordflow">for</font>(i=0; i&lt;<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].size(); i+=4)
+00530 {
+00531 dataTmp.push_back((<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][i]*77 + <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][i+1]*150 + <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][i+2]*28)/255);
+00532 dataTmp.push_back(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][i+3]);
+00533 }
+00534 <a class="code" href="namespaceNLMISC.html#a222">NLMISC::contReset</a>(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m]);
+00535 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].resize(0);
+00536 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m] = dataTmp;
+00537 }
+00538 <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#s11s3">AlphaLuminance</a>;
+00539 <font class="keywordflow">return</font> <font class="keyword">true</font>;
+00540 }
+00541
+00542
+00543 <font class="comment">/*-------------------------------------------------------------------*\</font>
+00544 <font class="comment"> luminanceToAlphaLuminance</font>
+00545 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l00546"></a><a class="code" href="classNLMISC_1_1CBitmap.html#z275_15">00546</a> <font class="keywordtype">bool</font> CBitmap::luminanceToAlphaLuminance()
+00547 {
+00548 uint32 i;
+00549
+00550 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>*<a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a> == 0) <font class="keywordflow">return</font> <font class="keyword">false</font>;
+00551
+00552 <font class="keywordflow">for</font>(uint8 m= 0; m&lt;<a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>; m++)
+00553 {
+00554 std::vector&lt;uint8&gt; dataTmp;
+00555 dataTmp.reserve(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].<a class="code" href="cf__lexical_8cpp.html#a94">size</a>()*2);
+00556
+00557 <font class="keywordflow">for</font>(i=0; i&lt;<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].size(); i++)
+00558 {
+00559 dataTmp.push_back(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][i]);
+00560 dataTmp.push_back(255);
+00561 }
+00562 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m] = dataTmp;
+00563 }
+00564 <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#s11s3">AlphaLuminance</a>;
+00565 <font class="keywordflow">return</font> <font class="keyword">true</font>;
+00566 }
+00567
+00568
+00569
+00570 <font class="comment">/*-------------------------------------------------------------------*\</font>
+00571 <font class="comment"> alphaToAlphaLuminance</font>
+00572 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l00573"></a><a class="code" href="classNLMISC_1_1CBitmap.html#z275_16">00573</a> <font class="keywordtype">bool</font> CBitmap::alphaToAlphaLuminance()
+00574 {
+00575 uint32 i;
+00576
+00577 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>*<a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a> == 0) <font class="keywordflow">return</font> <font class="keyword">false</font>;
+00578
+00579 <font class="keywordflow">for</font>(uint8 m= 0; m&lt;<a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>; m++)
+00580 {
+00581 std::vector&lt;uint8&gt; dataTmp;
+00582 dataTmp.reserve(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].<a class="code" href="cf__lexical_8cpp.html#a94">size</a>()*2);
+00583
+00584 <font class="keywordflow">for</font>(i=0; i&lt;<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].size(); i++)
+00585 {
+00586 dataTmp.push_back(0);
+00587 dataTmp.push_back(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][i]);
+00588 }
+00589 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m] = dataTmp;
+00590 }
+00591 <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#s11s3">AlphaLuminance</a>;
+00592 <font class="keywordflow">return</font> <font class="keyword">true</font>;
+00593 }
+00594
+00595
+00596
+00597 <font class="comment">/*-------------------------------------------------------------------*\</font>
+00598 <font class="comment"> rgbaToLuminance</font>
+00599 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l00600"></a><a class="code" href="classNLMISC_1_1CBitmap.html#z275_6">00600</a> <font class="keywordtype">bool</font> CBitmap::rgbaToLuminance()
+00601 {
+00602 uint32 i;
+00603
+00604 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>*<a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a> == 0) <font class="keywordflow">return</font> <font class="keyword">false</font>;
+00605
+00606 <font class="keywordflow">for</font>(uint8 m= 0; m&lt;<a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>; m++)
+00607 {
+00608 std::vector&lt;uint8&gt; dataTmp;
+00609 dataTmp.reserve(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].<a class="code" href="cf__lexical_8cpp.html#a94">size</a>()/4);
+00610
+00611 <font class="keywordflow">for</font>(i=0; i&lt;<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].size(); i+=4)
+00612 {
+00613 dataTmp.push_back((<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][i]*77 + <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][i+1]*150 + <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][i+2]*28)/255);
+00614 }
+00615 <a class="code" href="namespaceNLMISC.html#a222">NLMISC::contReset</a>(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m]);
+00616 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].resize(0);
+00617 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m] = dataTmp;
+00618 }
+00619 <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#s11s1">Luminance</a>;
+00620 <font class="keywordflow">return</font> <font class="keyword">true</font>;
+00621 }
+00622
+00623
+00624
+00625 <font class="comment">/*-------------------------------------------------------------------*\</font>
+00626 <font class="comment"> alphaToLuminance</font>
+00627 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l00628"></a><a class="code" href="classNLMISC_1_1CBitmap.html#z275_7">00628</a> <font class="keywordtype">bool</font> CBitmap::alphaToLuminance()
+00629 {
+00630 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>*<a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a> == 0) <font class="keywordflow">return</font> <font class="keyword">false</font>;
+00631
+00632 <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#s11s1">Luminance</a>;
+00633 <font class="keywordflow">return</font> <font class="keyword">true</font>;
+00634 }
+00635
+00636
+00637
+00638 <font class="comment">/*-------------------------------------------------------------------*\</font>
+00639 <font class="comment"> alphaLuminanceToLuminance</font>
+00640 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l00641"></a><a class="code" href="classNLMISC_1_1CBitmap.html#z275_8">00641</a> <font class="keywordtype">bool</font> CBitmap::alphaLuminanceToLuminance()
+00642 {
+00643 uint32 i;
+00644
+00645 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>*<a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a> == 0) <font class="keywordflow">return</font> <font class="keyword">false</font>;
+00646
+00647 <font class="keywordflow">for</font>(uint8 m= 0; m&lt;<a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>; m++)
+00648 {
+00649 std::vector&lt;uint8&gt; dataTmp;
+00650 dataTmp.reserve(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].<a class="code" href="cf__lexical_8cpp.html#a94">size</a>()/2);
+00651
+00652 <font class="keywordflow">for</font>(i=0; i&lt;<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].size(); i+=2)
+00653 {
+00654 dataTmp.push_back(0);
+00655 dataTmp.push_back(0);
+00656 dataTmp.push_back(0);
+00657 dataTmp.push_back(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][i]);
+00658 }
+00659 <a class="code" href="namespaceNLMISC.html#a222">NLMISC::contReset</a>(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m]);
+00660 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].resize(0);
+00661 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m] = dataTmp;
+00662 }
+00663 <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#s11s1">Luminance</a>;
+00664 <font class="keywordflow">return</font> <font class="keyword">true</font>;
+00665 }
+00666
+00667
+00668 <font class="comment">/*-------------------------------------------------------------------*\</font>
+00669 <font class="comment"> rgbaToAlpha</font>
+00670 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l00671"></a><a class="code" href="classNLMISC_1_1CBitmap.html#z275_10">00671</a> <font class="keywordtype">bool</font> CBitmap::rgbaToAlpha()
+00672 {
+00673 uint32 i;
+00674
+00675 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>*<a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a> == 0) <font class="keywordflow">return</font> <font class="keyword">false</font>;
+00676
+00677 <font class="keywordflow">for</font>(uint8 m= 0; m&lt;<a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>; m++)
+00678 {
+00679 std::vector&lt;uint8&gt; dataTmp;
+00680 dataTmp.reserve(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].<a class="code" href="cf__lexical_8cpp.html#a94">size</a>()/4);
+00681
+00682 <font class="keywordflow">for</font>(i=0; i&lt;<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].size(); i+=4)
+00683 {
+00684 dataTmp.push_back(0);
+00685 dataTmp.push_back(0);
+00686 dataTmp.push_back(0);
+00687 dataTmp.push_back(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][i+3]);
+00688 }
+00689 <a class="code" href="namespaceNLMISC.html#a222">NLMISC::contReset</a>(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m]);
+00690 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].resize(0);
+00691 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m] = dataTmp;
+00692 }
+00693 <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#s11s2">Alpha</a>;
+00694 <font class="keywordflow">return</font> <font class="keyword">true</font>;
+00695 }
+00696
+00697
+00698 <font class="comment">/*-------------------------------------------------------------------*\</font>
+00699 <font class="comment"> luminanceToAlpha</font>
+00700 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l00701"></a><a class="code" href="classNLMISC_1_1CBitmap.html#z275_11">00701</a> <font class="keywordtype">bool</font> CBitmap::luminanceToAlpha()
+00702 {
+00703 uint32 i;
+00704
+00705 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>*<a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a> == 0) <font class="keywordflow">return</font> <font class="keyword">false</font>;
+00706
+00707 <font class="keywordflow">for</font>(uint8 m= 0; m&lt;<a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>; m++)
+00708 {
+00709 std::vector&lt;uint8&gt; dataTmp;
+00710 dataTmp.reserve(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].<a class="code" href="cf__lexical_8cpp.html#a94">size</a>());
+00711
+00712 <font class="keywordflow">for</font>(i=0; i&lt;<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].size(); i++)
+00713 {
+00714 dataTmp.push_back(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][i]);
+00715 }
+00716 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m] = dataTmp;
+00717 }
+00718 <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#s11s2">Alpha</a>;
+00719 <font class="keywordflow">return</font> <font class="keyword">true</font>;
+00720 }
+00721
+00722
+00723 <font class="comment">/*-------------------------------------------------------------------*\</font>
+00724 <font class="comment"> alphaLuminanceToAlpha</font>
+00725 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l00726"></a><a class="code" href="classNLMISC_1_1CBitmap.html#z275_12">00726</a> <font class="keywordtype">bool</font> CBitmap::alphaLuminanceToAlpha()
+00727 {
+00728 uint32 i;
+00729
+00730 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>*<a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a> == 0) <font class="keywordflow">return</font> <font class="keyword">false</font>;
+00731
+00732 <font class="keywordflow">for</font>(uint8 m= 0; m&lt;<a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>; m++)
+00733 {
+00734 std::vector&lt;uint8&gt; dataTmp;
+00735 dataTmp.reserve(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].<a class="code" href="cf__lexical_8cpp.html#a94">size</a>()/2);
+00736
+00737 <font class="keywordflow">for</font>(i=0; i&lt;<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].size(); i+=2)
+00738 {
+00739 dataTmp.push_back(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][i+1]);
+00740 }
+00741 <a class="code" href="namespaceNLMISC.html#a222">NLMISC::contReset</a>(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m]);
+00742 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].resize(0);
+00743 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m] = dataTmp;
+00744 }
+00745 <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#s11s2">Alpha</a>;
+00746 <font class="keywordflow">return</font> <font class="keyword">true</font>;
+00747 }
+00748
+00749
+00750 <font class="comment">/*-------------------------------------------------------------------*\</font>
+00751 <font class="comment"> convertToLuminance</font>
+00752 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l00753"></a><a class="code" href="classNLMISC_1_1CBitmap.html#z275_5">00753</a> <font class="keywordtype">bool</font> CBitmap::convertToLuminance()
+00754 {
+00755 <font class="keywordflow">switch</font>(PixelFormat)
+00756 {
+00757 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s0">RGBA</a> :
+00758 <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1CBitmap.html#z275_6">rgbaToLuminance</a>();
+00759 <font class="keywordflow">break</font>;
+00760
+00761 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s1">Luminance</a> :
+00762 <font class="keywordflow">return</font> <font class="keyword">true</font>;
+00763 <font class="keywordflow">break</font>;
+00764
+00765 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s2">Alpha</a> :
+00766 <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1CBitmap.html#z275_7">alphaToLuminance</a>();
+00767 <font class="keywordflow">break</font>;
+00768
+00769 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s3">AlphaLuminance</a> :
+00770 <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1CBitmap.html#z275_8">alphaLuminanceToLuminance</a>();
+00771 <font class="keywordflow">break</font>;
+00772
+00773 <font class="keywordflow">default</font>:
+00774 <font class="keywordflow">break</font>;
+00775 }
+00776 <font class="keywordflow">return</font> <font class="keyword">false</font>;
+00777 }
+00778
+00779
+00780
+00781 <font class="comment">/*-------------------------------------------------------------------*\</font>
+00782 <font class="comment"> convertToAlpha</font>
+00783 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l00784"></a><a class="code" href="classNLMISC_1_1CBitmap.html#z275_9">00784</a> <font class="keywordtype">bool</font> CBitmap::convertToAlpha()
+00785 {
+00786 <font class="keywordflow">switch</font>(PixelFormat)
+00787 {
+00788 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s0">RGBA</a> :
+00789 <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1CBitmap.html#z275_10">rgbaToAlpha</a>();
+00790 <font class="keywordflow">break</font>;
+00791
+00792 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s1">Luminance</a> :
+00793 <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1CBitmap.html#z275_11">luminanceToAlpha</a>();
+00794 <font class="keywordflow">break</font>;
+00795
+00796 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s2">Alpha</a> :
+00797 <font class="keywordflow">return</font> <font class="keyword">true</font>;
+00798 <font class="keywordflow">break</font>;
+00799
+00800 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s3">AlphaLuminance</a> :
+00801 <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1CBitmap.html#z275_12">alphaLuminanceToAlpha</a>();
+00802 <font class="keywordflow">break</font>;
+00803
+00804 <font class="keywordflow">default</font>:
+00805 <font class="keywordflow">break</font>;
+00806 }
+00807 <font class="keywordflow">return</font> <font class="keyword">false</font>;
+00808 }
+00809
+00810
+00811
+00812 <font class="comment">/*-------------------------------------------------------------------*\</font>
+00813 <font class="comment"> convertToAlphaLuminance</font>
+00814 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l00815"></a><a class="code" href="classNLMISC_1_1CBitmap.html#z275_13">00815</a> <font class="keywordtype">bool</font> CBitmap::convertToAlphaLuminance()
+00816 {
+00817 <font class="keywordflow">switch</font>(PixelFormat)
+00818 {
+00819 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s0">RGBA</a> :
+00820 <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1CBitmap.html#z275_14">rgbaToAlphaLuminance</a>();
+00821 <font class="keywordflow">break</font>;
+00822
+00823 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s1">Luminance</a> :
+00824 <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1CBitmap.html#z275_15">luminanceToAlphaLuminance</a>();
+00825 <font class="keywordflow">break</font>;
+00826
+00827 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s2">Alpha</a> :
+00828 <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1CBitmap.html#z275_16">alphaToAlphaLuminance</a>();
+00829 <font class="keywordflow">break</font>;
+00830
+00831 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s3">AlphaLuminance</a> :
+00832 <font class="keywordflow">return</font> <font class="keyword">true</font>;
+00833 <font class="keywordflow">break</font>;
+00834
+00835 <font class="keywordflow">default</font>:
+00836 <font class="keywordflow">break</font>;
+00837 }
+00838 <font class="keywordflow">return</font> <font class="keyword">false</font>;
+00839 }
+00840
+00841
+00842 <font class="comment">/*-------------------------------------------------------------------*\</font>
+00843 <font class="comment"> convertToRGBA</font>
+00844 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l00845"></a><a class="code" href="classNLMISC_1_1CBitmap.html#z275_1">00845</a> <font class="keywordtype">bool</font> CBitmap::convertToRGBA()
+00846 {
+00847 <font class="keywordflow">switch</font>(PixelFormat)
+00848 {
+00849 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s4">DXTC1</a> :
+00850 <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1CBitmap.html#c3">decompressDXT1</a>(<font class="keyword">false</font>);
+00851 <font class="keywordflow">break</font>;
+00852
+00853 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s5">DXTC1Alpha</a> :
+00854 <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1CBitmap.html#c3">decompressDXT1</a>(<font class="keyword">true</font>);
+00855 <font class="keywordflow">break</font>;
+00856
+00857 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s6">DXTC3</a> :
+00858 <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1CBitmap.html#c4">decompressDXT3</a>();
+00859 <font class="keywordflow">break</font>;
+00860
+00861 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s7">DXTC5</a> :
+00862 <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1CBitmap.html#c5">decompressDXT5</a>();
+00863 <font class="keywordflow">break</font>;
+00864
+00865 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s1">Luminance</a> :
+00866 <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1CBitmap.html#z275_2">luminanceToRGBA</a>();
+00867 <font class="keywordflow">break</font>;
+00868
+00869 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s2">Alpha</a> :
+00870 <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1CBitmap.html#z275_3">alphaToRGBA</a>();
+00871 <font class="keywordflow">break</font>;
+00872
+00873 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s3">AlphaLuminance</a> :
+00874 <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1CBitmap.html#z275_4">alphaLuminanceToRGBA</a>();
+00875 <font class="keywordflow">break</font>;
+00876 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s0">RGBA</a>:
+00877 <font class="keywordflow">return</font> <font class="keyword">true</font>;
+00878 <font class="keywordflow">break</font>;
+00879 <font class="keywordflow">default</font>:
+00880 <font class="keywordflow">break</font>;
+00881 }
+00882 <font class="keywordflow">return</font> <font class="keyword">false</font>;
+00883 }
+00884
+00885
+00886 <font class="comment">/*-------------------------------------------------------------------*\</font>
+00887 <font class="comment"> convertToType</font>
+00888 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l00889"></a><a class="code" href="classNLMISC_1_1CBitmap.html#a4">00889</a> <font class="keywordtype">bool</font> CBitmap::convertToType(CBitmap::TType <a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>)
+00890 {
+00891 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a>==<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>) <font class="keywordflow">return</font> <font class="keyword">true</font>;
+00892
+00893 <font class="keywordflow">switch</font>(type)
+00894 {
+00895 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s0">RGBA</a> :
+00896 <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1CBitmap.html#z275_1">convertToRGBA</a>();
+00897 <font class="keywordflow">break</font>;
+00898
+00899 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s7">DXTC5</a> :
+00900 <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1CBitmap.html#z275_0">convertToDXTC5</a>();
+00901 <font class="keywordflow">break</font>;
+00902
+00903 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s1">Luminance</a> :
+00904 <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1CBitmap.html#z275_5">convertToLuminance</a>();
+00905 <font class="keywordflow">break</font>;
+00906
+00907 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s2">Alpha</a> :
+00908 <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1CBitmap.html#z275_9">convertToAlpha</a>();
+00909 <font class="keywordflow">break</font>;
+00910
+00911 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s3">AlphaLuminance</a> :
+00912 <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1CBitmap.html#z275_13">convertToAlphaLuminance</a>();
+00913 <font class="keywordflow">break</font>;
+00914
+00915 <font class="keywordflow">default</font>:
+00916 <font class="keywordflow">break</font>;
+00917 }
+00918
+00919 <font class="keywordflow">return</font> <font class="keyword">false</font>;
+00920 }
+00921
+00922
+00923
+00924
+00925 <font class="comment">/*-------------------------------------------------------------------*\</font>
+00926 <font class="comment"> decompressDXT1</font>
+00927 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l00928"></a><a class="code" href="classNLMISC_1_1CBitmap.html#c3">00928</a> <font class="keywordtype">bool</font> CBitmap::decompressDXT1(<font class="keywordtype">bool</font> <a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>)
+00929 {
+00930 uint32 i,j,k;
+00931 <a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a> c[4];
+00932 std::vector&lt;uint8&gt; dataTmp[<a class="code" href="namespaceNLMISC.html#a4">MAX_MIPMAP</a>];
+00933
+00934 uint32 <a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>= <a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>;
+00935 uint32 <a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>= <a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a>;
+00936
+00937 <font class="keywordflow">for</font>(uint8 m= 0; m&lt;<a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>; m++)
+00938 {
+00939 uint32 wtmp, htmp;
+00940 <font class="keywordflow">if</font>(<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>&lt;4)
+00941 wtmp = 4;
+00942 <font class="keywordflow">else</font>
+00943 wtmp = <a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>;
+00944 <font class="keywordflow">if</font>(<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a> &lt; 4)
+00945 htmp = 4;
+00946 <font class="keywordflow">else</font>
+00947 htmp = <a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>;
+00948 uint32 mipMapSz = wtmp*htmp*4;
+00949 dataTmp[m].resize(mipMapSz);
+00950 <font class="keywordflow">if</font>(dataTmp[m].capacity()&lt;mipMapSz)
+00951 {
+00952 <font class="keywordflow">throw</font> EAllocationFailure();
+00953 }
+00954 uint32 wBlockCount= wtmp/4;
+00955
+00956
+00957
+00958 <font class="keywordflow">for</font>(i=0; i &lt; <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].size(); i+=8)
+00959 {
+00960 uint16 color0;
+00961 uint16 color1;
+00962 uint32 bits;
+00963 memcpy(&amp;color0,&amp;<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][i],2);
+00964 memcpy(&amp;color1,&amp;<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][i+2],2);
+00965 memcpy(&amp;bits,&amp;<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][i+4],4);
+00966
+00967 <a class="code" href="classNLMISC_1_1CBitmap.html#f0">uncompress</a>(color0,c[0]);
+00968 <a class="code" href="classNLMISC_1_1CBitmap.html#f0">uncompress</a>(color1,c[1]);
+00969
+00970 c[0].<a class="code" href="classNLMISC_1_1CRGBA.html#m3">A</a>= 0;
+00971 c[1].<a class="code" href="classNLMISC_1_1CRGBA.html#m3">A</a>= 0;
+00972 c[2].<a class="code" href="classNLMISC_1_1CRGBA.html#m3">A</a>= 0;
+00973 c[3].<a class="code" href="classNLMISC_1_1CRGBA.html#m3">A</a>= 0;
+00974
+00975 <font class="keywordflow">if</font>(color0&gt;color1)
+00976 {
+00977 c[2].<a class="code" href="classNLMISC_1_1CRGBA.html#a7">blendFromui</a>(c[0],c[1],85);
+00978 <font class="keywordflow">if</font>(alpha) c[2].<a class="code" href="classNLMISC_1_1CRGBA.html#m3">A</a>= 255;
+00979
+00980 c[3].<a class="code" href="classNLMISC_1_1CRGBA.html#a7">blendFromui</a>(c[0],c[1],171);
+00981 <font class="keywordflow">if</font>(alpha) c[3].<a class="code" href="classNLMISC_1_1CRGBA.html#m3">A</a>= 255;
+00982 }
+00983 <font class="keywordflow">else</font>
+00984 {
+00985 c[2].<a class="code" href="classNLMISC_1_1CRGBA.html#a7">blendFromui</a>(c[0],c[1],128);
+00986 <font class="keywordflow">if</font>(alpha) c[2].<a class="code" href="classNLMISC_1_1CRGBA.html#m3">A</a>= 255;
+00987
+00988 c[3].<a class="code" href="classNLMISC_1_1CRGBA.html#a10">set</a>(0,0,0,0);
+00989 }
+00990
+00991 <font class="comment">// computing the 16 RGBA of the block</font>
+00992
+00993 uint32 blockNum= i/8; <font class="comment">//(64 bits)</font>
+00994 <font class="comment">// &lt;previous blocks in above lines&gt; * 4 (rows) * _Width (columns) + 4pix*4rgba*&lt;same line previous blocks&gt;</font>
+00995 uint32 pixelsCount= 4*(blockNum/wBlockCount)*wtmp*4 + 4*4*(blockNum%wBlockCount);
+00996 <font class="keywordflow">for</font>(j=0; j&lt;4; j++)
+00997 {
+00998 <font class="keywordflow">for</font>(k=0; k&lt;4; k++)
+00999 {
+01000 dataTmp[m][pixelsCount + j*wtmp*4 + 4*k]= c[bits&amp;3].<a class="code" href="classNLMISC_1_1CRGBA.html#m0">R</a>;
+01001 dataTmp[m][pixelsCount + j*wtmp*4 + 4*k+1]= c[bits&amp;3].<a class="code" href="classNLMISC_1_1CRGBA.html#m1">G</a>;
+01002 dataTmp[m][pixelsCount + j*wtmp*4 + 4*k+2]= c[bits&amp;3].<a class="code" href="classNLMISC_1_1CRGBA.html#m2">B</a>;
+01003 dataTmp[m][pixelsCount + j*wtmp*4 + 4*k+3]= c[bits&amp;3].<a class="code" href="classNLMISC_1_1CRGBA.html#m3">A</a>;
+01004 bits&gt;&gt;=2;
+01005 }
+01006 }
+01007 }
+01008
+01009 <font class="comment">// Copy result into the mipmap level.</font>
+01010 <font class="keywordflow">if</font>(wtmp==<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a> &amp;&amp; htmp==<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>)
+01011 {
+01012 <font class="comment">// For mipmaps level &gt;4 pixels.</font>
+01013 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m]= dataTmp[m];
+01014 }
+01015 <font class="keywordflow">else</font>
+01016 {
+01017 <font class="comment">// For last mipmaps, level &lt;4 pixels.</font>
+01018 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].resize(<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>*<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>*4);
+01019 CRGBA *<a class="code" href="driver__opengl__extension__def_8h.html#a409">src</a>= (CRGBA*)&amp;dataTmp[m][0];
+01020 CRGBA *dst= (CRGBA*)&amp;<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][0];
+01021 uint <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>,<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>;
+01022 <font class="keywordflow">for</font>(<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>=0;<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>&lt;<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>;<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>++)
+01023 {
+01024 <font class="keywordflow">for</font>(<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>=0;<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>&lt;<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>;<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>++)
+01025 dst[<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>*<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>+<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>]= <a class="code" href="driver__opengl__extension__def_8h.html#a409">src</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>*wtmp+<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>];
+01026 }
+01027 }
+01028
+01029 <font class="comment">// Next mipmap size.</font>
+01030 <a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a> = (<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>+1)/2;
+01031 <a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a> = (<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>+1)/2;
+01032 }
+01033 <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#s11s0">RGBA</a>;
+01034 <font class="keywordflow">return</font> <font class="keyword">true</font>;
+01035 }
+01036
+01037
+01038
+01039
+01040 <font class="comment">/*-------------------------------------------------------------------*\</font>
+01041 <font class="comment"> decompressDXT3</font>
+01042 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l01043"></a><a class="code" href="classNLMISC_1_1CBitmap.html#c4">01043</a> <font class="keywordtype">bool</font> CBitmap::decompressDXT3()
+01044 {
+01045 uint32 i,j,k;
+01046 <a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a> c[4];
+01047 std::vector&lt;uint8&gt; dataTmp[<a class="code" href="namespaceNLMISC.html#a4">MAX_MIPMAP</a>];
+01048
+01049 uint32 <a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>= <a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>;
+01050 uint32 <a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>= <a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a>;
+01051
+01052 <font class="keywordflow">for</font>(uint8 m= 0; m&lt;<a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>; m++)
+01053 {
+01054 uint32 wtmp, htmp;
+01055 <font class="keywordflow">if</font>(<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>&lt;4)
+01056 wtmp = 4;
+01057 <font class="keywordflow">else</font>
+01058 wtmp = <a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>;
+01059 <font class="keywordflow">if</font>(<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a> &lt; 4)
+01060 htmp = 4;
+01061 <font class="keywordflow">else</font>
+01062 htmp = <a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>;
+01063 uint32 mipMapSz = wtmp*htmp*4;
+01064 dataTmp[m].resize(mipMapSz);
+01065 <font class="keywordflow">if</font>(dataTmp[m].capacity()&lt;mipMapSz)
+01066 {
+01067 <font class="keywordflow">throw</font> EAllocationFailure();
+01068 }
+01069 uint32 wBlockCount= wtmp/4;
+01070
+01071
+01072 <font class="keywordflow">for</font>(i=0; i &lt; <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].size(); i+=16)
+01073 {
+01074 uint8 <a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[16];
+01075 uint64 alphatmp;
+01076 memcpy(&amp;alphatmp,&amp;<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][i],8);
+01077
+01078 <font class="keywordflow">for</font>(j=0; j&lt;16; j++)
+01079 {
+01080 uint8 a= (uint8)(alphatmp&amp;15);
+01081 <font class="comment">// expand to 0-255.</font>
+01082 <a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[j]= a+(a&lt;&lt;4);
+01083 alphatmp&gt;&gt;=4;
+01084 }
+01085
+01086
+01087 uint16 color0;
+01088 uint16 color1;
+01089 uint32 bits;
+01090 memcpy(&amp;color0,&amp;<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][i+8],2);
+01091 memcpy(&amp;color1,&amp;<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][i+10],2);
+01092 memcpy(&amp;bits,&amp;<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][i+12],4);
+01093
+01094 <a class="code" href="classNLMISC_1_1CBitmap.html#f0">uncompress</a>(color0,c[0]);
+01095 <a class="code" href="classNLMISC_1_1CBitmap.html#f0">uncompress</a>(color1,c[1]);
+01096
+01097 <font class="comment">// ignore color0&gt;color1 for DXT3 and DXT5.</font>
+01098 c[2].<a class="code" href="classNLMISC_1_1CRGBA.html#a7">blendFromui</a>(c[0],c[1],85);
+01099 c[3].<a class="code" href="classNLMISC_1_1CRGBA.html#a7">blendFromui</a>(c[0],c[1],171);
+01100
+01101 <font class="comment">// computing the 16 RGBA of the block</font>
+01102
+01103 uint32 blockNum= i/16; <font class="comment">//(128 bits)</font>
+01104 <font class="comment">// &lt;previous blocks in above lines&gt; * 4 (rows) * wtmp (columns) + 4pix*4rgba*&lt;same line previous blocks&gt;</font>
+01105 uint32 pixelsCount= 4*(blockNum/wBlockCount)*wtmp*4 + 4*4*(blockNum%wBlockCount);
+01106 <font class="keywordflow">for</font>(j=0; j&lt;4; j++)
+01107 {
+01108 <font class="keywordflow">for</font>(k=0; k&lt;4; k++)
+01109 {
+01110 dataTmp[m][pixelsCount + j*wtmp*4 + 4*k]= c[bits&amp;3].<a class="code" href="classNLMISC_1_1CRGBA.html#m0">R</a>;
+01111 dataTmp[m][pixelsCount + j*wtmp*4 + 4*k+1]= c[bits&amp;3].<a class="code" href="classNLMISC_1_1CRGBA.html#m1">G</a>;
+01112 dataTmp[m][pixelsCount + j*wtmp*4 + 4*k+2]= c[bits&amp;3].<a class="code" href="classNLMISC_1_1CRGBA.html#m2">B</a>;
+01113 dataTmp[m][pixelsCount + j*wtmp*4 + 4*k+3]= <a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[4*j+k];
+01114 bits&gt;&gt;=2;
+01115 }
+01116 }
+01117 }
+01118
+01119 <font class="comment">// Copy result into the mipmap level.</font>
+01120 <font class="keywordflow">if</font>(wtmp==<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a> &amp;&amp; htmp==<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>)
+01121 {
+01122 <font class="comment">// For mipmaps level &gt;4 pixels.</font>
+01123 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m]= dataTmp[m];
+01124 }
+01125 <font class="keywordflow">else</font>
+01126 {
+01127 <font class="comment">// For last mipmaps, level &lt;4 pixels.</font>
+01128 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].resize(<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>*<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>*4);
+01129 CRGBA *<a class="code" href="driver__opengl__extension__def_8h.html#a409">src</a>= (CRGBA*)&amp;dataTmp[m][0];
+01130 CRGBA *dst= (CRGBA*)&amp;<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][0];
+01131 uint <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>,<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>;
+01132 <font class="keywordflow">for</font>(<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>=0;<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>&lt;<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>;<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>++)
+01133 {
+01134 <font class="keywordflow">for</font>(<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>=0;<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>&lt;<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>;<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>++)
+01135 dst[<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>*<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>+<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>]= <a class="code" href="driver__opengl__extension__def_8h.html#a409">src</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>*wtmp+<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>];
+01136 }
+01137 }
+01138
+01139 <font class="comment">// Next mipmap size.</font>
+01140 <a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a> = (<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>+1)/2;
+01141 <a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a> = (<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>+1)/2;
+01142 }
+01143 <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#s11s0">RGBA</a>;
+01144 <font class="keywordflow">return</font> <font class="keyword">true</font>;
+01145 }
+01146
+01147
+01148
+01149
+01150 <font class="comment">/*-------------------------------------------------------------------*\</font>
+01151 <font class="comment"> decompressDXT5</font>
+01152 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l01153"></a><a class="code" href="classNLMISC_1_1CBitmap.html#c5">01153</a> <font class="keywordtype">bool</font> CBitmap::decompressDXT5()
+01154 {
+01155 uint32 i,j,k;
+01156 <a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a> c[4];
+01157 std::vector&lt;uint8&gt; dataTmp[<a class="code" href="namespaceNLMISC.html#a4">MAX_MIPMAP</a>];
+01158
+01159 uint32 <a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>= <a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>;
+01160 uint32 <a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>= <a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a>;
+01161
+01162 <font class="keywordflow">for</font>(uint8 m= 0; m&lt;<a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>; m++)
+01163 {
+01164 uint32 wtmp, htmp;
+01165 <font class="keywordflow">if</font>(<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>&lt;4)
+01166 wtmp = 4;
+01167 <font class="keywordflow">else</font>
+01168 wtmp = <a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>;
+01169 <font class="keywordflow">if</font>(<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a> &lt; 4)
+01170 htmp = 4;
+01171 <font class="keywordflow">else</font>
+01172 htmp = <a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>;
+01173 uint32 mipMapSz = wtmp*htmp*4;
+01174 dataTmp[m].resize(mipMapSz);
+01175 <font class="keywordflow">if</font>(dataTmp[m].capacity()&lt;mipMapSz)
+01176 {
+01177 <font class="keywordflow">throw</font> EAllocationFailure();
+01178 }
+01179 uint32 wBlockCount= wtmp/4;
+01180
+01181
+01182
+01183 <font class="keywordflow">for</font>(i=0; i &lt; <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].size(); i+=16)
+01184 {
+01185 uint64 bitsAlpha;
+01186 memcpy(&amp;bitsAlpha,&amp;<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][i],8);
+01187 bitsAlpha&gt;&gt;= 16;
+01188
+01189 uint32 <a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[8];
+01190 <a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[0]= <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][i+0];
+01191 <a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[1]= <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][i+1];
+01192
+01193 <font class="keywordflow">if</font>(<a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[0]&gt;<a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[1])
+01194 {
+01195 <a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[2]= <a class="code" href="classNLMISC_1_1CBitmap.html#c0">blend</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[0], <a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[1], 219);
+01196 <a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[3]= <a class="code" href="classNLMISC_1_1CBitmap.html#c0">blend</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[0], <a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[1], 183);
+01197 <a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[4]= <a class="code" href="classNLMISC_1_1CBitmap.html#c0">blend</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[0], <a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[1], 146);
+01198 <a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[5]= <a class="code" href="classNLMISC_1_1CBitmap.html#c0">blend</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[0], <a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[1], 110);
+01199 <a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[6]= <a class="code" href="classNLMISC_1_1CBitmap.html#c0">blend</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[0], <a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[1], 73);
+01200 <a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[7]= <a class="code" href="classNLMISC_1_1CBitmap.html#c0">blend</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[0], <a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[1], 37);
+01201 }
+01202 <font class="keywordflow">else</font>
+01203 {
+01204 <a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[2]= <a class="code" href="classNLMISC_1_1CBitmap.html#c0">blend</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[0], <a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[1], 204);
+01205 <a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[3]= <a class="code" href="classNLMISC_1_1CBitmap.html#c0">blend</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[0], <a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[1], 154);
+01206 <a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[4]= <a class="code" href="classNLMISC_1_1CBitmap.html#c0">blend</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[0], <a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[1], 102);
+01207 <a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[5]= <a class="code" href="classNLMISC_1_1CBitmap.html#c0">blend</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[0], <a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[1], 51);
+01208 <a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[6]= 0;
+01209 <a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[7]= 255;
+01210 }
+01211
+01212 uint8 codeAlpha[16];
+01213 <font class="keywordflow">for</font>(j=0; j&lt;16; j++)
+01214 {
+01215 codeAlpha[j] = (uint8)bitsAlpha &amp; 7;
+01216 bitsAlpha&gt;&gt;=3;
+01217 }
+01218
+01219
+01220 uint16 color0;
+01221 uint16 color1;
+01222 uint32 bits;
+01223 memcpy(&amp;color0,&amp;<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][i+8],2);
+01224 memcpy(&amp;color1,&amp;<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][i+10],2);
+01225 memcpy(&amp;bits,&amp;<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][i+12],4);
+01226
+01227 <a class="code" href="classNLMISC_1_1CBitmap.html#f0">uncompress</a>(color0,c[0]);
+01228 <a class="code" href="classNLMISC_1_1CBitmap.html#f0">uncompress</a>(color1,c[1]);
+01229
+01230 <font class="comment">// ignore color0&gt;color1 for DXT3 and DXT5.</font>
+01231 c[2].<a class="code" href="classNLMISC_1_1CRGBA.html#a7">blendFromui</a>(c[0],c[1],85);
+01232 c[3].<a class="code" href="classNLMISC_1_1CRGBA.html#a7">blendFromui</a>(c[0],c[1],171);
+01233
+01234 <font class="comment">// computing the 16 RGBA of the block</font>
+01235
+01236 uint32 blockNum= i/16; <font class="comment">//(128 bits)</font>
+01237
+01238 <font class="comment">// &lt;previous blocks in above lines&gt; * 4 (rows) * wtmp (columns) + 4pix*&lt;same line previous blocks&gt;</font>
+01239 uint32 pixelsCount= (blockNum/wBlockCount)*wtmp*4 + 4*(blockNum%wBlockCount);
+01240 <font class="comment">// *sizeof(RGBA)</font>
+01241 pixelsCount*=4;
+01242 <font class="keywordflow">for</font>(j=0; j&lt;4; j++)
+01243 {
+01244 <font class="keywordflow">for</font>(k=0; k&lt;4; k++)
+01245 {
+01246 dataTmp[m][pixelsCount + (j*wtmp+k)*4 +0]= c[bits&amp;3].<a class="code" href="classNLMISC_1_1CRGBA.html#m0">R</a>;
+01247 dataTmp[m][pixelsCount + (j*wtmp+k)*4 +1]= c[bits&amp;3].<a class="code" href="classNLMISC_1_1CRGBA.html#m1">G</a>;
+01248 dataTmp[m][pixelsCount + (j*wtmp+k)*4 +2]= c[bits&amp;3].<a class="code" href="classNLMISC_1_1CRGBA.html#m2">B</a>;
+01249 dataTmp[m][pixelsCount + (j*wtmp+k)*4 +3]= (uint8) <a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>[codeAlpha[4*j+k]];
+01250 bits&gt;&gt;=2;
+01251 }
+01252 }
+01253
+01254 }
+01255
+01256 <font class="comment">// Copy result into the mipmap level.</font>
+01257 <font class="keywordflow">if</font>(wtmp==<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a> &amp;&amp; htmp==<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>)
+01258 {
+01259 <font class="comment">// For mipmaps level &gt;4 pixels.</font>
+01260 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m]= dataTmp[m];
+01261 }
+01262 <font class="keywordflow">else</font>
+01263 {
+01264 <font class="comment">// For last mipmaps, level &lt;4 pixels.</font>
+01265 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m].resize(<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>*<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>*4);
+01266 CRGBA *<a class="code" href="driver__opengl__extension__def_8h.html#a409">src</a>= (CRGBA*)&amp;dataTmp[m][0];
+01267 CRGBA *dst= (CRGBA*)&amp;<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[m][0];
+01268 uint <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>,<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>;
+01269 <font class="keywordflow">for</font>(<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>=0;<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>&lt;<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>;<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>++)
+01270 {
+01271 <font class="keywordflow">for</font>(<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>=0;<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>&lt;<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>;<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>++)
+01272 dst[<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>*<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>+<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>]= <a class="code" href="driver__opengl__extension__def_8h.html#a409">src</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>*wtmp+<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>];
+01273 }
+01274 }
+01275
+01276 <font class="comment">// Next mipmap size.</font>
+01277 <a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a> = (<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>+1)/2;
+01278 <a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a> = (<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>+1)/2;
+01279 }
+01280 <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#s11s0">RGBA</a>;
+01281 <font class="keywordflow">return</font> <font class="keyword">true</font>;
+01282
+01283 }
+01284
+01285
+01286
+01287
+01288 <font class="comment">/*-------------------------------------------------------------------*\</font>
+01289 <font class="comment"> blend</font>
+01290 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l01291"></a><a class="code" href="classNLMISC_1_1CBitmap.html#c0">01291</a> uint32 CBitmap::blend(uint32 &amp;n0, uint32 &amp;n1, uint32 coef0)
+01292 {
+01293 <font class="keywordtype">int</font> a0 = coef0;
+01294 <font class="keywordtype">int</font> a1 = 256-a0;
+01295 <font class="keywordflow">return</font> ((n0*a0 + n1*a1) &gt;&gt;8);
+01296 }
+01297
+01298
+01299
+01300 <font class="comment">/*-------------------------------------------------------------------*\</font>
+01301 <font class="comment"> uncompress</font>
+01302 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l01303"></a><a class="code" href="classNLMISC_1_1CBitmap.html#f0">01303</a> <font class="keyword">inline</font> <font class="keywordtype">void</font> CBitmap::uncompress(uint16 color, <a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a> &amp;<a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>)
+01304 {
+01305 r.<a class="code" href="classNLMISC_1_1CRGBA.html#m3">A</a>= 0;
+01306 r.<a class="code" href="classNLMISC_1_1CRGBA.html#m0">R</a>= ((color&gt;&gt;11)&amp;31) &lt;&lt; 3; r.<a class="code" href="classNLMISC_1_1CRGBA.html#m0">R</a>+= r.<a class="code" href="classNLMISC_1_1CRGBA.html#m0">R</a>&gt;&gt;5;
+01307 r.<a class="code" href="classNLMISC_1_1CRGBA.html#m1">G</a>= ((color&gt;&gt;5)&amp;63) &lt;&lt; 2; r.<a class="code" href="classNLMISC_1_1CRGBA.html#m1">G</a>+= r.<a class="code" href="classNLMISC_1_1CRGBA.html#m1">G</a>&gt;&gt;6;
+01308 r.<a class="code" href="classNLMISC_1_1CRGBA.html#m2">B</a>= ((color)&amp;31) &lt;&lt; 3; r.<a class="code" href="classNLMISC_1_1CRGBA.html#m2">B</a>+= r.<a class="code" href="classNLMISC_1_1CRGBA.html#m2">B</a>&gt;&gt;5;
+01309 }
+01310
+01311
+01312
+01313 <font class="comment">/*-------------------------------------------------------------------*\</font>
+01314 <font class="comment"> getWidth</font>
+01315 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l01316"></a><a class="code" href="classNLMISC_1_1CBitmap.html#a6">01316</a> uint32 CBitmap::getWidth(uint32 mipMap)<font class="keyword"> const</font>
+01317 <font class="keyword"></font>{
+01318 <font class="keywordflow">if</font>(mipMap==0) <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>;
+01319
+01320 uint32 <a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>;
+01321 uint32 h = <a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a>;
+01322 uint32 m = 0;
+01323
+01324 <font class="keywordflow">do</font>
+01325 {
+01326 m++;
+01327 <a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a> = (<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>+1)/2;
+01328 h = (h+1)/2;
+01329 <font class="keywordflow">if</font>(m==mipMap) <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>;
+01330 }
+01331 <font class="keywordflow">while</font>(<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>!=1 || h!=1);
+01332
+01333 <font class="keywordflow">return</font> 0;
+01334 }
+01335
+01336
+01337
+01338 <font class="comment">/*-------------------------------------------------------------------*\</font>
+01339 <font class="comment"> getHeight</font>
+01340 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l01341"></a><a class="code" href="classNLMISC_1_1CBitmap.html#a7">01341</a> uint32 CBitmap::getHeight(uint32 mipMap)<font class="keyword"> const</font>
+01342 <font class="keyword"></font>{
+01343 <font class="keywordflow">if</font>(mipMap==0) <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a>;
+01344
+01345 uint32 <a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>;
+01346 uint32 h = <a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a>;
+01347 uint32 m = 0;
+01348
+01349 <font class="keywordflow">do</font>
+01350 {
+01351 m++;
+01352 <a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a> = (<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>+1)/2;
+01353 h = (h+1)/2;
+01354 <font class="keywordflow">if</font>(m==mipMap) <font class="keywordflow">return</font> h;
+01355 }
+01356 <font class="keywordflow">while</font>(<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>!=1 || h!=1);
+01357
+01358 <font class="keywordflow">return</font> 0;
+01359 }
+01360
+01361
+01362 <font class="comment">/*-------------------------------------------------------------------*\</font>
+01363 <font class="comment"> getHeight</font>
+01364 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l01365"></a><a class="code" href="classNLMISC_1_1CBitmap.html#a8">01365</a> uint32 CBitmap::getSize(uint32 numMipMap)<font class="keyword"> const</font>
+01366 <font class="keyword"></font>{
+01367 <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1CBitmap.html#a7">getHeight</a>(numMipMap)*<a class="code" href="classNLMISC_1_1CBitmap.html#a6">getWidth</a>(numMipMap);
+01368 }
+01369
+01370
+01371
+01372 <font class="comment">/*-------------------------------------------------------------------*\</font>
+01373 <font class="comment"> buildMipMaps</font>
+01374 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l01375"></a><a class="code" href="classNLMISC_1_1CBitmap.html#a11">01375</a> <font class="keywordtype">void</font> CBitmap::buildMipMaps()
+01376 {
+01377 uint32 i,j;
+01378
+01379 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a>!=<a class="code" href="classNLMISC_1_1CBitmap.html#s11s0">RGBA</a>) <font class="keywordflow">return</font>;
+01380 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>!=1) <font class="keywordflow">return</font>;
+01381 <font class="keywordflow">if</font>(!<a class="code" href="namespaceNLMISC.html#a225">NLMISC::isPowerOf2</a>(<a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>)) <font class="keywordflow">return</font>;
+01382 <font class="keywordflow">if</font>(!<a class="code" href="namespaceNLMISC.html#a225">NLMISC::isPowerOf2</a>(<a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a>)) <font class="keywordflow">return</font>;
+01383
+01384 uint32 <a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>;
+01385 uint32 h = <a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a>;
+01386
+01387 <font class="keywordflow">while</font>(<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>&gt;1 || h&gt;1)
+01388 {
+01389 uint32 precw = <a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>;
+01390 uint32 prech = h;
+01391 <a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a> = (<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>+1)/2;
+01392 h = (h+1)/2;
+01393 uint32 mulw= precw/<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>;
+01394 uint32 mulh= prech/h;
+01395
+01396 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[<a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>].resize(<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>*h*4);
+01397
+01398
+01399 <a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a> *pRgba = (<a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a>*)&amp;<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[<a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>][0];
+01400 <a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a> *pRgbaPrev = (<a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a>*)&amp;<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[<a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>-1][0];
+01401 <font class="keywordflow">for</font>(i=0; i&lt;h; i++)
+01402 {
+01403 sint i0= mulh*i;
+01404 sint i1= mulh*i+1;
+01405 <font class="keywordflow">if</font>(mulh==1)
+01406 i1=i0;
+01407 i0*=precw;
+01408 i1*=precw;
+01409 <font class="keywordflow">for</font>(j=0; j&lt;<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>; j++)
+01410 {
+01411 sint j0= mulw*j;
+01412 sint j1= mulw*j+1;
+01413 <font class="keywordflow">if</font>(mulh==1)
+01414 j1=j0;
+01415 CRGBA &amp;c0= pRgbaPrev[i0+j0];
+01416 CRGBA &amp;c1= pRgbaPrev[i0+j1];
+01417 CRGBA &amp;c2= pRgbaPrev[i1+j0];
+01418 CRGBA &amp;c3= pRgbaPrev[i1+j1];
+01419 pRgba[i*<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a> + j].R = (c0.R +
+01420 c1.R +
+01421 c2.R +
+01422 c3.R + 2 ) /4;
+01423 pRgba[i*<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a> + j].G = (c0.G +
+01424 c1.G +
+01425 c2.G +
+01426 c3.G + 2 ) /4;
+01427 pRgba[i*<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a> + j].B = (c0.B +
+01428 c1.B +
+01429 c2.B +
+01430 c3.B + 2 ) /4;
+01431 pRgba[i*<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a> + j].A = (c0.A +
+01432 c1.A +
+01433 c2.A +
+01434 c3.A + 2 ) /4;
+01435 }
+01436 }
+01437
+01438 <a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>++;
+01439 }
+01440 }
+01441
+01442
+01443 <font class="comment">/*-------------------------------------------------------------------*\</font>
+01444 <font class="comment"> releaseMipMaps</font>
+01445 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l01446"></a><a class="code" href="classNLMISC_1_1CBitmap.html#a12">01446</a> <font class="keywordtype">void</font> CBitmap::releaseMipMaps()
+01447 {
+01448 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>&lt;=1) <font class="keywordflow">return</font>;
+01449
+01450 <a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>=1;
+01451 <font class="keywordflow">for</font>(sint i=1;i&lt;<a class="code" href="namespaceNLMISC.html#a4">MAX_MIPMAP</a>;i++)
+01452 {
+01453 <a class="code" href="namespaceNLMISC.html#a222">NLMISC::contReset</a>(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[i]);
+01454 }
+01455 }
+01456
+01457
+01458 <font class="comment">/*-------------------------------------------------------------------*\</font>
+01459 <font class="comment"> resample</font>
+01460 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l01461"></a><a class="code" href="classNLMISC_1_1CBitmap.html#a14">01461</a> <font class="keywordtype">void</font> CBitmap::resample(sint32 nNewWidth, sint32 nNewHeight)
+01462 {
+01463 <a class="code" href="debug_8h.html#a6">nlassert</a>(<a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> == <a class="code" href="classNLMISC_1_1CBitmap.html#s11s0">RGBA</a>);
+01464 <font class="keywordtype">bool</font> needRebuild = <font class="keyword">false</font>;
+01465
+01466 <font class="comment">// Deleting mipmaps</font>
+01467 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>&gt;1)
+01468 needRebuild = <font class="keyword">true</font>;
+01469 <a class="code" href="classNLMISC_1_1CBitmap.html#a12">releaseMipMaps</a>();
+01470
+01471 <font class="keywordflow">if</font>(nNewWidth==0 || nNewHeight==0)
+01472 {
+01473 <a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a> = 0;
+01474 <font class="keywordflow">return</font>;
+01475 }
+01476
+01477 std::vector&lt;uint8&gt; pDestui;
+01478 pDestui.resize(nNewWidth*nNewHeight*4);
+01479 <a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a> *pDestRgba = (<a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a>*)&amp;pDestui[0];
+01480
+01481 <a class="code" href="classNLMISC_1_1CBitmap.html#c6">resamplePicture32</a> ((<a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a>*)&amp;<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0][0], pDestRgba, <a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>, <a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a>, nNewWidth, nNewHeight);
+01482 <a class="code" href="namespaceNLMISC.html#a222">NLMISC::contReset</a>(_Data[0]); <font class="comment">// free memory</font>
+01483 _Data[0] = pDestui;
+01484 <a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>= nNewWidth;
+01485 <a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a>= nNewHeight;
+01486
+01487 <font class="comment">// Rebuilding mipmaps</font>
+01488 <font class="keywordflow">if</font>(needRebuild)
+01489 {
+01490 <a class="code" href="classNLMISC_1_1CBitmap.html#a11">buildMipMaps</a>();
+01491 }
+01492 }
+01493
+01494
+01495 <font class="comment">/*-------------------------------------------------------------------*\</font>
+01496 <font class="comment"> resize</font>
+01497 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l01498"></a><a class="code" href="classNLMISC_1_1CBitmap.html#a15">01498</a> <font class="keywordtype">void</font> CBitmap::resize (sint32 nNewWidth, sint32 nNewHeight, TType newType)
+01499 {
+01500 <font class="comment">// Deleting mipmaps</font>
+01501 <a class="code" href="classNLMISC_1_1CBitmap.html#a12">releaseMipMaps</a>();
+01502
+01503 <font class="comment">// Change type of bitmap ?</font>
+01504 <font class="keywordflow">if</font> (newType!=<a class="code" href="classNLMISC_1_1CBitmap.html#s11s10">DonTKnow</a>)
+01505 <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a>=newType;
+01506
+01507 <a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a> = nNewWidth;
+01508 <a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a> = nNewHeight;
+01509
+01510 <font class="comment">// resize the level 0 only.</font>
+01511 <a class="code" href="classNLMISC_1_1CBitmap.html#a16">resizeMipMap</a>(0, nNewWidth, nNewHeight);
+01512 }
+01513
+01514
+01515 <font class="comment">/*-------------------------------------------------------------------*\</font>
+01516 <font class="comment"> resizeMipMap</font>
+01517 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l01518"></a><a class="code" href="classNLMISC_1_1CBitmap.html#a16">01518</a> <font class="keywordtype">void</font> CBitmap::resizeMipMap (uint32 numMipMap, sint32 nNewWidth, sint32 nNewHeight)
+01519 {
+01520 <a class="code" href="debug_8h.html#a6">nlassert</a>(numMipMap&lt;<a class="code" href="namespaceNLMISC.html#a4">MAX_MIPMAP</a>);
+01521
+01522 <font class="comment">// free memory</font>
+01523 <a class="code" href="namespaceNLMISC.html#a222">NLMISC::contReset</a>(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[numMipMap]);
+01524
+01525 <font class="comment">// DXTC compressed??</font>
+01526 <font class="keywordtype">bool</font> isDXTC= <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a>==<a class="code" href="classNLMISC_1_1CBitmap.html#s11s4">DXTC1</a> || <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a>==<a class="code" href="classNLMISC_1_1CBitmap.html#s11s5">DXTC1Alpha</a> || <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a>==<a class="code" href="classNLMISC_1_1CBitmap.html#s11s6">DXTC3</a> || <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a>==<a class="code" href="classNLMISC_1_1CBitmap.html#s11s7">DXTC5</a>;
+01527 <font class="comment">// if yes, must round up width and height to 4, for allocation</font>
+01528 nNewWidth= 4*((nNewWidth+3)/4);
+01529 nNewHeight= 4*((nNewHeight+3)/4);
+01530
+01531 <font class="comment">// resize the buffer</font>
+01532 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[numMipMap].resize (((uint32)(nNewWidth*nNewHeight)*<a class="code" href="classNLMISC_1_1CBitmap.html#p0">bitPerPixels</a>[<a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a>])/8);
+01533 }
+01534
+01535
+01536 <font class="comment">/*-------------------------------------------------------------------*\</font>
+01537 <font class="comment"> reset</font>
+01538 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l01539"></a><a class="code" href="classNLMISC_1_1CBitmap.html#a17">01539</a> <font class="keywordtype">void</font> CBitmap::setMipMapCount(uint32 mmc)
+01540 {
+01541 <a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>= <a class="code" href="memory__common_8h.html#a7">uint8</a>(mmc);
+01542 }
+01543
+01544
+01545 <font class="comment">/*-------------------------------------------------------------------*\</font>
+01546 <font class="comment"> reset</font>
+01547 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l01548"></a><a class="code" href="classNLMISC_1_1CBitmap.html#a13">01548</a> <font class="keywordtype">void</font> CBitmap::reset(TType <a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>)
+01549 {
+01550 <font class="keywordflow">for</font>(uint i=0; i&lt;<a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>; i++)
+01551 {
+01552 <a class="code" href="namespaceNLMISC.html#a222">NLMISC::contReset</a>(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[i]);
+01553 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[i].resize(0);
+01554 }
+01555 <a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a> = 0;
+01556 <a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>= 1;
+01557
+01558 <font class="comment">// Change pixel format</font>
+01559 <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a>=<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>;
+01560 }
+01561
+01562
+01563
+01564 <font class="comment">/*-------------------------------------------------------------------*\</font>
+01565 <font class="comment"> resamplePicture32</font>
+01566 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l01567"></a><a class="code" href="classNLMISC_1_1CBitmap.html#c6">01567</a> <font class="keywordtype">void</font> CBitmap::resamplePicture32 (<font class="keyword">const</font> <a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a> *pSrc, <a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a> *pDest,
+01568 sint32 nSrcWidth, sint32 nSrcHeight,
+01569 sint32 nDestWidth, sint32 nDestHeight)
+01570 {
+01571 <font class="keywordflow">if</font> ((nSrcWidth&lt;=0)||(nSrcHeight&lt;=0)||(nDestHeight&lt;=0)||(nDestHeight&lt;=0))
+01572 <font class="keywordflow">return</font>;
+01573 <font class="keywordtype">bool</font> bXMag=(nDestWidth&gt;=nSrcWidth);
+01574 <font class="keywordtype">bool</font> bYMag=(nDestHeight&gt;=nSrcHeight);
+01575 <font class="keywordtype">bool</font> bXEq=(nDestWidth==nSrcWidth);
+01576 <font class="keywordtype">bool</font> bYEq=(nDestHeight==nSrcHeight);
+01577 std::vector&lt;NLMISC::CRGBAF&gt; pIterm (nDestWidth*nSrcHeight);
+01578
+01579 <font class="keywordflow">if</font> (bXMag)
+01580 {
+01581 <font class="keywordtype">float</font> fXdelta=(float)(nSrcWidth)/(float)(nDestWidth);
+01582 <a class="code" href="classNLMISC_1_1CRGBAF.html">NLMISC::CRGBAF</a> *pItermPtr=&amp;*pIterm.begin();
+01583 sint32 nY;
+01584 <font class="keywordflow">for</font> (nY=0; nY&lt;nSrcHeight; nY++)
+01585 {
+01586 <font class="keyword">const</font> <a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a> *pSrcLine=pSrc;
+01587 <font class="keywordtype">float</font> fX=0.f;
+01588 sint32 nX;
+01589 <font class="keywordflow">for</font> (nX=0; nX&lt;nDestWidth; nX++)
+01590 {
+01591 <font class="keywordtype">float</font> fVirgule=fX-(float)floor(fX);
+01592 <a class="code" href="debug_8h.html#a6">nlassert</a> (fVirgule&gt;=0.f);
+01593 <a class="code" href="classNLMISC_1_1CRGBAF.html">NLMISC::CRGBAF</a> vColor;
+01594 <font class="keywordflow">if</font> (fVirgule&gt;=0.5f)
+01595 {
+01596 <font class="keywordflow">if</font> (fX&lt;(float)(nSrcWidth-1))
+01597 {
+01598 <a class="code" href="classNLMISC_1_1CRGBAF.html">NLMISC::CRGBAF</a> vColor1 (pSrcLine[(sint32)floor(fX)]);
+01599 <a class="code" href="classNLMISC_1_1CRGBAF.html">NLMISC::CRGBAF</a> vColor2 (pSrcLine[(sint32)floor(fX)+1]);
+01600 vColor=vColor1*(1.5f-fVirgule)+vColor2*(fVirgule-0.5f);
+01601 }
+01602 <font class="keywordflow">else</font>
+01603 vColor=<a class="code" href="classNLMISC_1_1CRGBAF.html">NLMISC::CRGBAF</a> (pSrcLine[(sint32)floor(fX)]);
+01604 }
+01605 <font class="keywordflow">else</font>
+01606 {
+01607 <font class="keywordflow">if</font> (fX&gt;=1.f)
+01608 {
+01609 <a class="code" href="classNLMISC_1_1CRGBAF.html">NLMISC::CRGBAF</a> vColor1 (pSrcLine[(sint32)floor(fX)]);
+01610 <a class="code" href="classNLMISC_1_1CRGBAF.html">NLMISC::CRGBAF</a> vColor2 (pSrcLine[(sint32)floor(fX)-1]);
+01611 vColor=vColor1*(0.5f+fVirgule)+vColor2*(0.5f-fVirgule);
+01612 }
+01613 <font class="keywordflow">else</font>
+01614 vColor=<a class="code" href="classNLMISC_1_1CRGBAF.html">NLMISC::CRGBAF</a> (pSrcLine[(sint32)floor(fX)]);
+01615 }
+01616 *(pItermPtr++)=vColor;
+01617 fX+=fXdelta;
+01618 }
+01619 pSrc+=nSrcWidth;
+01620 }
+01621 }
+01622 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (bXEq)
+01623 {
+01624 <a class="code" href="classNLMISC_1_1CRGBAF.html">NLMISC::CRGBAF</a> *pItermPtr=&amp;*pIterm.begin();
+01625 <font class="keywordflow">for</font> (sint32 nY=0; nY&lt;nSrcHeight; nY++)
+01626 {
+01627 <font class="keyword">const</font> <a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a> *pSrcLine=pSrc;
+01628 sint32 nX;
+01629 <font class="keywordflow">for</font> (nX=0; nX&lt;nDestWidth; nX++)
+01630 *(pItermPtr++)=<a class="code" href="classNLMISC_1_1CRGBAF.html">NLMISC::CRGBAF</a> (pSrcLine[nX]);
+01631 pSrc+=nSrcWidth;
+01632 }
+01633 }
+01634 <font class="keywordflow">else</font>
+01635 {
+01636 <font class="keywordtype">double</font> fXdelta=(double)(nSrcWidth)/(double)(nDestWidth);
+01637 <a class="code" href="debug_8h.html#a6">nlassert</a> (fXdelta&gt;1.f);
+01638 <a class="code" href="classNLMISC_1_1CRGBAF.html">NLMISC::CRGBAF</a> *pItermPtr=&amp;*pIterm.begin();
+01639 sint32 nY;
+01640 <font class="keywordflow">for</font> (nY=0; nY&lt;nSrcHeight; nY++)
+01641 {
+01642 <font class="keyword">const</font> <a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a> *pSrcLine=pSrc;
+01643 <font class="keywordtype">double</font> fX=0.f;
+01644 sint32 nX;
+01645 <font class="keywordflow">for</font> (nX=0; nX&lt;nDestWidth; nX++)
+01646 {
+01647 <a class="code" href="classNLMISC_1_1CRGBAF.html">NLMISC::CRGBAF</a> vColor (0.f, 0.f, 0.f, 0.f);
+01648 <font class="keywordtype">double</font> fFinal=fX+fXdelta;
+01649 <font class="keywordflow">while</font> (fX&lt;fFinal)
+01650 {
+01651 <font class="keywordtype">double</font> fNext=(double)floor (fX)+1.f;
+01652 <font class="keywordflow">if</font> (fNext&gt;fFinal)
+01653 fNext=fFinal;
+01654 vColor+=((float)(fNext-fX))*<a class="code" href="classNLMISC_1_1CRGBAF.html">NLMISC::CRGBAF</a> (pSrcLine[(sint32)floor(fX)]);
+01655 fX=fNext;
+01656 }
+01657 <a class="code" href="debug_8h.html#a6">nlassert</a> (fX==fFinal);
+01658 vColor/=(float)fXdelta;
+01659 *(pItermPtr++)=vColor;
+01660 }
+01661 pSrc+=nSrcWidth;
+01662 }
+01663 }
+01664
+01665 <font class="keywordflow">if</font> (bYMag)
+01666 {
+01667 <font class="keywordtype">double</font> fYdelta=(double)(nSrcHeight)/(double)(nDestHeight);
+01668 sint32 nX;
+01669 <font class="keywordflow">for</font> (nX=0; nX&lt;nDestWidth; nX++)
+01670 {
+01671 <font class="keywordtype">double</font> fY=0.f;
+01672 sint32 nY;
+01673 <font class="keywordflow">for</font> (nY=0; nY&lt;nDestHeight; nY++)
+01674 {
+01675 <font class="keywordtype">double</font> fVirgule=fY-(double)floor(fY);
+01676 <a class="code" href="debug_8h.html#a6">nlassert</a> (fVirgule&gt;=0.f);
+01677 <a class="code" href="classNLMISC_1_1CRGBAF.html">NLMISC::CRGBAF</a> vColor;
+01678 <font class="keywordflow">if</font> (fVirgule&gt;=0.5f)
+01679 {
+01680 <font class="keywordflow">if</font> (fY&lt;(double)(nSrcHeight-1))
+01681 {
+01682 <a class="code" href="classNLMISC_1_1CRGBAF.html">NLMISC::CRGBAF</a> vColor1=pIterm[((sint32)floor(fY))*nDestWidth+nX];
+01683 <a class="code" href="classNLMISC_1_1CRGBAF.html">NLMISC::CRGBAF</a> vColor2=pIterm[(((sint32)floor(fY))+1)*nDestWidth+nX];
+01684 vColor=vColor1*(1.5f-(float)fVirgule)+vColor2*((float)fVirgule-0.5f);
+01685 }
+01686 <font class="keywordflow">else</font>
+01687 vColor=pIterm[((sint32)floor(fY))*nDestWidth+nX];
+01688 }
+01689 <font class="keywordflow">else</font>
+01690 {
+01691 <font class="keywordflow">if</font> (fY&gt;=1.f)
+01692 {
+01693 <a class="code" href="classNLMISC_1_1CRGBAF.html">NLMISC::CRGBAF</a> vColor1=pIterm[((sint32)floor(fY))*nDestWidth+nX];
+01694 <a class="code" href="classNLMISC_1_1CRGBAF.html">NLMISC::CRGBAF</a> vColor2=pIterm[(((sint32)floor(fY))-1)*nDestWidth+nX];
+01695 vColor=vColor1*(0.5f+(float)fVirgule)+vColor2*(0.5f-(float)fVirgule);
+01696 }
+01697 <font class="keywordflow">else</font>
+01698 vColor=pIterm[((sint32)floor(fY))*nDestWidth+nX];
+01699 }
+01700 pDest[nX+nY*nDestWidth]=vColor;
+01701 fY+=fYdelta;
+01702 }
+01703 }
+01704 }
+01705 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (bYEq)
+01706 {
+01707 <font class="keywordflow">for</font> (sint32 nX=0; nX&lt;nDestWidth; nX++)
+01708 {
+01709 sint32 nY;
+01710 <font class="keywordflow">for</font> (nY=0; nY&lt;nDestHeight; nY++)
+01711 {
+01712 pDest[nX+nY*nDestWidth]=pIterm[nY*nDestWidth+nX];
+01713 }
+01714 }
+01715 }
+01716 <font class="keywordflow">else</font>
+01717 {
+01718 <font class="keywordtype">double</font> fYdelta=(double)(nSrcHeight)/(double)(nDestHeight);
+01719 <a class="code" href="debug_8h.html#a6">nlassert</a> (fYdelta&gt;1.f);
+01720 sint32 nX;
+01721 <font class="keywordflow">for</font> (nX=0; nX&lt;nDestWidth; nX++)
+01722 {
+01723 <font class="keywordtype">double</font> fY=0.f;
+01724 sint32 nY;
+01725 <font class="keywordflow">for</font> (nY=0; nY&lt;nDestHeight; nY++)
+01726 {
+01727 <a class="code" href="classNLMISC_1_1CRGBAF.html">NLMISC::CRGBAF</a> vColor (0.f, 0.f, 0.f, 0.f);
+01728 <font class="keywordtype">double</font> fFinal=fY+fYdelta;
+01729 <font class="keywordflow">while</font> ((fY&lt;fFinal)&amp;&amp;((sint32)fY!=nSrcHeight))
+01730 {
+01731 <font class="keywordtype">double</font> fNext=(double)floor (fY)+1.f;
+01732 <font class="keywordflow">if</font> (fNext&gt;fFinal)
+01733 fNext=fFinal;
+01734 vColor+=((float)(fNext-fY))*pIterm[((sint32)floor(fY))*nDestWidth+nX];
+01735 fY=fNext;
+01736 }
+01737 vColor/=(float)fYdelta;
+01738 pDest[nX+nY*nDestWidth]=vColor;
+01739 }
+01740 }
+01741 }
+01742 }
+01743
+01744
+01745
+01746 <font class="comment">/*-------------------------------------------------------------------*\</font>
+01747 <font class="comment"> readTGA</font>
+01748 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l01749"></a><a class="code" href="classNLMISC_1_1CBitmap.html#c2">01749</a> uint8 CBitmap::readTGA( <a class="code" href="classNLMISC_1_1IStream.html">NLMISC::IStream</a> &amp;f)
+01750 {
+01751 <font class="keywordflow">if</font>(!f.<a class="code" href="classNLMISC_1_1IStream.html#a4">isReading</a>()) <font class="keywordflow">return</font> 0;
+01752
+01753 uint32 size;
+01754 uint32 <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>,<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>;
+01755 sint32 slsize;
+01756 uint8 *scanline;
+01757 uint8 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>,g,b;
+01758 sint32 i,j,k;
+01759
+01760 <font class="comment">// TGA file header fields</font>
+01761 uint8 lengthID;
+01762 uint8 cMapType;
+01763 uint8 imageType;
+01764 uint16 origin;
+01765 uint16 length;
+01766 uint8 <a class="code" href="driver__opengl__extension__def_8h.html#a391">depth</a>;
+01767 uint16 xOrg;
+01768 uint16 yOrg;
+01769 uint16 <a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>;
+01770 uint16 <a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>;
+01771 uint8 imageDepth;
+01772 uint8 desc;
+01773
+01774 <font class="comment">// Image/Color map data</font>
+01775 uint8 *imageID;
+01776
+01777
+01778
+01779 <font class="comment">// Determining whether file is in Original or New TGA format</font>
+01780
+01781 <font class="keywordtype">bool</font> newTgaFormat;
+01782 uint32 extAreaOffset;
+01783 uint32 devDirectoryOffset;
+01784 <font class="keywordtype">char</font> signature[16];
+01785
+01786 f.<a class="code" href="classNLMISC_1_1IStream.html#a31">seek</a> (0, f.<a class="code" href="classNLMISC_1_1IStream.html#s3s2">end</a>);
+01787 newTgaFormat = <font class="keyword">false</font>;
+01788 <font class="keywordflow">if</font> (f.<a class="code" href="classNLMISC_1_1IStream.html#a32">getPos</a>() &gt;= 26)
+01789 {
+01790 f.<a class="code" href="classNLMISC_1_1IStream.html#a31">seek</a> (-26, f.<a class="code" href="classNLMISC_1_1IStream.html#s3s2">end</a>);
+01791 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(extAreaOffset);
+01792 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(devDirectoryOffset);
+01793 <font class="keywordflow">for</font>(i=0; i&lt;16; i++)
+01794 {
+01795 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(signature[i]);
+01796 }
+01797 <font class="keywordflow">if</font>(strncmp(signature,<font class="stringliteral">"TRUEVISION-XFILE"</font>,16)==0)
+01798 newTgaFormat = <font class="keyword">true</font>;
+01799 }
+01800
+01801
+01802
+01803 <font class="comment">// Reading TGA file header</font>
+01804 f.<a class="code" href="classNLMISC_1_1IStream.html#a31">seek</a> (0, f.<a class="code" href="classNLMISC_1_1IStream.html#s3s0">begin</a>);
+01805
+01806 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(lengthID);
+01807 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(cMapType);
+01808 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(imageType);
+01809 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(origin);
+01810 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(length);
+01811 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a391">depth</a>);
+01812 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(xOrg);
+01813 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(yOrg);
+01814 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>);
+01815 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>);
+01816 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(imageDepth);
+01817 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(desc);
+01818
+01819 <font class="keywordflow">if</font>(cMapType!=0)
+01820 {
+01821 <a class="code" href="debug_8h.html#a1">nlinfo</a>(<font class="stringliteral">"readTga : color-map not supported"</font>);
+01822 }
+01823
+01824 <font class="keywordflow">if</font>(lengthID&gt;0)
+01825 {
+01826 imageID = <font class="keyword">new</font> uint8[lengthID];
+01827 <font class="keywordflow">for</font>(i=0; i&lt;lengthID; i++)
+01828 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(imageID[i]);
+01829 }
+01830
+01831
+01832
+01833 <font class="comment">// Reading TGA image data</font>
+01834
+01835 <a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a> = <a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>;
+01836 <a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a> = <a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>;
+01837 size = <a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a> * <a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a> * (imageDepth/8);
+01838
+01839 <font class="keywordflow">switch</font>(imageType)
+01840 {
+01841 <font class="comment">// Uncompressed RGB or RGBA</font>
+01842 <font class="keywordflow">case</font> 2:
+01843 {
+01844 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0].resize(<a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>*<a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a>*4);
+01845 uint8 upSideDown = ((desc &amp; (1 &lt;&lt; 5))==0);
+01846 slsize = <a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a> * imageDepth / 8;
+01847
+01848 scanline = <font class="keyword">new</font> uint8[slsize];
+01849 <font class="keywordflow">if</font>(!scanline)
+01850 {
+01851 <font class="keywordflow">throw</font> EAllocationFailure();
+01852 }
+01853
+01854 <font class="keywordflow">for</font>(<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>=0; <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>&lt;<a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a>;<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>++)
+01855 {
+01856 <font class="comment">// Serial buffer: more efficient way to load.</font>
+01857 f.<a class="code" href="classNLMISC_1_1IStream.html#z327_0">serialBuffer</a> (scanline, slsize);
+01858
+01859 <font class="keywordflow">if</font>(imageDepth==24 || imageDepth==32)
+01860 {
+01861 sint32 mult = 3;
+01862 <font class="keywordflow">if</font>(imageDepth==16)
+01863 {
+01864 mult = 2;
+01865 }
+01866 <font class="keywordflow">if</font>(imageDepth==32)
+01867 {
+01868 mult = 4;
+01869 }
+01870 <font class="keywordflow">if</font>(imageDepth!=16)
+01871 {
+01872 <font class="keywordflow">for</font>(<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>=0; <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>&lt;<a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>; <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>++)
+01873 {
+01874 <font class="comment">// RGB(A)</font>
+01875 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> = scanline[<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>*mult+0];
+01876 g = scanline[<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>*mult+1];
+01877 b = scanline[<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>*mult+2];
+01878 <font class="comment">// Switching to BGR(A)</font>
+01879 scanline[<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>*mult+0] = b;
+01880 scanline[<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>*mult+1] = g;
+01881 scanline[<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>*mult+2] = <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
+01882 }
+01883 }
+01884 }
+01885
+01886 k=0;
+01887 <font class="keywordflow">for</font>(i=0; i&lt;<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>; i++)
+01888 {
+01889 <font class="keywordflow">if</font>(upSideDown)
+01890 {
+01891 <font class="keywordflow">if</font>(imageDepth==16)
+01892 {
+01893 uint16 <a class="code" href="namespaceNLMISC.html#a294">toto</a> = (uint16)scanline[k++];
+01894 <a class="code" href="namespaceNLMISC.html#a294">toto</a> |= scanline[k++]&lt;&lt;8;
+01895 uint <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> = <a class="code" href="namespaceNLMISC.html#a294">toto</a>&gt;&gt;10;
+01896 uint g = (<a class="code" href="namespaceNLMISC.html#a294">toto</a>&gt;&gt;5)&amp;0x1f;
+01897 uint b = <a class="code" href="namespaceNLMISC.html#a294">toto</a>&amp;0x1f;
+01898 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0][(<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>-<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>-1)*<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>*4 + 4*i] = (r&lt;&lt;3) | (r&gt;&gt;2);
+01899 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0][(<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>-<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>-1)*<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>*4 + 4*i + 1] = (g&lt;&lt;3) | (g&gt;&gt;2);
+01900 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0][(<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>-<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>-1)*<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>*4 + 4*i + 2] = (b&lt;&lt;3) | (b&gt;&gt;2);
+01901 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0][(<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>-<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>-1)*<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>*4 + 4*i + 3] = 255;
+01902 }
+01903 <font class="keywordflow">else</font>
+01904 {
+01905 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0][(<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>-<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>-1)*<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>*4 + 4*i] = scanline[k++];
+01906 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0][(<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>-<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>-1)*<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>*4 + 4*i + 1] = scanline[k++];
+01907 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0][(<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>-<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>-1)*<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>*4 + 4*i + 2] = scanline[k++];
+01908 <font class="keywordflow">if</font>(imageDepth==32)
+01909 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0][(<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>-<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>-1)*<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>*4 + 4*i + 3] = scanline[k++];
+01910 <font class="keywordflow">else</font>
+01911 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0][(<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>-<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>-1)*<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>*4 + 4*i + 3] = 255;
+01912 }
+01913 }
+01914 <font class="keywordflow">else</font>
+01915 {
+01916 <font class="keywordflow">if</font>(imageDepth==16)
+01917 {
+01918 uint16 <a class="code" href="namespaceNLMISC.html#a294">toto</a> = (uint16)scanline[k++];
+01919 <a class="code" href="namespaceNLMISC.html#a294">toto</a> |= scanline[k++]&lt;&lt;8;
+01920 <font class="keywordtype">int</font> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> = <a class="code" href="namespaceNLMISC.html#a294">toto</a>&gt;&gt;10;
+01921 <font class="keywordtype">int</font> g = <a class="code" href="namespaceNLMISC.html#a294">toto</a>&amp;(0x3e0)&gt;&gt;5;
+01922 <font class="keywordtype">int</font> b = <a class="code" href="namespaceNLMISC.html#a294">toto</a>&amp;0x1f;
+01923 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0][<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>*<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>*4 + 4*i] = (r&lt;&lt;3) | (r&gt;&gt;2);
+01924 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0][<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>*<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>*4 + 4*i + 1] = (g&lt;&lt;3) | (g&gt;&gt;2);
+01925 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0][<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>*<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>*4 + 4*i + 2] = (b&lt;&lt;3) | (b&gt;&gt;2);
+01926 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0][<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>*<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>*4 + 4*i + 3] = 255;
+01927 }
+01928 <font class="keywordflow">else</font>
+01929 {
+01930 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0][<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>*<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>*4 + 4*i] = scanline[k++];
+01931 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0][<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>*<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>*4 + 4*i + 1] = scanline[k++];
+01932 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0][<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>*<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>*4 + 4*i + 2] = scanline[k++];
+01933 <font class="keywordflow">if</font>(imageDepth==32)
+01934 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0][<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>*<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>*4 + 4*i + 3] = scanline[k++];
+01935 <font class="keywordflow">else</font>
+01936 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0][<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>*<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>*4 + 4*i + 3] = 255;
+01937 }
+01938 }
+01939 }
+01940 }
+01941
+01942 <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#s11s0">RGBA</a>;
+01943 <font class="keyword">delete</font> scanline;
+01944 };
+01945 <font class="keywordflow">break</font>;
+01946
+01947 <font class="comment">// Uncompressed Grayscale bitmap</font>
+01948 <font class="keywordflow">case</font> 3:
+01949 {
+01950 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0].resize(<a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>*<a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a>);
+01951 uint8 upSideDown = ((desc &amp; (1 &lt;&lt; 5))==0);
+01952 slsize = <a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>;
+01953
+01954 scanline = <font class="keyword">new</font> uint8[slsize];
+01955 <font class="keywordflow">if</font>(!scanline)
+01956 {
+01957 <font class="keywordflow">throw</font> EAllocationFailure();
+01958 }
+01959
+01960 <font class="keywordflow">for</font>(<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>=0; <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>&lt;<a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a>;<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>++)
+01961 {
+01962 <font class="comment">// Serial buffer: more efficient way to load.</font>
+01963 f.<a class="code" href="classNLMISC_1_1IStream.html#z327_0">serialBuffer</a> (scanline, slsize);
+01964
+01965 k=0;
+01966 <font class="keywordflow">for</font>(i=0; i&lt;<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>; i++)
+01967 {
+01968 <font class="keywordflow">if</font>(upSideDown)
+01969 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0][(<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>-<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>-1)*<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a> + i] = scanline[k++];
+01970 <font class="keywordflow">else</font>
+01971 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0][<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>*<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a> + i] = scanline[k++];
+01972 }
+01973 }
+01974
+01975 <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#n2">_LoadGrayscaleAsAlpha</a>?<a class="code" href="classNLMISC_1_1CBitmap.html#s11s2">Alpha</a>:<a class="code" href="classNLMISC_1_1CBitmap.html#s11s1">Luminance</a>;
+01976 <font class="keyword">delete</font> scanline;
+01977 };
+01978 <font class="keywordflow">break</font>;
+01979
+01980 <font class="comment">// Compressed RGB or RGBA</font>
+01981 <font class="keywordflow">case</font> 10:
+01982 {
+01983 uint8 packet;
+01984 uint8 pixel[4];
+01985 uint32 <a class="code" href="driver__opengl__extension__def_8h.html#a393">imageSize</a> = <a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>*<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>;
+01986 uint32 readSize = 0;
+01987 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0].reserve(<a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>*<a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a>*4);
+01988
+01989 <font class="keywordflow">while</font>(readSize &lt; <a class="code" href="driver__opengl__extension__def_8h.html#a393">imageSize</a>)
+01990 {
+01991 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(packet);
+01992 <font class="keywordflow">if</font>((packet &amp; 0x80) &gt; 0) <font class="comment">// packet RLE </font>
+01993 {
+01994 <font class="keywordflow">for</font>(i=0; i&lt;imageDepth/8; i++)
+01995 {
+01996 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(pixel[i]);
+01997 }
+01998 <font class="keywordflow">for</font> (i=0; i &lt; (packet &amp; 0x7F) + 1; i++)
+01999 {
+02000 <font class="keywordflow">for</font>(j=0; j&lt;imageDepth/8; j++)
+02001 {
+02002 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0].push_back(pixel[j]);
+02003 }
+02004 <font class="keywordflow">if</font>(imageDepth==24)
+02005 {
+02006 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0].push_back(0);
+02007 }
+02008 }
+02009 }
+02010 <font class="keywordflow">else</font> <font class="comment">// packet Raw </font>
+02011 {
+02012 <font class="keywordflow">for</font>(i=0; i&lt;((packet &amp; 0x7F) + 1); i++)
+02013 {
+02014 <font class="keywordflow">for</font>(j=0; j&lt;imageDepth/8; j++)
+02015 {
+02016 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(pixel[j]);
+02017 }
+02018 <font class="keywordflow">if</font>(imageDepth==32)
+02019 {
+02020 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0].push_back(pixel[2]);
+02021 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0].push_back(pixel[1]);
+02022 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0].push_back(pixel[0]);
+02023 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0].push_back(pixel[3]);
+02024 }
+02025 <font class="keywordflow">if</font>(imageDepth==24)
+02026 {
+02027 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0].push_back(pixel[2]);
+02028 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0].push_back(pixel[1]);
+02029 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0].push_back(pixel[0]);
+02030 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0].push_back(0);
+02031 }
+02032 }
+02033 }
+02034 readSize += (packet &amp; 0x7F) + 1;
+02035 }
+02036 <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#s11s0">RGBA</a>;
+02037 };
+02038 <font class="keywordflow">break</font>;
+02039
+02040 <font class="comment">// Compressed Grayscale bitmap (not tested)</font>
+02041 <font class="keywordflow">case</font> 11:
+02042 {
+02043 uint8 packet;
+02044 uint8 pixel[4];
+02045 uint32 <a class="code" href="driver__opengl__extension__def_8h.html#a393">imageSize</a> = <a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>*<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>;
+02046 uint32 readSize = 0;
+02047 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0].reserve(<a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>*<a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a>);
+02048
+02049 <font class="keywordflow">while</font>(readSize &lt; <a class="code" href="driver__opengl__extension__def_8h.html#a393">imageSize</a>)
+02050 {
+02051 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(packet);
+02052 <font class="keywordflow">if</font>((packet &amp; 0x80) &gt; 0) <font class="comment">// packet RLE </font>
+02053 {
+02054 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(pixel[0]);
+02055 <font class="keywordflow">for</font> (i=0; i &lt; (packet &amp; 0x7F) + 1; i++)
+02056 {
+02057 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0].push_back(pixel[0]);
+02058 }
+02059 }
+02060 <font class="keywordflow">else</font> <font class="comment">// packet Raw </font>
+02061 {
+02062 <font class="keywordflow">for</font>(i=0; i&lt;((packet &amp; 0x7F) + 1); i++)
+02063 {
+02064 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(pixel[0]);
+02065 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0].push_back(pixel[0]);
+02066 }
+02067 }
+02068 readSize += (packet &amp; 0x7F) + 1;
+02069 }
+02070 <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#n2">_LoadGrayscaleAsAlpha</a>?<a class="code" href="classNLMISC_1_1CBitmap.html#s11s2">Alpha</a>:<a class="code" href="classNLMISC_1_1CBitmap.html#s11s1">Luminance</a>;
+02071 };
+02072 <font class="keywordflow">break</font>;
+02073
+02074 <font class="keywordflow">default</font>:
+02075 <font class="keywordflow">return</font> 0;
+02076 }
+02077
+02078 <a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a> = 1;
+02079 <font class="keywordflow">return</font>(imageDepth);
+02080
+02081 }
+02082
+02083 <font class="comment">/*-------------------------------------------------------------------*\</font>
+02084 <font class="comment"> writeTGA</font>
+02085 <font class="comment">\*-------------------------------------------------------------------*/</font>
+<a name="l02086"></a><a class="code" href="classNLMISC_1_1CBitmap.html#a18">02086</a> <font class="keywordtype">bool</font> CBitmap::writeTGA( <a class="code" href="classNLMISC_1_1IStream.html">NLMISC::IStream</a> &amp;f, uint32 d, <font class="keywordtype">bool</font> upsideDown)
+02087 {
+02088 <font class="keywordflow">if</font>(f.<a class="code" href="classNLMISC_1_1IStream.html#a4">isReading</a>()) <font class="keywordflow">return</font> <font class="keyword">false</font>;
+02089 <font class="keywordflow">if</font>(d!=24 &amp;&amp; d!=32 &amp;&amp; d!=16 &amp;&amp; d!=8) <font class="keywordflow">return</font> <font class="keyword">false</font>;
+02090 <font class="keywordflow">if</font> ((<a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> != <a class="code" href="classNLMISC_1_1CBitmap.html#s11s0">RGBA</a>)&amp;&amp;(<a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> != <a class="code" href="classNLMISC_1_1CBitmap.html#s11s2">Alpha</a>)) <font class="keywordflow">return</font> <font class="keyword">false</font>;
+02091 <font class="keywordflow">if</font> ((<a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> == <a class="code" href="classNLMISC_1_1CBitmap.html#s11s2">Alpha</a>) &amp;&amp; (d != 8)) <font class="keywordflow">return</font> <font class="keyword">false</font>;
+02092
+02093 sint32 i,j,<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>,<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>;
+02094 uint8 * scanline;
+02095 uint8 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>,g,b,a;
+02096
+02097 uint8 lengthID = 0;
+02098 uint8 cMapType = 0;
+02099 uint8 imageType = 2;
+02100 uint16 origin = 0;
+02101 uint16 length = 0;
+02102 uint8 <a class="code" href="driver__opengl__extension__def_8h.html#a391">depth</a> = 0;
+02103 uint16 xOrg = 0;
+02104 uint16 yOrg = 0;
+02105 uint16 <a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a> = (uint16)<a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>;
+02106 uint16 <a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a> = (uint16)<a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a>;
+02107 uint8 imageDepth = (uint8)d;
+02108 uint8 desc = 0;
+02109 <font class="keywordflow">if</font> (upsideDown)
+02110 desc |= 1&lt;&lt;5;
+02111
+02112 <font class="keywordflow">if</font> (<a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> == <a class="code" href="classNLMISC_1_1CBitmap.html#s11s2">Alpha</a>)
+02113 imageType = 3; <font class="comment">// Uncompressed grayscale</font>
+02114
+02115 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(lengthID);
+02116 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(cMapType);
+02117 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(imageType);
+02118 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(origin);
+02119 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(length);
+02120 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a391">depth</a>);
+02121 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(xOrg);
+02122 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(yOrg);
+02123 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>);
+02124 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>);
+02125 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(imageDepth);
+02126 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(desc);
+02127
+02128 <font class="keywordflow">if</font> (<a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> == <a class="code" href="classNLMISC_1_1CBitmap.html#s11s2">Alpha</a>)
+02129 scanline = <font class="keyword">new</font> uint8[<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>];
+02130 <font class="keywordflow">else</font>
+02131 scanline = <font class="keyword">new</font> uint8[<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>*4];
+02132 <font class="keywordflow">if</font>(!scanline)
+02133 {
+02134 <font class="keywordflow">throw</font> EAllocationFailure();
+02135 }
+02136
+02137 <font class="keywordflow">for</font>(<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>=0; <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>&lt;(sint32)<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>; <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>++)
+02138 {
+02139
+02140 uint32 k=0;
+02141 <font class="keywordflow">if</font> (<a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> == <a class="code" href="classNLMISC_1_1CBitmap.html#s11s2">Alpha</a>)
+02142 <font class="keywordflow">for</font>(i=0; i&lt;<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>; ++i) <font class="comment">// Alpha</font>
+02143 {
+02144 scanline[k++] = <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0][(<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>-<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>-1)*<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a> + i];
+02145 }
+02146 <font class="keywordflow">else</font>
+02147 <font class="keywordflow">for</font>(i=0; i&lt;<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>*4; i+=4) <font class="comment">// 4:RGBA</font>
+02148 {
+02149 <font class="keywordflow">if</font>(d==16)
+02150 {
+02151 <font class="keywordflow">for</font>(j=0; j&lt;(sint32)4; j++)
+02152 {
+02153 scanline[k++] = <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0][(<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>-<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>-1)*<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>*4 + i + j];
+02154 }
+02155 }
+02156 <font class="keywordflow">else</font>
+02157 {
+02158 <font class="keywordflow">for</font>(j=0; j&lt;(sint32)d/8; j++)
+02159 {
+02160 scanline[k++] = <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0][(<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>-<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>-1)*<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>*4 + i + j];
+02161 }
+02162 }
+02163 }
+02164
+02165 <font class="keywordflow">if</font>(d==16)
+02166 {
+02167 <font class="keywordflow">for</font>(<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>=0; <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>&lt;(sint32)<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>; <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>++)
+02168 {
+02169 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> = scanline[<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>*4+0];
+02170 g = scanline[<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>*4+1];
+02171 b = scanline[<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>*4+2];
+02172 <font class="keywordtype">int</font> rr = <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> &gt;&gt;3;
+02173 <font class="keywordtype">int</font> gg = g &gt;&gt;3;
+02174 <font class="keywordtype">int</font> bb = b &gt;&gt;3;
+02175 uint16 c16 = (rr&lt;&lt;10) | (gg&lt;&lt;5) | bb;
+02176 scanline[<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>*2+0] = c16&amp;0xff;
+02177 scanline[<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>*2+1] = c16&gt;&gt;8;
+02178 }
+02179 }
+02180 <font class="keywordflow">if</font>(d==24)
+02181 {
+02182 <font class="keywordflow">for</font>(<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>=0; <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>&lt;(sint32)<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>; <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>++)
+02183 {
+02184 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> = scanline[<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>*3+0];
+02185 g = scanline[<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>*3+1];
+02186 b = scanline[<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>*3+2];
+02187 scanline[<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>*3+0] = b;
+02188 scanline[<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>*3+1] = g;
+02189 scanline[<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>*3+2] = <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
+02190 }
+02191 }
+02192 <font class="keywordflow">if</font>(d==32)
+02193 {
+02194 <font class="keywordflow">for</font>(<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>=0; <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>&lt;(sint32)<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>; <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>++)
+02195 {
+02196 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> = scanline[<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>*4+0];
+02197 g = scanline[<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>*4+1];
+02198 b = scanline[<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>*4+2];
+02199 a= scanline[<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>*4+3];
+02200 scanline[<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>*4+0] = b;
+02201 scanline[<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>*4+1] = g;
+02202 scanline[<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>*4+2] = <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
+02203 scanline[<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>*4+3] = a;
+02204 }
+02205 }
+02206
+02207 <font class="keywordtype">int</font> finaleSize=<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>*d/8;
+02208 <font class="keywordflow">for</font>(i=0; i&lt;finaleSize; i++)
+02209 {
+02210 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(scanline[i]);
+02211 }
+02212 }
+02213 <font class="keyword">delete</font> scanline;
+02214 <font class="keywordflow">return</font> <font class="keyword">true</font>;
+02215 }
+02216
+02217 <font class="keyword">template</font>&lt;<font class="keyword">class</font> T&gt;
+02218 <font class="keywordtype">void</font> <a class="code" href="namespaceNLMISC.html#a287">rotateCCW</a> (<font class="keyword">const</font> T* <a class="code" href="driver__opengl__extension__def_8h.html#a409">src</a>, T* dst, uint srcWidth, uint srcHeight)
+02219 {
+02220 <font class="keywordflow">for</font> (uint <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>=0; <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>&lt;srcHeight; <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>++)
+02221 <font class="keywordflow">for</font> (uint <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>=0; <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>&lt;srcWidth; <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>++)
+02222 {
+02223 uint dstX=<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>;
+02224 uint dstY=srcWidth-<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>-1;
+02225 dst[dstX+dstY*srcHeight]=<a class="code" href="driver__opengl__extension__def_8h.html#a409">src</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>+<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>*srcWidth];
+02226 }
+02227 }
+02228
+02229 <font class="comment">/*template&lt;class T&gt;</font>
+02230 <font class="comment">void rotateCCW (const vector&lt;T&gt;&amp; src, vector&lt;T&gt;&amp; dst, uint srcWidth, uint srcHeight)</font>
+02231 <font class="comment">{</font>
+02232 <font class="comment"> for (uint y=0; y&lt;srcHeight; y++)</font>
+02233 <font class="comment"> for (uint x=0; x&lt;srcWidth; x++)</font>
+02234 <font class="comment"> {</font>
+02235 <font class="comment"> uint dstX=y;</font>
+02236 <font class="comment"> uint dstY=srcWidth-x;</font>
+02237 <font class="comment"> dst[dstX+dstY*srcHeight]=src[x+y*srcWidth];</font>
+02238 <font class="comment"> }</font>
+02239 <font class="comment">}</font>
+02240 <font class="comment">*/</font>
+<a name="l02241"></a><a class="code" href="classNLMISC_1_1CBitmap.html#a10">02241</a> <font class="keywordtype">void</font> CBitmap::rotateCCW()
+02242 {
+02243 <font class="comment">// Copy the array</font>
+02244 std::vector&lt;uint8&gt; copy=<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0];
+02245
+02246 <font class="keywordflow">switch</font> (PixelFormat)
+02247 {
+02248 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s0">RGBA</a>:
+02249 <a class="code" href="namespaceNLMISC.html#a287">NLMISC::rotateCCW</a> ((uint32*)&amp;(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0][0]), (uint32*)&amp;(copy[0]), <a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>, <a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a>);
+02250 <font class="keywordflow">break</font>;
+02251 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s1">Luminance</a>:
+02252 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s2">Alpha</a>:
+02253 <a class="code" href="namespaceNLMISC.html#a287">NLMISC::rotateCCW</a> (&amp;<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0][0], &amp;copy[0], <a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>, <a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a>);
+02254 <font class="keywordflow">break</font>;
+02255 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s3">AlphaLuminance</a>:
+02256 <a class="code" href="namespaceNLMISC.html#a287">NLMISC::rotateCCW</a> ((uint16*)&amp;(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0][0]), (uint16*)&amp;(copy[0]), <a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>, <a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a>);;
+02257 <font class="keywordflow">break</font>;
+02258 <font class="keywordflow">default</font>: <font class="keywordflow">break</font>;
+02259 }
+02260
+02261 uint32 tmp=<a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>;
+02262 <a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>=<a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a>;
+02263 <a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a>=tmp;
+02264 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0]=copy;
+02265 }
+02266
+<a name="l02267"></a><a class="code" href="classNLMISC_1_1CBitmap.html#a22">02267</a> <font class="keywordtype">bool</font> CBitmap::blit(<font class="keyword">const</font> CBitmap *<a class="code" href="driver__opengl__extension__def_8h.html#a409">src</a>, sint32 <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>, sint32 <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>)
+02268 {
+02269
+02270 <a class="code" href="debug_8h.html#a6">nlassert</a>(this-&gt;PixelFormat == <a class="code" href="driver__opengl__extension__def_8h.html#a409">src</a>-&gt;PixelFormat);
+02271 <font class="keywordflow">if</font> (this-&gt;<a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> != <a class="code" href="driver__opengl__extension__def_8h.html#a409">src</a>-&gt;PixelFormat)
+02272 {
+02273 <font class="keywordflow">return</font> <font class="keyword">false</font>;
+02274 }
+02275
+02276
+02277 <font class="comment">// check for dxtc use</font>
+02278
+02279 <font class="keyword">const</font> <font class="keywordtype">bool</font> useDXTC = <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> == <a class="code" href="classNLMISC_1_1CBitmap.html#s11s4">DXTC1</a> || <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> == <a class="code" href="classNLMISC_1_1CBitmap.html#s11s5">DXTC1Alpha</a> || <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> == <a class="code" href="classNLMISC_1_1CBitmap.html#s11s6">DXTC3</a> || <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> == <a class="code" href="classNLMISC_1_1CBitmap.html#s11s7">DXTC5</a>;
+02280
+02281 <font class="comment">// number of bits for a 4x4 pix block</font>
+02282 <font class="keyword">const</font> uint dxtcNumBits = <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> == <a class="code" href="classNLMISC_1_1CBitmap.html#s11s4">DXTC1</a> || <a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> == <a class="code" href="classNLMISC_1_1CBitmap.html#s11s5">DXTC1Alpha</a> ? 64 : 128;
+02283
+02284
+02285 <font class="keywordflow">if</font> (useDXTC)
+02286 {
+02287 <font class="comment">// blit pos must be multiple of 4</font>
+02288
+02289 <a class="code" href="debug_8h.html#a6">nlassert</a>(! (<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a> &amp; 3 || <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a> &amp; 3) );
+02290 <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a> &amp; 3 || <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a> &amp; 3) <font class="keywordflow">return</font> <font class="keyword">false</font>;
+02291
+02292 }
+02293
+02294 <a class="code" href="debug_8h.html#a6">nlassert</a>(<a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> != <a class="code" href="classNLMISC_1_1CBitmap.html#s11s10">DonTKnow</a>);
+02295
+02296 <font class="comment">// the width to copy</font>
+02297 sint <a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a> = <a class="code" href="driver__opengl__extension__def_8h.html#a409">src</a>-&gt;_Width;
+02298 <font class="comment">// the height to copy</font>
+02299 sint <a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a> = <a class="code" href="driver__opengl__extension__def_8h.html#a409">src</a>-&gt;_Height;
+02300
+02301 uint destStartX, destStartY;
+02302 uint srcStartX, srcStartY;
+02303
+02304
+02305 <font class="comment">// clip against left</font>
+02306 <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a> &lt; 0)
+02307 {
+02308 <a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a> += <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>;
+02309 <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a> &lt;= 0) <font class="keywordflow">return</font> <font class="keyword">true</font>;
+02310 destStartX = 0;
+02311 srcStartX = -<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>;
+02312 }
+02313 <font class="keywordflow">else</font>
+02314 {
+02315 destStartX = <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>;
+02316 srcStartX = 0;
+02317 }
+02318
+02319 <font class="comment">// clip against top</font>
+02320 <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a> &lt; 0)
+02321 {
+02322 <a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a> += <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>;
+02323 <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a> &lt;= 0) <font class="keywordflow">return</font> <font class="keyword">true</font>;
+02324 srcStartY = -<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>;
+02325 destStartY = 0;
+02326 }
+02327 <font class="keywordflow">else</font>
+02328 {
+02329 destStartY = <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>;
+02330 srcStartY = 0;
+02331 }
+02332
+02333 <font class="comment">// clip against right</font>
+02334 <font class="keywordflow">if</font> ((destStartX + <a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a> - 1) &gt;= <a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>)
+02335 {
+02336 <a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a> - destStartX;
+02337 <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a> &lt;= 0) <font class="keywordflow">return</font> <font class="keyword">true</font>;
+02338 }
+02339
+02340 <font class="comment">// clip against bottom</font>
+02341 <font class="keywordflow">if</font> ((destStartY + <a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a> - 1) &gt;= <a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a>)
+02342 {
+02343 <a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a> - destStartY;
+02344 <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a> &lt;= 0) <font class="keywordflow">return</font> <font class="keyword">true</font>;
+02345 }
+02346
+02347
+02348 <font class="comment">// divide all distance by 4 when using DXTC</font>
+02349 <font class="keywordflow">if</font> (useDXTC)
+02350 {
+02351 destStartX &gt;&gt;= 2;
+02352 destStartY &gt;&gt;= 2;
+02353 srcStartX &gt;&gt;= 2;
+02354 srcStartY &gt;&gt;= 2;
+02355 <a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a> &gt;&gt;= 2;
+02356 <a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a> &gt;&gt;= 2;
+02357 }
+02358
+02359
+02360 <font class="comment">// bytes per pixs is for either one pixel or 16 (a 4x4 block in DXTC)</font>
+02361 <font class="keyword">const</font> uint bytePerPixs = ( useDXTC ? dxtcNumBits : <a class="code" href="classNLMISC_1_1CBitmap.html#p0">bitPerPixels</a>[<a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a>] ) &gt;&gt; 3 <font class="comment">/* divide by 8 to get the number of bytes */</font>;
+02362
+02363
+02364 <font class="keyword">const</font> uint destRealWidth = useDXTC ? (<a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a> &gt;&gt; 2) : <a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>;
+02365 <font class="keyword">const</font> uint srcRealWidth = useDXTC ? (<a class="code" href="driver__opengl__extension__def_8h.html#a409">src</a>-&gt;_Width &gt;&gt; 2) : <a class="code" href="driver__opengl__extension__def_8h.html#a409">src</a>-&gt;_Width;
+02366
+02367
+02368 <font class="comment">// size to go to the next line in the destination</font>
+02369 <font class="keyword">const</font> uint destStride = destRealWidth * bytePerPixs;
+02370
+02371 <font class="comment">// size to go to the next line in the source</font>
+02372 <font class="keyword">const</font> uint srcStride = srcRealWidth * bytePerPixs;
+02373
+02374 <font class="comment">// length in bytes of a line to copy</font>
+02375 <font class="keyword">const</font> uint lineLength = <a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a> * bytePerPixs;
+02376
+02377
+02378 uint8 *destPos = &amp;(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0][0]) + destStride * destStartY + bytePerPixs * destStartX;
+02379 <font class="keyword">const</font> uint8 *srcPos = &amp;(<a class="code" href="driver__opengl__extension__def_8h.html#a409">src</a>-&gt;_Data[0][0]) + srcStride * srcStartY + bytePerPixs * srcStartX;
+02380
+02381 <font class="comment">// copy each hline</font>
+02382 <font class="keywordflow">for</font> (sint k = 0; k &lt; <a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>; ++k)
+02383 {
+02384 ::memcpy(destPos, srcPos, lineLength);
+02385 destPos += destStride;
+02386 srcPos += srcStride;
+02387 }
+02388
+02389
+02390 <font class="keywordflow">return</font> <font class="keyword">true</font>;
+02391 }
+02392
+02393 <font class="comment">// Private :</font>
+<a name="l02394"></a><a class="code" href="classNLMISC_1_1CBitmap.html#c7">02394</a> <font class="keywordtype">float</font> CBitmap::getColorInterp (<font class="keywordtype">float</font> <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>, <font class="keywordtype">float</font> <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>, <font class="keywordtype">float</font> colorInXY00, <font class="keywordtype">float</font> colorInXY10, <font class="keywordtype">float</font> colorInXY01, <font class="keywordtype">float</font> colorInXY11)<font class="keyword"> const</font>
+02395 <font class="keyword"></font>{
+02396 <font class="keywordtype">float</font> <a class="code" href="driver__opengl__extension__def_8h.html#a400">res</a> = colorInXY00*(1.0f-<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>)*(1.0f-<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>) +
+02397 colorInXY10*( x)*(1.0f-<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>) +
+02398 colorInXY01*(1.0f-<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>)*( y) +
+02399 colorInXY11*( x)*( y);
+02400 <a class="code" href="namespaceNLMISC.html#a215">clamp</a> (<a class="code" href="driver__opengl__extension__def_8h.html#a400">res</a>, 0.0f, 255.0f);
+02401 <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a400">res</a>;
+02402 }
+02403
+02404 <font class="comment">// Public:</font>
+<a name="l02405"></a><a class="code" href="classNLMISC_1_1CBitmap.html#a23">02405</a> CRGBAF CBitmap::getColor (<font class="keywordtype">float</font> <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>, <font class="keywordtype">float</font> <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>)<font class="keyword"> const</font>
+02406 <font class="keyword"></font>{
+02407 <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a> &lt; 0.0f) <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a> = 0.0f;
+02408 <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a> &gt; 1.0f) <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a> = 1.0f;
+02409 <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a> &lt; 0.0f) <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a> = 0.0f;
+02410 <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a> &gt; 1.0f) <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a> = 1.0f;
+02411
+02412 sint32 nWidth = <a class="code" href="classNLMISC_1_1CBitmap.html#a6">getWidth</a>(0);
+02413 sint32 nHeight = <a class="code" href="classNLMISC_1_1CBitmap.html#a7">getHeight</a>(0);
+02414
+02415 <font class="keywordflow">if</font> (nWidth == 0 || nHeight == 0) <font class="keywordflow">return</font> CRGBAF(0, 0, 0, 0);
+02416
+02417 <font class="keyword">const</font> std::vector&lt;uint8&gt; &amp;rBitmap = <a class="code" href="classNLMISC_1_1CBitmap.html#z277_0">getPixels</a>(0);
+02418 sint32 nX[4], nY[4];
+02419
+02420 <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a> *= nWidth-1;
+02421 <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a> *= nHeight-1;
+02422
+02423 <font class="comment">// Integer part of (x,y)</font>
+02424 <font class="comment">//nX[0] = ((sint32)floor(x-0.5f));</font>
+02425 <font class="comment">//nY[0] = ((sint32)floor(y-0.5f));</font>
+02426 nX[0] = ((sint32)floor(<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>));
+02427 nY[0] = ((sint32)floor(<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>));
+02428
+02429 nX[1] = (nX[0] &lt; (nWidth-1) ? nX[0]+1 : nX[0]);
+02430 nY[1] = nY[0];
+02431
+02432 nX[2] = nX[0];
+02433 nY[2] = (nY[0] &lt; (nHeight-1) ? nY[0]+1 : nY[0]);
+02434
+02435 nX[3] = nX[1];
+02436 nY[3] = nY[2];
+02437
+02438 uint32 i;
+02439
+02440 <font class="keywordflow">for</font> (i = 0; i &lt; 4; ++i)
+02441 {
+02442 <a class="code" href="debug_8h.html#a6">nlassert</a> (nX[i] &gt;= 0);
+02443 <a class="code" href="debug_8h.html#a6">nlassert</a> (nY[i] &gt;= 0 );
+02444 <a class="code" href="debug_8h.html#a6">nlassert</a> (nX[i] &lt; nWidth);
+02445 <a class="code" href="debug_8h.html#a6">nlassert</a> (nY[i] &lt; nHeight);
+02446 }
+02447
+02448 <font class="comment">// Decimal part of (x,y)</font>
+02449 <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a> = <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a> - (float)nX[0];
+02450 <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a> = <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a> - (float)nY[0];
+02451
+02452 <font class="keywordflow">switch</font> (this-&gt;<a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a>)
+02453 {
+02454 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s0">RGBA</a>:
+02455 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s4">DXTC1</a>:
+02456 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s5">DXTC1Alpha</a>:
+02457 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s6">DXTC3</a>:
+02458 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s7">DXTC5</a>:
+02459 {
+02460 CRGBAF finalVal;
+02461 CRGBA val[4];
+02462
+02463 <font class="keywordflow">if</font> (this-&gt;<a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> == <a class="code" href="classNLMISC_1_1CBitmap.html#s11s0">RGBA</a>)
+02464 {
+02465 <font class="keywordflow">for</font> (i = 0; i &lt; 4; ++i)
+02466 {
+02467 val[i] = CRGBA (rBitmap[(nX[i]+nY[i]*nWidth)*4+0],
+02468 rBitmap[(nX[i]+nY[i]*nWidth)*4+1],
+02469 rBitmap[(nX[i]+nY[i]*nWidth)*4+2],
+02470 rBitmap[(nX[i]+nY[i]*nWidth)*4+3]);
+02471 }
+02472 }
+02473 <font class="keywordflow">else</font>
+02474 {
+02475 <font class="comment">// slower version : get from DXT</font>
+02476 <font class="keywordflow">for</font> (i = 0; i &lt; 4; ++i)
+02477 {
+02478 val[i] = <a class="code" href="classNLMISC_1_1CBitmap.html#a24">getPixelColor</a>(nX[i], nY[i]);
+02479 }
+02480 }
+02481
+02482 finalVal.R = <a class="code" href="classNLMISC_1_1CBitmap.html#c7">getColorInterp</a> (<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>, <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>, val[0].R, val[1].R, val[2].R, val[3].R);
+02483 finalVal.G = <a class="code" href="classNLMISC_1_1CBitmap.html#c7">getColorInterp</a> (<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>, <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>, val[0].G, val[1].G, val[2].G, val[3].G);
+02484 finalVal.B = <a class="code" href="classNLMISC_1_1CBitmap.html#c7">getColorInterp</a> (<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>, <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>, val[0].B, val[1].B, val[2].B, val[3].B);
+02485 finalVal.A = <a class="code" href="classNLMISC_1_1CBitmap.html#c7">getColorInterp</a> (<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>, <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>, val[0].A, val[1].A, val[2].A, val[3].A);
+02486
+02487 <font class="keywordflow">return</font> finalVal;
+02488 }
+02489 <font class="keywordflow">break</font>;
+02490 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s2">Alpha</a>:
+02491 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s1">Luminance</a>:
+02492 {
+02493
+02494 <font class="keywordtype">float</font> finalVal;
+02495 <font class="keywordtype">float</font> val[4];
+02496
+02497 <font class="keywordflow">for</font> (i = 0; i &lt; 4; ++i)
+02498 val[i] = rBitmap[(nX[i]+nY[i]*nWidth)];
+02499
+02500 finalVal = <a class="code" href="classNLMISC_1_1CBitmap.html#c7">getColorInterp</a> (<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>, <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>, val[0], val[1], val[2], val[3]);
+02501
+02502 <font class="keywordflow">if</font> (this-&gt;<a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> == <a class="code" href="classNLMISC_1_1CBitmap.html#s11s2">Alpha</a>)
+02503 <font class="keywordflow">return</font> CRGBAF (255.0f, 255.0f, 255.0f, finalVal);
+02504 <font class="keywordflow">else</font> <font class="comment">// Luminance</font>
+02505 <font class="keywordflow">return</font> CRGBAF (finalVal, finalVal, finalVal, 255.0f);
+02506 }
+02507 <font class="keywordflow">break</font>;
+02508 <font class="keywordflow">default</font>: <font class="keywordflow">break</font>;
+02509 }
+02510
+02511 <font class="keywordflow">return</font> CRGBAF (0.0f, 0.0f, 0.0f, 0.0f);
+02512 }
+02513
+02514
+<a name="l02515"></a><a class="code" href="classNLMISC_1_1CBitmap.html#d0">02515</a> <font class="keywordtype">void</font> CBitmap::loadSize(<a class="code" href="classNLMISC_1_1IStream.html">NLMISC::IStream</a> &amp;f, uint32 &amp;retWidth, uint32 &amp;retHeight)
+02516 {
+02517 retWidth= 0;
+02518 retHeight= 0;
+02519
+02520
+02521 <a class="code" href="debug_8h.html#a6">nlassert</a>(f.<a class="code" href="classNLMISC_1_1IStream.html#a4">isReading</a>());
+02522
+02523 <font class="comment">// testing if DDS</font>
+02524 uint32 fileType = 0;
+02525 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(fileType);
+02526 <font class="keywordflow">if</font>(fileType == <a class="code" href="namespaceNLMISC.html#a2">DDS</a>)
+02527 {
+02528 <font class="comment">// read entire DDS header.</font>
+02529 uint32 size = 0;
+02530 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(size); <font class="comment">// size in Bytes of header(without "DDS")</font>
+02531 uint32 * _DDSSurfaceDesc = <font class="keyword">new</font> uint32[size];
+02532 std::auto_ptr&lt;uint32&gt; _DDSSurfaceDescAuto(_DDSSurfaceDesc);
+02533 _DDSSurfaceDesc[0]= size;
+02534
+02535 <font class="keywordflow">for</font>(uint i= 0; i&lt;size/4 - 1; i++)
+02536 {
+02537 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(_DDSSurfaceDesc[i+1]);
+02538 }
+02539
+02540 <font class="comment">// flags determines which members of the header structure contain valid data</font>
+02541 uint32 flags = _DDSSurfaceDesc[1];
+02542
+02543 <font class="comment">//verify if file have linearsize set</font>
+02544 <font class="keywordflow">if</font>(!(flags &amp; <a class="code" href="bitmap_8h.html#a1">DDSD_LINEARSIZE</a>))
+02545 {
+02546 <font class="keywordflow">throw</font> EDDSBadHeader();
+02547 }
+02548
+02549 <font class="comment">//-------------- extracting and testing useful info</font>
+02550 retWidth = _DDSSurfaceDesc[2];
+02551 retHeight = _DDSSurfaceDesc[3];
+02552 }
+02553 <font class="comment">// assuming it's TGA</font>
+02554 <font class="keywordflow">else</font>
+02555 {
+02556 <font class="keywordflow">if</font>(!f.<a class="code" href="classNLMISC_1_1IStream.html#a31">seek</a> (0, <a class="code" href="classNLMISC_1_1IStream.html#s3s0">NLMISC::IStream::begin</a>))
+02557 {
+02558 <font class="keywordflow">throw</font> ESeekFailed();
+02559 }
+02560
+02561 <font class="comment">// Reading header, </font>
+02562 <font class="comment">// To make sure that the bitmap is TGA, we check imageType and imageDepth.</font>
+02563 uint8 lengthID;
+02564 uint8 cMapType;
+02565 uint8 imageType;
+02566 uint16 tgaOrigin;
+02567 uint16 length;
+02568 uint8 <a class="code" href="driver__opengl__extension__def_8h.html#a391">depth</a>;
+02569 uint16 xOrg;
+02570 uint16 yOrg;
+02571 uint16 <a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>;
+02572 uint16 <a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>;
+02573 uint8 imageDepth;
+02574 uint8 desc;
+02575
+02576 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(lengthID);
+02577 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(cMapType);
+02578 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(imageType);
+02579 <font class="keywordflow">if</font>(imageType!=2 &amp;&amp; imageType!=3 &amp;&amp; imageType!=10 &amp;&amp; imageType!=11) <font class="keywordflow">return</font>;
+02580 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(tgaOrigin);
+02581 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(length);
+02582 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a391">depth</a>);
+02583 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(xOrg);
+02584 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(yOrg);
+02585 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>);
+02586 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>);
+02587 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(imageDepth);
+02588 <font class="keywordflow">if</font>(imageDepth!=8 &amp;&amp; imageDepth!=24 &amp;&amp; imageDepth!=32) <font class="keywordflow">return</font>;
+02589 f.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(desc);
+02590
+02591 <font class="comment">// Ok, we have width and height.</font>
+02592 retWidth= <a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>;
+02593 retHeight= <a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>;
+02594 }
+02595
+02596 <font class="comment">// reset stream.</font>
+02597 <font class="keywordflow">if</font>(!f.<a class="code" href="classNLMISC_1_1IStream.html#a31">seek</a> (0, <a class="code" href="classNLMISC_1_1IStream.html#s3s0">NLMISC::IStream::begin</a>))
+02598 {
+02599 <font class="keywordflow">throw</font> ESeekFailed();
+02600 }
+02601 }
+02602
+02603
+<a name="l02604"></a><a class="code" href="classNLMISC_1_1CBitmap.html#d1">02604</a> <font class="keywordtype">void</font> CBitmap::loadSize(<font class="keyword">const</font> std::string &amp;path, uint32 &amp;retWidth, uint32 &amp;retHeight)
+02605 {
+02606 retWidth= 0;
+02607 retHeight= 0;
+02608
+02609 CIFile f(path);
+02610 <font class="keywordflow">if</font>(f.open(path))
+02611 <a class="code" href="classNLMISC_1_1CBitmap.html#d0">loadSize</a>(f, retWidth, retHeight);
+02612 }
+02613
+02614
+<a name="l02615"></a><a class="code" href="classNLMISC_1_1CBitmap.html#a25">02615</a> <font class="keywordtype">void</font> CBitmap::flipH()
+02616 {
+02617 <font class="keywordflow">if</font> (<a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> != <a class="code" href="classNLMISC_1_1CBitmap.html#s11s0">RGBA</a>)
+02618 <font class="keywordflow">return</font>;
+02619
+02620 sint32 nWidth = <a class="code" href="classNLMISC_1_1CBitmap.html#a6">getWidth</a>(0);
+02621 sint32 nHeight = <a class="code" href="classNLMISC_1_1CBitmap.html#a7">getHeight</a>(0);
+02622 sint32 i, j;
+02623 <a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a> *pBitmap = (<a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a>*)&amp;<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0][0];
+02624 <font class="keywordtype">bool</font> needRebuild = <font class="keyword">false</font>;
+02625 CRGBA temp;
+02626
+02627 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>&gt;1)
+02628 needRebuild = <font class="keyword">true</font>;
+02629 <a class="code" href="classNLMISC_1_1CBitmap.html#a12">releaseMipMaps</a>();
+02630
+02631 <font class="keywordflow">for</font>( i = 0; i &lt; nHeight; ++i )
+02632 <font class="keywordflow">for</font>( j = 0; j &lt; nWidth/2; ++j )
+02633 {
+02634 temp = pBitmap[i*nWidth+j];
+02635 pBitmap[i*nWidth+j] = pBitmap[i*nWidth+nWidth-j-1];
+02636 pBitmap[i*nWidth+nWidth-j-1] = temp;
+02637 }
+02638
+02639 <font class="comment">// Rebuilding mipmaps</font>
+02640 <font class="keywordflow">if</font>(needRebuild)
+02641 {
+02642 <a class="code" href="classNLMISC_1_1CBitmap.html#a11">buildMipMaps</a>();
+02643 }
+02644 }
+02645
+02646
+<a name="l02647"></a><a class="code" href="classNLMISC_1_1CBitmap.html#a26">02647</a> <font class="keywordtype">void</font> CBitmap::flipV()
+02648 {
+02649 <font class="keywordflow">if</font> (<a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> != <a class="code" href="classNLMISC_1_1CBitmap.html#s11s0">RGBA</a>)
+02650 <font class="keywordflow">return</font>;
+02651
+02652 sint32 nWidth = <a class="code" href="classNLMISC_1_1CBitmap.html#a6">getWidth</a>(0);
+02653 sint32 nHeight = <a class="code" href="classNLMISC_1_1CBitmap.html#a7">getHeight</a>(0);
+02654 sint32 i, j;
+02655 <a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a> *pBitmap = (<a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a>*)&amp;<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0][0];
+02656 <font class="keywordtype">bool</font> needRebuild = <font class="keyword">false</font>;
+02657 CRGBA temp;
+02658
+02659 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>&gt;1)
+02660 needRebuild = <font class="keyword">true</font>;
+02661 <a class="code" href="classNLMISC_1_1CBitmap.html#a12">releaseMipMaps</a>();
+02662
+02663 <font class="keywordflow">for</font>( j = 0; j &lt; nHeight/2; ++j )
+02664 <font class="keywordflow">for</font>( i = 0; i &lt; nWidth; ++i )
+02665 {
+02666 temp = pBitmap[j*nWidth+i];
+02667 pBitmap[j*nWidth+i] = pBitmap[(nHeight-j-1)*nWidth+i];
+02668 pBitmap[(nHeight-j-1)*nWidth+i] = temp;
+02669 }
+02670
+02671 <font class="comment">// Rebuilding mipmaps</font>
+02672 <font class="keywordflow">if</font>(needRebuild)
+02673 {
+02674 <a class="code" href="classNLMISC_1_1CBitmap.html#a11">buildMipMaps</a>();
+02675 }
+02676 }
+02677
+02678
+<a name="l02679"></a><a class="code" href="classNLMISC_1_1CBitmap.html#a27">02679</a> <font class="keywordtype">void</font> CBitmap::rot90CW()
+02680 {
+02681 <font class="keywordflow">if</font> (<a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> != <a class="code" href="classNLMISC_1_1CBitmap.html#s11s0">RGBA</a>)
+02682 <font class="keywordflow">return</font>;
+02683 sint32 nWidth = <a class="code" href="classNLMISC_1_1CBitmap.html#a6">getWidth</a>(0);
+02684 sint32 nHeight = <a class="code" href="classNLMISC_1_1CBitmap.html#a7">getHeight</a>(0);
+02685 sint32 i, j;
+02686 <a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a> *pSrcRgba = (<a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a>*)&amp;<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0][0];
+02687 <font class="keywordtype">bool</font> needRebuild = <font class="keyword">false</font>;
+02688
+02689 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>&gt;1)
+02690 needRebuild = <font class="keyword">true</font>;
+02691 <a class="code" href="classNLMISC_1_1CBitmap.html#a12">releaseMipMaps</a>();
+02692
+02693 std::vector&lt;uint8&gt; pDestui;
+02694 pDestui.resize(nWidth*nHeight*4);
+02695 <a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a> *pDestRgba = (<a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a>*)&amp;pDestui[0];
+02696
+02697 <font class="keywordflow">for</font>( j = 0; j &lt; nHeight; ++j )
+02698 <font class="keywordflow">for</font>( i = 0; i &lt; nWidth; ++i )
+02699 pDestRgba[j+i*nHeight] = pSrcRgba[i+(nHeight-1-j)*nWidth];
+02700
+02701 uint32 nTemp = <a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>;
+02702 <a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a>;
+02703 <a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a> = nTemp;
+02704
+02705 <a class="code" href="namespaceNLMISC.html#a222">NLMISC::contReset</a>(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0]); <font class="comment">// free memory</font>
+02706 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0] = pDestui;
+02707 <font class="comment">// Rebuilding mipmaps</font>
+02708 <font class="keywordflow">if</font>(needRebuild)
+02709 {
+02710 <a class="code" href="classNLMISC_1_1CBitmap.html#a11">buildMipMaps</a>();
+02711 }
+02712 }
+02713
+<a name="l02714"></a><a class="code" href="classNLMISC_1_1CBitmap.html#a28">02714</a> <font class="keywordtype">void</font> CBitmap::rot90CCW()
+02715 {
+02716 <font class="keywordflow">if</font> (<a class="code" href="classNLMISC_1_1CBitmap.html#m0">PixelFormat</a> != <a class="code" href="classNLMISC_1_1CBitmap.html#s11s0">RGBA</a>)
+02717 <font class="keywordflow">return</font>;
+02718 sint32 nWidth = <a class="code" href="classNLMISC_1_1CBitmap.html#a6">getWidth</a>(0);
+02719 sint32 nHeight = <a class="code" href="classNLMISC_1_1CBitmap.html#a7">getHeight</a>(0);
+02720 sint32 i, j;
+02721 <a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a> *pSrcRgba = (<a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a>*)&amp;<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0][0];
+02722 <font class="keywordtype">bool</font> needRebuild = <font class="keyword">false</font>;
+02723
+02724 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1CBitmap.html#n1">_MipMapCount</a>&gt;1)
+02725 needRebuild = <font class="keyword">true</font>;
+02726 <a class="code" href="classNLMISC_1_1CBitmap.html#a12">releaseMipMaps</a>();
+02727
+02728 std::vector&lt;uint8&gt; pDestui;
+02729 pDestui.resize(nWidth*nHeight*4);
+02730 <a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a> *pDestRgba = (<a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a>*)&amp;pDestui[0];
+02731
+02732 <font class="keywordflow">for</font>( j = 0; j &lt; nHeight; ++j )
+02733 <font class="keywordflow">for</font>( i = 0; i &lt; nWidth; ++i )
+02734 pDestRgba[j+i*nHeight] = pSrcRgba[nWidth-1-i+j*nWidth];
+02735
+02736 uint32 nTemp = <a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a>;
+02737 <a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a>;
+02738 <a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a> = nTemp;
+02739
+02740 <a class="code" href="namespaceNLMISC.html#a222">NLMISC::contReset</a>(<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0]); <font class="comment">// free memory</font>
+02741 <a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0] = pDestui;
+02742 <font class="comment">// Rebuilding mipmaps</font>
+02743 <font class="keywordflow">if</font>(needRebuild)
+02744 {
+02745 <a class="code" href="classNLMISC_1_1CBitmap.html#a11">buildMipMaps</a>();
+02746 }
+02747 }
+02748
+02749 <font class="comment">//===========================================================================</font>
+02750
+<a name="l02751"></a><a class="code" href="classNLMISC_1_1CBitmap.html#a29">02751</a> <font class="keywordtype">void</font> CBitmap::blend(<font class="keyword">const</font> CBitmap &amp;Bm0, <font class="keyword">const</font> CBitmap &amp;Bm1, uint16 factor)
+02752 {
+02753 <a class="code" href="debug_8h.html#a6">nlassert</a>(factor &lt;= 256);
+02754
+02755 <a class="code" href="debug_8h.html#a6">nlassert</a>(Bm0._Width != 0 &amp;&amp; Bm0._Height != 0
+02756 &amp;&amp; Bm1._Width != 0 &amp;&amp; Bm1._Height != 0);
+02757
+02758 <a class="code" href="debug_8h.html#a6">nlassert</a>(Bm0._Width == Bm1._Width); <font class="comment">// the bitmap should have the same size</font>
+02759 <a class="code" href="debug_8h.html#a6">nlassert</a>(Bm0._Height == Bm1._Height);
+02760
+02761 <font class="keyword">const</font> <a class="code" href="classNLMISC_1_1CBitmap.html#a0">CBitmap</a> *nBm0, *nBm1; <font class="comment">// pointer to the bitmap that is used for blending, or to a copy is a conversion wa required</font>
+02762
+02763 <a class="code" href="classNLMISC_1_1CBitmap.html#a0">CBitmap</a> cp0, cp1; <font class="comment">// these bitmap are copies of Bm1 and Bm0 if a conversion was needed</font>
+02764
+02765 <font class="keywordflow">if</font> (Bm0.PixelFormat != <a class="code" href="classNLMISC_1_1CBitmap.html#s11s0">RGBA</a>)
+02766 {
+02767 cp0 = Bm0;
+02768 cp0.convertToRGBA();
+02769 nBm0 = &amp;cp0;
+02770 }
+02771 <font class="keywordflow">else</font>
+02772 {
+02773 nBm0 = &amp;Bm0;
+02774 }
+02775
+02776
+02777 <font class="keywordflow">if</font> (Bm1.PixelFormat != <a class="code" href="classNLMISC_1_1CBitmap.html#s11s0">RGBA</a>)
+02778 {
+02779 cp1 = Bm1;
+02780 cp1.convertToRGBA();
+02781 nBm1 = &amp;cp1;
+02782 }
+02783 <font class="keywordflow">else</font>
+02784 {
+02785 nBm1 = &amp;Bm1;
+02786 }
+02787
+02788 this-&gt;<a class="code" href="classNLMISC_1_1CBitmap.html#a15">resize</a>(Bm0._Width, Bm0._Height, <a class="code" href="classNLMISC_1_1CBitmap.html#s11s0">RGBA</a>);
+02789
+02790 <font class="keyword">const</font> uint numPix = <a class="code" href="classNLMISC_1_1CBitmap.html#n3">_Width</a> * <a class="code" href="classNLMISC_1_1CBitmap.html#n4">_Height</a>; <font class="comment">// 4 component per pixels</font>
+02791
+02792
+02793 <font class="keyword">const</font> uint8 *src0 = &amp;(nBm0-&gt;_Data[0][0]);
+02794 <font class="keyword">const</font> uint8 *src1 = &amp;(nBm1-&gt;_Data[0][0]);
+02795 uint8 *dest = &amp;(this-&gt;<a class="code" href="classNLMISC_1_1CBitmap.html#n0">_Data</a>[0][0]);
+02796 uint8 *endPix = dest + (numPix &lt;&lt; 2);
+02797
+02798
+02799 uint blendFact = (uint) factor;
+02800 uint invblendFact = 256 - blendFact;
+02801
+02802 <font class="keywordflow">do</font>
+02803 {
+02805 *dest = (uint8) (((blendFact * *src1) + (invblendFact * *src0)) &gt;&gt; 8);
+02806 *(dest + 1) = (uint8) (((blendFact * *(src1 + 1)) + (invblendFact * *(src0 + 1))) &gt;&gt; 8);
+02807 *(dest + 2) = (uint8) (((blendFact * *(src1 + 2)) + (invblendFact * *(src0 + 2))) &gt;&gt; 8);
+02808 *(dest + 3) = (uint8) (((blendFact * *(src1 + 3)) + (invblendFact * *(src0 + 3))) &gt;&gt; 8);
+02809
+02810 src0 = src0 + 4;
+02811 src1 = src1 + 4;
+02812 dest = dest + 4;
+02813 }
+02814 <font class="keywordflow">while</font> (dest != endPix);
+02815 }
+02816
+02817
+02818
+02819 <font class="comment">//-----------------------------------------------</font>
+02820 CRGBA CBitmap::getRGBAPixel(sint <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>, sint <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>, uint32 numMipMap <font class="comment">/*=0*/</font>)<font class="keyword"> const</font>
+02821 <font class="keyword"></font>{
+02822 uint <a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#a6">getWidth</a>(numMipMap);
+02823 uint h = <a class="code" href="classNLMISC_1_1CBitmap.html#a7">getHeight</a>(numMipMap);
+02824 <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a> == 0 || (uint) <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a> &gt;= <a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a> || (uint) <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a> &gt;= h) <font class="keywordflow">return</font> CRGBA::Black; <font class="comment">// include negative cases</font>
+02825 <font class="keyword">const</font> uint8 *pix = &amp;<a class="code" href="classNLMISC_1_1CBitmap.html#z277_0">getPixels</a>(numMipMap)[(<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a> + <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a> * <a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>) &lt;&lt; 2];
+02826 <font class="keywordflow">return</font> CRGBA(pix[0], pix[1], pix[2], pix[3]);
+02827 }
+02828
+02829 <font class="comment">//-----------------------------------------------</font>
+<a name="l02830"></a><a class="code" href="classNLMISC_1_1CBitmap.html#z276_3">02830</a> CRGBA CBitmap::getDXTCColorFromBlock(<font class="keyword">const</font> uint8 *block, sint <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>, sint <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>)
+02831 {
+02832 uint16 col0;
+02833 uint16 col1;
+02834 memcpy(&amp;col0, block, <font class="keyword">sizeof</font>(uint16));
+02835 memcpy(&amp;col1, block + 2, <font class="keyword">sizeof</font>(uint16));
+02836 uint colIndex = (block[4 + (<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a> &amp; 3)] &gt;&gt; ((<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a> &amp; 3) &lt;&lt; 1)) &amp; 3;
+02837 CRGBA result, c0, c1;
+02838 <font class="keywordflow">if</font> (col0 &gt; col1)
+02839 {
+02840 <font class="keywordflow">switch</font>(colIndex)
+02841 {
+02842 <font class="keywordflow">case</font> 0:
+02843 <a class="code" href="classNLMISC_1_1CBitmap.html#f0">uncompress</a>(col0, result);
+02844 <font class="keywordflow">break</font>;
+02845 <font class="keywordflow">case</font> 1:
+02846 <a class="code" href="classNLMISC_1_1CBitmap.html#f0">uncompress</a>(col1, result);
+02847 <font class="keywordflow">break</font>;
+02848 <font class="keywordflow">case</font> 2:
+02849 <a class="code" href="classNLMISC_1_1CBitmap.html#f0">uncompress</a>(col0, c0);
+02850 <a class="code" href="classNLMISC_1_1CBitmap.html#f0">uncompress</a>(col1, c1);
+02851 result.blendFromui(c0, c1, 85);
+02852 <font class="keywordflow">break</font>;
+02853 <font class="keywordflow">case</font> 3:
+02854 <a class="code" href="classNLMISC_1_1CBitmap.html#f0">uncompress</a>(col0, c0);
+02855 <a class="code" href="classNLMISC_1_1CBitmap.html#f0">uncompress</a>(col1, c1);
+02856 result.blendFromui(c0, c1, 171);
+02857 <font class="keywordflow">break</font>;
+02858 }
+02859 result.A = 255;
+02860 }
+02861 <font class="keywordflow">else</font>
+02862 {
+02863 <font class="keywordflow">switch</font>(colIndex)
+02864 {
+02865 <font class="keywordflow">case</font> 0:
+02866 <a class="code" href="classNLMISC_1_1CBitmap.html#f0">uncompress</a>(col0, result);
+02867 result.A = 255;
+02868 <font class="keywordflow">break</font>;
+02869 <font class="keywordflow">case</font> 1:
+02870 <a class="code" href="classNLMISC_1_1CBitmap.html#f0">uncompress</a>(col1, result);
+02871 result.A = 255;
+02872 <font class="keywordflow">break</font>;
+02873 <font class="keywordflow">case</font> 2:
+02874 <a class="code" href="classNLMISC_1_1CBitmap.html#f0">uncompress</a>(col0, c0);
+02875 <a class="code" href="classNLMISC_1_1CBitmap.html#f0">uncompress</a>(col1, c1);
+02876 result.blendFromui(c0, c1, 128);
+02877 result.A = 255;
+02878 <font class="keywordflow">break</font>;
+02879 <font class="keywordflow">case</font> 3:
+02880 result.set(0, 0, 0, 0);
+02881 <font class="keywordflow">break</font>;
+02882 }
+02883 }
+02884 <font class="keywordflow">return</font> result;
+02885 }
+02886
+02887 <font class="comment">//-----------------------------------------------</font>
+<a name="l02888"></a><a class="code" href="classNLMISC_1_1CBitmap.html#z276_0">02888</a> CRGBA CBitmap::getDXTC1Texel(sint <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>, sint <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>, uint32 numMipMap)<font class="keyword"> const</font>
+02889 <font class="keyword"></font>{
+02890 uint <a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#a6">getWidth</a>(numMipMap);
+02891 uint h = <a class="code" href="classNLMISC_1_1CBitmap.html#a7">getHeight</a>(numMipMap);
+02892 <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a> == 0 || h == 0 || (uint) <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a> &gt;= <a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a> || (uint) <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a> &gt;= h) <font class="keywordflow">return</font> CRGBA::Black; <font class="comment">// include negative cases </font>
+02893 uint numRowBlocks = std::max((<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a> + 3) &gt;&gt; 2, 1u);
+02894 <font class="keyword">const</font> uint8 *pix = &amp;<a class="code" href="classNLMISC_1_1CBitmap.html#z277_0">getPixels</a>(numMipMap)[0];
+02895 <font class="keyword">const</font> uint8 *block = pix + ((<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a> &gt;&gt; 2) * (numRowBlocks &lt;&lt; 3) + ((x &gt;&gt; 2) &lt;&lt; 3));
+02896 <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1CBitmap.html#z276_3">getDXTCColorFromBlock</a>(block, <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>, <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>);
+02897 }
+02898
+02899
+02900 <font class="comment">//-----------------------------------------------</font>
+<a name="l02901"></a><a class="code" href="classNLMISC_1_1CBitmap.html#z276_1">02901</a> CRGBA CBitmap::getDXTC3Texel(sint <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>, sint <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>, uint32 numMipMap)<font class="keyword"> const</font>
+02902 <font class="keyword"></font>{
+02903 uint <a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#a6">getWidth</a>(numMipMap);
+02904 uint h = <a class="code" href="classNLMISC_1_1CBitmap.html#a7">getHeight</a>(numMipMap);
+02905 <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a> == 0 || h == 0 || (uint) <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a> &gt;= <a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a> || (uint) <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a> &gt;= h) <font class="keywordflow">return</font> CRGBA::Black; <font class="comment">// include negative cases </font>
+02906 uint numRowBlocks = std::max((<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a> + 3) &gt;&gt; 2, 1u);
+02907 <font class="keyword">const</font> uint8 *pix = &amp;<a class="code" href="classNLMISC_1_1CBitmap.html#z277_0">getPixels</a>(numMipMap)[0];
+02908 <font class="keyword">const</font> uint8 *block = pix + ((<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a> &gt;&gt; 2) * (numRowBlocks &lt;&lt; 4) + ((x &gt;&gt; 2) &lt;&lt; 4));
+02909 CRGBA result = <a class="code" href="classNLMISC_1_1CBitmap.html#z276_3">getDXTCColorFromBlock</a>(block + 8, <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>, <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>);
+02910 <font class="comment">// get alpha part</font>
+02911 uint8 alphaByte = block[((<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a> &amp; 3) &lt;&lt; 1) + ((<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a> &amp; 2) &gt;&gt; 1)];
+02912 result.A = (<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a> &amp; 1) ? (alphaByte &amp; 0xf0) : (alphaByte &lt;&lt; 4);
+02913 <font class="keywordflow">return</font> result;
+02914 }
+02915
+02916 <font class="comment">//-----------------------------------------------</font>
+<a name="l02917"></a><a class="code" href="classNLMISC_1_1CBitmap.html#z276_2">02917</a> CRGBA CBitmap::getDXTC5Texel(sint <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>, sint <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>, uint32 numMipMap)<font class="keyword"> const</font>
+02918 <font class="keyword"></font>{
+02919 uint <a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a> = <a class="code" href="classNLMISC_1_1CBitmap.html#a6">getWidth</a>(numMipMap);
+02920 uint h = <a class="code" href="classNLMISC_1_1CBitmap.html#a7">getHeight</a>(numMipMap);
+02921 <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a> == 0 || h == 0 || (uint) <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a> &gt;= <a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a> || (uint) <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a> &gt;= h) <font class="keywordflow">return</font> CRGBA::Black; <font class="comment">// include negative cases </font>
+02922 uint numRowBlocks = std::max((<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a> + 3) &gt;&gt; 2, 1u);
+02923 <font class="keyword">const</font> uint8 *pix = &amp;<a class="code" href="classNLMISC_1_1CBitmap.html#z277_0">getPixels</a>(numMipMap)[0];
+02924 <font class="keyword">const</font> uint8 *block = pix + ((<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a> &gt;&gt; 2) * (numRowBlocks &lt;&lt; 4) + ((x &gt;&gt; 2) &lt;&lt; 4));
+02925 CRGBA result = <a class="code" href="classNLMISC_1_1CBitmap.html#z276_3">getDXTCColorFromBlock</a>(block + 8, <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>, <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>);
+02926 <font class="comment">// get alpha part</font>
+02927 uint8 alpha0 = block[0];
+02928 uint8 alpha1 = block[1];
+02929
+02930 uint alphaIndex;
+02931 uint tripletIndex = (<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a> &amp; 3) + ((<a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a> &amp; 3) &lt;&lt; 2);
+02932 <font class="keywordflow">if</font> (tripletIndex &lt; 8)
+02933 {
+02934 alphaIndex = (((uint32 &amp;) block[2]) &gt;&gt; (tripletIndex * 3)) &amp; 7;
+02935 }
+02936 <font class="keywordflow">else</font>
+02937 {
+02938 alphaIndex = (((uint32 &amp;) block[5]) &gt;&gt; ((tripletIndex - 8) * 3)) &amp; 7; <font class="comment">// we can read a dword there because there are color datas following he alpha datas</font>
+02939 }
+02940
+02941 <font class="keywordflow">if</font> (alpha0 &gt; alpha1)
+02942 {
+02943 <font class="keywordflow">switch</font> (alphaIndex)
+02944 {
+02945 <font class="keywordflow">case</font> 0: result.A = alpha0; <font class="keywordflow">break</font>;
+02946 <font class="keywordflow">case</font> 1: result.A = alpha1; <font class="keywordflow">break</font>;
+02947 <font class="keywordflow">case</font> 2: result.A = (uint8) ((6 * (uint) alpha0 + (uint) alpha1) / 7); <font class="keywordflow">break</font>;
+02948 <font class="keywordflow">case</font> 3: result.A = (uint8) ((5 * (uint) alpha0 + 2 * (uint) alpha1) / 7); <font class="keywordflow">break</font>;
+02949 <font class="keywordflow">case</font> 4: result.A = (uint8) ((4 * (uint) alpha0 + 3 * (uint) alpha1) / 7); <font class="keywordflow">break</font>;
+02950 <font class="keywordflow">case</font> 5: result.A = (uint8) ((3 * (uint) alpha0 + 4 * (uint) alpha1) / 7); <font class="keywordflow">break</font>;
+02951 <font class="keywordflow">case</font> 6: result.A = (uint8) ((2 * (uint) alpha0 + 5 * (uint) alpha1) / 7); <font class="keywordflow">break</font>;
+02952 <font class="keywordflow">case</font> 7: result.A = (uint8) (((uint) alpha0 + (uint) 6 * alpha1) / 7); <font class="keywordflow">break</font>;
+02953 }
+02954 }
+02955 <font class="keywordflow">else</font>
+02956 {
+02957 <font class="keywordflow">switch</font> (alphaIndex)
+02958 {
+02959 <font class="keywordflow">case</font> 0: result.A = alpha0; <font class="keywordflow">break</font>;
+02960 <font class="keywordflow">case</font> 1: result.A = alpha1; <font class="keywordflow">break</font>;
+02961 <font class="keywordflow">case</font> 2: result.A = (uint8) ((4 * (uint) alpha0 + (uint) alpha1) / 5); <font class="keywordflow">break</font>;
+02962 <font class="keywordflow">case</font> 3: result.A = (uint8) ((3 * (uint) alpha0 + 2 * (uint) alpha1) / 5); <font class="keywordflow">break</font>;
+02963 <font class="keywordflow">case</font> 4: result.A = (uint8) ((2 * (uint) alpha0 + 3 * (uint) alpha1) / 5); <font class="keywordflow">break</font>;
+02964 <font class="keywordflow">case</font> 5: result.A = (uint8) (((uint) alpha0 + 4 * (uint) alpha1) / 5); <font class="keywordflow">break</font>;
+02965 <font class="keywordflow">case</font> 6: result.A = 0; <font class="keywordflow">break</font>;
+02966 <font class="keywordflow">case</font> 7: result.A = 255; <font class="keywordflow">break</font>;
+02967 }
+02968 }
+02969 <font class="keywordflow">return</font> result;
+02970 }
+02971
+02972
+02973 <font class="comment">//-----------------------------------------------</font>
+<a name="l02974"></a><a class="code" href="classNLMISC_1_1CBitmap.html#a24">02974</a> CRGBA CBitmap::getPixelColor(sint <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>, sint <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>, uint32 numMipMap <font class="comment">/*=0*/</font>)<font class="keyword"> const</font>
+02975 <font class="keyword"></font>{
+02976
+02977 <font class="keywordflow">switch</font> (PixelFormat)
+02978 {
+02979 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s0">RGBA</a>:
+02980 <font class="keywordflow">return</font> getRGBAPixel(<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>, <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>, numMipMap);
+02981 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s4">DXTC1</a>:
+02982 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s5">DXTC1Alpha</a>:
+02983 <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1CBitmap.html#z276_0">getDXTC1Texel</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>, <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>, numMipMap);
+02984 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s6">DXTC3</a>:
+02985 <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1CBitmap.html#z276_1">getDXTC3Texel</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>, <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>, numMipMap);
+02986 <font class="keywordflow">case</font> <a class="code" href="classNLMISC_1_1CBitmap.html#s11s7">DXTC5</a>:
+02987 <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1CBitmap.html#z276_2">getDXTC5Texel</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>, <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>, numMipMap);
+02988 <font class="keywordflow">default</font>:
+02989 <a class="code" href="debug_8h.html#a12">nlstop</a>;
+02990 <font class="keywordflow">break</font>;
+02991 }
+02992 <font class="keywordflow">return</font> CRGBA::Black;
+02993 }
+02994
+02995
+02996 } <font class="comment">// NLMISC</font>
+</pre></div>
+
+<!-- footer -->
+<BR><FONT Size=+5>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </FONT>
+</TD>
+<TD WIDTH=15><IMG SRC=http://www.nevrax.org/inc/img/pixel.gif WIDTH=15 HEIGHT=15 BORDER=0 ALT=""></TD>
+</TR>
+</TABLE>
+</BODY>
+</HTML>