summaryrefslogtreecommitdiffstats
path: root/ue2/doxygen/cwindowsbitmap_8h-source.html
blob: ca153da255311fa1f2c56202be9cd49e4030c767 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>imgsynth2: imgsynth2/cwindowsbitmap.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.3 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="namespaces.html"><span>Namespaces</span></a></li>
    <li><a href="annotated.html"><span>Classes</span></a></li>
    <li class="current"><a href="files.html"><span>Files</span></a></li>
  </ul>
</div>
<h1>imgsynth2/cwindowsbitmap.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00008"></a>00008 <span class="preprocessor">#ifndef CWINDOWSBITMAP_H</span>
<a name="l00009"></a>00009 <span class="preprocessor"></span><span class="preprocessor">#define CWINDOWSBITMAP_H</span>
<a name="l00010"></a>00010 <span class="preprocessor"></span>
<a name="l00011"></a>00011 <span class="preprocessor">#include &lt;stdint.h&gt;</span>
<a name="l00012"></a>00012 <span class="preprocessor">#include "cbitmap.h"</span>
<a name="l00013"></a>00013 
<a name="l00020"></a><a class="code" href="classCWindowsBitmap.html">00020</a> <span class="keyword">class </span><a class="code" href="classCWindowsBitmap.html" title="Implementation of CBitmap handling Windows Bitmaps.">CWindowsBitmap</a> : <span class="keyword">public</span> <a class="code" href="classCBitmap.html" title="Abstract implementation of CFile handling Bitmaps.">CBitmap</a>
<a name="l00021"></a>00021 {
<a name="l00022"></a>00022   <span class="keyword">public</span>:
<a name="l00032"></a>00032     <a class="code" href="classCWindowsBitmap.html#b7d403afff9d3ec2721eaf4f25260921" title="Default ctor.">CWindowsBitmap</a>();
<a name="l00033"></a>00033 
<a name="l00043"></a><a class="code" href="classCWindowsBitmap.html#a223d30484922d574ea0d975d96e2754">00043</a>     <a class="code" href="classCWindowsBitmap.html#a223d30484922d574ea0d975d96e2754" title="Default dtor.">~CWindowsBitmap</a>()
<a name="l00044"></a>00044     {}
<a name="l00045"></a>00045 
<a name="l00057"></a>00057     <span class="keywordtype">void</span> <a class="code" href="classCWindowsBitmap.html#cab005df5352370dd2fcb8a52738f81d" title="Reads Windows Bitmap from filestream. On error an exception is thrown.">read</a>(std::ifstream&amp; in);
<a name="l00058"></a>00058 
<a name="l00069"></a>00069     <span class="keywordtype">void</span> <a class="code" href="classCWindowsBitmap.html#95c314ad2c9b14dbe5189799bc7e4f71" title="Writes Windows Bitmap to filestream.">write</a>(std::ofstream&amp; out);
<a name="l00070"></a>00070 
<a name="l00071"></a>00071 <span class="preprocessor">#ifdef DEBUG</span>
<a name="l00072"></a>00072 <span class="preprocessor"></span>
<a name="l00081"></a>00081     <span class="keywordtype">void</span> dump(std::ostream&amp; out);
<a name="l00082"></a>00082 <span class="preprocessor">#endif</span>
<a name="l00083"></a>00083 <span class="preprocessor"></span>
<a name="l00093"></a><a class="code" href="classCWindowsBitmap.html#b742cf032ebcef270d8253beee789289">00093</a>     <span class="keyword">const</span> uint32_t <a class="code" href="classCWindowsBitmap.html#b742cf032ebcef270d8253beee789289" title="Return size of pixelbuffer.">getPixelDataSize</a>()
<a name="l00094"></a>00094     {
<a name="l00095"></a>00095       <span class="keywordflow">return</span> <a class="code" href="classCWindowsBitmap.html#2db451a4eed528602225ca2c1da051ce">m_infoheader</a>.<a class="code" href="structCWindowsBitmap_1_1BITMAP__INFOHEADER.html#7052207a5be2062555842ac569d0d33d">biSizeImage</a>;
<a name="l00096"></a>00096     }
<a name="l00097"></a>00097 
<a name="l00107"></a><a class="code" href="classCWindowsBitmap.html#002d6fcf7471095484ba7540cac20f7c">00107</a>     <span class="keyword">const</span> uint32_t <a class="code" href="classCWindowsBitmap.html#002d6fcf7471095484ba7540cac20f7c" title="Return height of bitmap in pixel.">getHeight</a>()
<a name="l00108"></a>00108     {
<a name="l00109"></a>00109       <span class="comment">/* width and height can be negativ */</span>
<a name="l00110"></a>00110       <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>uint32_t<span class="keyword">&gt;</span>(abs(<a class="code" href="classCWindowsBitmap.html#2db451a4eed528602225ca2c1da051ce">m_infoheader</a>.<a class="code" href="structCWindowsBitmap_1_1BITMAP__INFOHEADER.html#f523b4a3c28e8460ba6ee626d4936868">biHeight</a>));
<a name="l00111"></a>00111     }
<a name="l00112"></a>00112 
<a name="l00122"></a><a class="code" href="classCWindowsBitmap.html#c26c90bc4aaf3ba425665ec53671658b">00122</a>     <span class="keyword">const</span> uint32_t <a class="code" href="classCWindowsBitmap.html#c26c90bc4aaf3ba425665ec53671658b" title="Return width of bitmap in pixel.">getWidth</a>()
<a name="l00123"></a>00123     {
<a name="l00124"></a>00124       <span class="comment">/* width and height can be negativ */</span>
<a name="l00125"></a>00125       <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>uint32_t<span class="keyword">&gt;</span>(abs(<a class="code" href="classCWindowsBitmap.html#2db451a4eed528602225ca2c1da051ce">m_infoheader</a>.<a class="code" href="structCWindowsBitmap_1_1BITMAP__INFOHEADER.html#dc0838ca8b75b3bc818b18ac192c007d">biWidth</a>));
<a name="l00126"></a>00126     }
<a name="l00127"></a>00127 
<a name="l00137"></a><a class="code" href="classCWindowsBitmap.html#d69d560a53dc4409bccb6328678c96be">00137</a>     <span class="keyword">const</span> <span class="keywordtype">bool</span> <a class="code" href="classCWindowsBitmap.html#d69d560a53dc4409bccb6328678c96be" title="Windows Bitmaps can be stored upside down.">isMirrored</a>()
<a name="l00138"></a>00138     {
<a name="l00139"></a>00139       <span class="comment">/* if height is positive the y-coordinates are mirrored */</span>
<a name="l00140"></a>00140       <span class="keywordflow">return</span> (<a class="code" href="classCWindowsBitmap.html#2db451a4eed528602225ca2c1da051ce">m_infoheader</a>.<a class="code" href="structCWindowsBitmap_1_1BITMAP__INFOHEADER.html#f523b4a3c28e8460ba6ee626d4936868">biHeight</a> &gt; 0) ? <span class="keyword">true</span> : <span class="keyword">false</span>;
<a name="l00141"></a>00141     }
<a name="l00142"></a>00142 
<a name="l00153"></a><a class="code" href="classCWindowsBitmap.html#df53e5688a5fc47d8ba5437bf6b3edec">00153</a>     <span class="keyword">const</span> <span class="keywordtype">bool</span> <a class="code" href="classCWindowsBitmap.html#df53e5688a5fc47d8ba5437bf6b3edec" title="Check if bitmap has a colortable (we don&amp;#39;t support this yet for windows bitmaps)...">hasColorTable</a>()
<a name="l00154"></a>00154     {
<a name="l00155"></a>00155       <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00156"></a>00156     }
<a name="l00157"></a>00157 
<a name="l00158"></a>00158   <span class="keyword">protected</span>:
<a name="l00162"></a>00162 <span class="preprocessor">#pragma pack(push,1)</span>
<a name="l00163"></a><a class="code" href="structCWindowsBitmap_1_1BITMAP__FILEHEADER.html">00163</a> <span class="preprocessor"></span>    <span class="keyword">typedef</span> <span class="keyword">struct</span>
<a name="l00164"></a>00164     {
<a name="l00166"></a><a class="code" href="structCWindowsBitmap_1_1BITMAP__FILEHEADER.html#eca7ddcbb8d044c33faafe4b18e359b3">00166</a>       uint8_t  bfType[2];
<a name="l00168"></a><a class="code" href="structCWindowsBitmap_1_1BITMAP__FILEHEADER.html#1b2fa4417c9e57fed2cbbad5fe558a8f">00168</a>       uint32_t bfSize;
<a name="l00170"></a><a class="code" href="structCWindowsBitmap_1_1BITMAP__FILEHEADER.html#a0cd42a6643e14068600060ba421458e">00170</a>       uint32_t bfReserved;
<a name="l00172"></a><a class="code" href="structCWindowsBitmap_1_1BITMAP__FILEHEADER.html#d5035c3183e5bf8e78a6c5ebcbccac20">00172</a>       uint32_t bfOffBits;
<a name="l00173"></a>00173     } <a class="code" href="structCWindowsBitmap_1_1BITMAP__FILEHEADER.html" title="Windows Bitmap File Header structure.">BITMAP_FILEHEADER</a>;
<a name="l00174"></a>00174 <span class="preprocessor">#pragma pack(pop)</span>
<a name="l00175"></a>00175 <span class="preprocessor"></span>
<a name="l00179"></a>00179 <span class="preprocessor">#pragma pack(push,1)</span>
<a name="l00180"></a><a class="code" href="structCWindowsBitmap_1_1BITMAP__INFOHEADER.html">00180</a> <span class="preprocessor"></span>    <span class="keyword">typedef</span> <span class="keyword">struct</span>
<a name="l00181"></a>00181     {
<a name="l00183"></a><a class="code" href="structCWindowsBitmap_1_1BITMAP__INFOHEADER.html#7fce186dcbbbb8143e003859db1d19f6">00183</a>       uint32_t biSize;
<a name="l00185"></a><a class="code" href="structCWindowsBitmap_1_1BITMAP__INFOHEADER.html#dc0838ca8b75b3bc818b18ac192c007d">00185</a>       int32_t  biWidth;
<a name="l00187"></a><a class="code" href="structCWindowsBitmap_1_1BITMAP__INFOHEADER.html#f523b4a3c28e8460ba6ee626d4936868">00187</a>       int32_t  biHeight;
<a name="l00189"></a><a class="code" href="structCWindowsBitmap_1_1BITMAP__INFOHEADER.html#4697f951d59818d25e9b16590d9f546a">00189</a>       uint16_t biPlanes;
<a name="l00191"></a><a class="code" href="structCWindowsBitmap_1_1BITMAP__INFOHEADER.html#42aac7398ae70a60b35d3a0e965cee2c">00191</a>       uint16_t biBitCount;
<a name="l00193"></a><a class="code" href="structCWindowsBitmap_1_1BITMAP__INFOHEADER.html#5c1116667129ce939910cf0c0ceba09c">00193</a>       uint32_t biCompression;
<a name="l00195"></a><a class="code" href="structCWindowsBitmap_1_1BITMAP__INFOHEADER.html#7052207a5be2062555842ac569d0d33d">00195</a>       uint32_t biSizeImage;
<a name="l00197"></a><a class="code" href="structCWindowsBitmap_1_1BITMAP__INFOHEADER.html#f5b1eb60daa5f037d693ac32c7e38134">00197</a>       int32_t  biXPelsPerMeter;
<a name="l00199"></a><a class="code" href="structCWindowsBitmap_1_1BITMAP__INFOHEADER.html#865e897b0fc0eb27183501974345169e">00199</a>       int32_t  biYPelsPerMeter;
<a name="l00201"></a><a class="code" href="structCWindowsBitmap_1_1BITMAP__INFOHEADER.html#2e3f66847acfe0d188efbcfbedb75792">00201</a>       uint32_t biClrUsed;
<a name="l00204"></a><a class="code" href="structCWindowsBitmap_1_1BITMAP__INFOHEADER.html#34665e909b52abdf3cdd3c4af760b54f">00204</a>       uint32_t biClrImportant;
<a name="l00205"></a>00205     } <a class="code" href="structCWindowsBitmap_1_1BITMAP__INFOHEADER.html" title="Windows Bitmap Info Header structure.">BITMAP_INFOHEADER</a>;
<a name="l00206"></a>00206 <span class="preprocessor">#pragma pack(pop)</span>
<a name="l00207"></a>00207 <span class="preprocessor"></span>
<a name="l00208"></a>00208     <span class="comment">/* members */</span>
<a name="l00210"></a><a class="code" href="classCWindowsBitmap.html#47f9bf8aa81c56ab2cfe9960e27e0440">00210</a>     <a class="code" href="structCWindowsBitmap_1_1BITMAP__FILEHEADER.html" title="Windows Bitmap File Header structure.">BITMAP_FILEHEADER</a> <a class="code" href="classCWindowsBitmap.html#47f9bf8aa81c56ab2cfe9960e27e0440">m_fileheader</a>;
<a name="l00212"></a><a class="code" href="classCWindowsBitmap.html#2db451a4eed528602225ca2c1da051ce">00212</a>     <a class="code" href="structCWindowsBitmap_1_1BITMAP__INFOHEADER.html" title="Windows Bitmap Info Header structure.">BITMAP_INFOHEADER</a> <a class="code" href="classCWindowsBitmap.html#2db451a4eed528602225ca2c1da051ce">m_infoheader</a>;
<a name="l00213"></a>00213 };
<a name="l00214"></a>00214 
<a name="l00215"></a>00215 <span class="preprocessor">#endif</span>
<a name="l00216"></a>00216 <span class="preprocessor"></span>
<a name="l00217"></a>00217 <span class="comment">/* vim: set et sw=2 ts=2: */</span>
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Sun May 3 19:16:26 2009 for imgsynth2 by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
</body>
</html>