blob: 18c43cb55280e6cca91fae468d27a89273548e0d (
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
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>imgsynth: imgsynth/cbitmap.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 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>imgsynth/cbitmap.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001
<a name="l00008"></a>00008 <span class="preprocessor">#ifndef CBITMAP_H</span>
<a name="l00009"></a>00009 <span class="preprocessor"></span><span class="preprocessor">#define CBITMAP_H</span>
<a name="l00010"></a>00010 <span class="preprocessor"></span>
<a name="l00011"></a>00011 <span class="preprocessor">#include "cfile.h"</span>
<a name="l00012"></a>00012
<a name="l00013"></a>00013 <span class="keyword">class </span><a class="code" href="classCPixelFormat.html" title="Abstract class for handling different color bitcount of Bitmaps.">CPixelFormat</a>;
<a name="l00014"></a>00014 <span class="preprocessor">#include "cpixelformat.h"</span>
<a name="l00015"></a>00015
<a name="l00026"></a><a class="code" href="classCBitmap.html">00026</a> <span class="keyword">class </span><a class="code" href="classCBitmap.html" title="Implementation of CFile handling Windows Bitmaps.">CBitmap</a> : <span class="keyword">public</span> <a class="code" href="classCFile.html" title="Abstract class for handling files. Needed for generic use in CScriptparser.">CFile</a>
<a name="l00027"></a>00027 {
<a name="l00028"></a>00028 <span class="keyword">public</span>:
<a name="l00038"></a><a class="code" href="classCBitmap.html#a2fcc47ff70fbf2058752cad1a7d142b">00038</a> <a class="code" href="classCBitmap.html#a2fcc47ff70fbf2058752cad1a7d142b" title="Default ctor.">CBitmap</a>()
<a name="l00039"></a>00039 : <a class="code" href="classCBitmap.html#fd64be4c5cdaff861f0b040edc697138">m_pixeldata</a>(NULL), <a class="code" href="classCBitmap.html#e9a1708eb34853ade75a0f5d82fbaae3">m_pixelformat</a>(NULL)
<a name="l00040"></a>00040 {
<a name="l00041"></a>00041 <a class="code" href="classCFile.html#63719f47953108756b34b6c7e701f536">m_types</a>.insert(<span class="stringliteral">"BMP"</span>);
<a name="l00042"></a>00042 }
<a name="l00043"></a>00043
<a name="l00053"></a>00053 <a class="code" href="classCBitmap.html#7407ebaa7ffc9654bf47d598cb0d877d" title="Default dtor.">~CBitmap</a>();
<a name="l00054"></a>00054
<a name="l00066"></a>00066 <span class="keywordtype">void</span> <a class="code" href="classCBitmap.html#f52d73977516ddcc13951b972acdc29b" title="Reads Windows Bitmap from filestream. On error an exception is thrown.">read</a>(std::ifstream& in);
<a name="l00067"></a>00067
<a name="l00078"></a>00078 <span class="keywordtype">void</span> <a class="code" href="classCBitmap.html#ce6bed4399a6d35874223ada4f802b3d" title="Writes Windows Bitmap to filestream.">write</a>(std::ofstream& out);
<a name="l00079"></a>00079
<a name="l00091"></a>00091 <span class="keywordtype">void</span> <a class="code" href="classCBitmap.html#9227003c492ed640ed0ea661d7d052c2" title="Delegates the function and its parameters to the correct internal method.">callFunc</a>(<span class="keyword">const</span> std::string& func, <span class="keyword">const</span> std::list<std::string>& params);
<a name="l00092"></a>00092
<a name="l00093"></a>00093 <span class="preprocessor">#ifdef DEBUG</span>
<a name="l00094"></a>00094 <span class="preprocessor"></span>
<a name="l00103"></a>00103 <span class="keywordtype">void</span> dump(std::ostream& out);
<a name="l00104"></a>00104 <span class="preprocessor">#endif</span>
<a name="l00105"></a>00105 <span class="preprocessor"></span>
<a name="l00109"></a>00109 <span class="preprocessor">#pragma pack(push,1)</span>
<a name="l00110"></a><a class="code" href="structCBitmap_1_1BITMAP__FILEHEADER.html">00110</a> <span class="preprocessor"></span> <span class="keyword">typedef</span> <span class="keyword">struct</span>
<a name="l00111"></a>00111 {
<a name="l00113"></a><a class="code" href="structCBitmap_1_1BITMAP__FILEHEADER.html#6f94be438f27dd1175c8adfaf9d37ad3">00113</a> uint8_t bfType[2];
<a name="l00115"></a><a class="code" href="structCBitmap_1_1BITMAP__FILEHEADER.html#fdce3c1a10ab1ab231a778b1687568fd">00115</a> uint32_t bfSize;
<a name="l00117"></a><a class="code" href="structCBitmap_1_1BITMAP__FILEHEADER.html#ba0b18ecb4d88a1bbaa40e2c0f32c44d">00117</a> uint32_t bfReserved;
<a name="l00119"></a><a class="code" href="structCBitmap_1_1BITMAP__FILEHEADER.html#00b579a2da5565c1134d12b2df7844fc">00119</a> uint32_t bfOffBits;
<a name="l00120"></a>00120 } <a class="code" href="structCBitmap_1_1BITMAP__FILEHEADER.html" title="Windows Bitmap File Header structure.">BITMAP_FILEHEADER</a>;
<a name="l00121"></a>00121 <span class="preprocessor">#pragma pack(pop)</span>
<a name="l00122"></a>00122 <span class="preprocessor"></span>
<a name="l00126"></a>00126 <span class="preprocessor">#pragma pack(push,1)</span>
<a name="l00127"></a><a class="code" href="structCBitmap_1_1BITMAP__INFOHEADER.html">00127</a> <span class="preprocessor"></span> <span class="keyword">typedef</span> <span class="keyword">struct</span>
<a name="l00128"></a>00128 {
<a name="l00130"></a><a class="code" href="structCBitmap_1_1BITMAP__INFOHEADER.html#751e9db3a3824433676a9279be3c54a5">00130</a> uint32_t biSize;
<a name="l00132"></a><a class="code" href="structCBitmap_1_1BITMAP__INFOHEADER.html#83c29650c20248086ff227bdcc52bdf8">00132</a> int32_t biWidth;
<a name="l00134"></a><a class="code" href="structCBitmap_1_1BITMAP__INFOHEADER.html#c0c08b11c60497a0e28657e153757c0a">00134</a> int32_t biHeight;
<a name="l00136"></a><a class="code" href="structCBitmap_1_1BITMAP__INFOHEADER.html#cf617a4c37ef7e9e57aae4eabb6fc601">00136</a> uint16_t biPlanes;
<a name="l00138"></a><a class="code" href="structCBitmap_1_1BITMAP__INFOHEADER.html#d10e1096713b2a909c6d8dfa6e7422c9">00138</a> uint16_t biBitCount;
<a name="l00140"></a><a class="code" href="structCBitmap_1_1BITMAP__INFOHEADER.html#36272cbce2fae14d5fe874a494ebb21d">00140</a> uint32_t biCompression;
<a name="l00142"></a><a class="code" href="structCBitmap_1_1BITMAP__INFOHEADER.html#839888fb79e1d4bfeed3f5512f4a260b">00142</a> uint32_t biSizeImage;
<a name="l00144"></a><a class="code" href="structCBitmap_1_1BITMAP__INFOHEADER.html#a042cfadc5fec8ca852eb88c7e7120cf">00144</a> int32_t biXPelsPerMeter;
<a name="l00146"></a><a class="code" href="structCBitmap_1_1BITMAP__INFOHEADER.html#4d25fd39b25459b994aba5ce4bbb0d0e">00146</a> int32_t biYPelsPerMeter;
<a name="l00148"></a><a class="code" href="structCBitmap_1_1BITMAP__INFOHEADER.html#1c5a3971c584712b53365fac9ad8cde7">00148</a> uint32_t biClrUsed;
<a name="l00151"></a><a class="code" href="structCBitmap_1_1BITMAP__INFOHEADER.html#179c27d3bc320e341c8f6b3881edd010">00151</a> uint32_t biClrImportant;
<a name="l00152"></a>00152 } <a class="code" href="structCBitmap_1_1BITMAP__INFOHEADER.html" title="Windows Bitmap Info Header structure.">BITMAP_INFOHEADER</a>;
<a name="l00153"></a>00153 <span class="preprocessor">#pragma pack(pop)</span>
<a name="l00154"></a>00154 <span class="preprocessor"></span>
<a name="l00164"></a><a class="code" href="classCBitmap.html#841b652977f2143bae6e0bfca89d328b">00164</a> <a class="code" href="structCBitmap_1_1BITMAP__FILEHEADER.html" title="Windows Bitmap File Header structure.">BITMAP_FILEHEADER</a> &<a class="code" href="classCBitmap.html#841b652977f2143bae6e0bfca89d328b" title="Returns reference to fileheader structure of bitmap.">getFileHeader</a>()
<a name="l00165"></a>00165 {
<a name="l00166"></a>00166 <span class="keywordflow">return</span> <a class="code" href="classCBitmap.html#dbf8a9cf737b47fb2f244be59dbbac72">m_fileheader</a>;
<a name="l00167"></a>00167 }
<a name="l00168"></a>00168
<a name="l00178"></a><a class="code" href="classCBitmap.html#cc46187f54ddb825b77afe587633fb3f">00178</a> <a class="code" href="structCBitmap_1_1BITMAP__INFOHEADER.html" title="Windows Bitmap Info Header structure.">BITMAP_INFOHEADER</a> &<a class="code" href="classCBitmap.html#cc46187f54ddb825b77afe587633fb3f" title="Returns reference to infoheader structure of bitmap.">getInfoHeader</a>()
<a name="l00179"></a>00179 {
<a name="l00180"></a>00180 <span class="keywordflow">return</span> <a class="code" href="classCBitmap.html#1d5785fefd68a563e4b1408e77770f0f">m_infoheader</a>;
<a name="l00181"></a>00181 }
<a name="l00182"></a>00182
<a name="l00192"></a><a class="code" href="classCBitmap.html#5701ea86ba64ecd4863b79a32abf1e2e">00192</a> uint8_t *<a class="code" href="classCBitmap.html#5701ea86ba64ecd4863b79a32abf1e2e" title="Returns pointer to pixelbuffer.">getPixelData</a>()
<a name="l00193"></a>00193 {
<a name="l00194"></a>00194 <span class="keywordflow">return</span> <a class="code" href="classCBitmap.html#fd64be4c5cdaff861f0b040edc697138">m_pixeldata</a>;
<a name="l00195"></a>00195 }
<a name="l00196"></a>00196
<a name="l00197"></a>00197 <span class="keyword">protected</span>:
<a name="l00210"></a>00210 <span class="keywordtype">void</span> <a class="code" href="classCBitmap.html#9691aecf4ee35415948f7666fc8b2e06" title="Fills rectangle in image starting on position x, y width size width, height and color...">fillrect</a>(std::list<std::string> params);
<a name="l00211"></a>00211
<a name="l00212"></a>00212 <span class="comment">/* members */</span>
<a name="l00214"></a><a class="code" href="classCBitmap.html#dbf8a9cf737b47fb2f244be59dbbac72">00214</a> <a class="code" href="structCBitmap_1_1BITMAP__FILEHEADER.html" title="Windows Bitmap File Header structure.">BITMAP_FILEHEADER</a> <a class="code" href="classCBitmap.html#dbf8a9cf737b47fb2f244be59dbbac72">m_fileheader</a>;
<a name="l00216"></a><a class="code" href="classCBitmap.html#1d5785fefd68a563e4b1408e77770f0f">00216</a> <a class="code" href="structCBitmap_1_1BITMAP__INFOHEADER.html" title="Windows Bitmap Info Header structure.">BITMAP_INFOHEADER</a> <a class="code" href="classCBitmap.html#1d5785fefd68a563e4b1408e77770f0f">m_infoheader</a>;
<a name="l00218"></a><a class="code" href="classCBitmap.html#fd64be4c5cdaff861f0b040edc697138">00218</a> uint8_t *<a class="code" href="classCBitmap.html#fd64be4c5cdaff861f0b040edc697138">m_pixeldata</a>;
<a name="l00220"></a><a class="code" href="classCBitmap.html#e9a1708eb34853ade75a0f5d82fbaae3">00220</a> <a class="code" href="classCPixelFormat.html" title="Abstract class for handling different color bitcount of Bitmaps.">CPixelFormat</a> *<a class="code" href="classCBitmap.html#e9a1708eb34853ade75a0f5d82fbaae3">m_pixelformat</a>;
<a name="l00221"></a>00221 };
<a name="l00222"></a>00222
<a name="l00223"></a>00223 <span class="preprocessor">#endif</span>
<a name="l00224"></a>00224 <span class="preprocessor"></span>
<a name="l00225"></a>00225 <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 Apr 26 12:25:52 2009 for imgsynth by
<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>
|