blob: 960e18564260c37614fab6ea8e8054083594b648 (
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
|
<!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/cpixmap.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>imgsynth2/cpixmap.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001
<a name="l00008"></a>00008 <span class="preprocessor">#ifndef CPixmap_H</span>
<a name="l00009"></a>00009 <span class="preprocessor"></span><span class="preprocessor">#define CPixmap_H</span>
<a name="l00010"></a>00010 <span class="preprocessor"></span>
<a name="l00011"></a>00011 <span class="preprocessor">#include <stdint.h></span>
<a name="l00012"></a>00012 <span class="preprocessor">#include "cbitmap.h"</span>
<a name="l00013"></a>00013
<a name="l00014"></a>00014 <span class="preprocessor">#define PIXMAP_IDENTIFIER "</span><span class="comment">/* XPM */</span>"
<a name="l00015"></a>00015 <span class="preprocessor">#define PIXMAP_COLORCHARS ".#abcdefghijklmnopqrstuvwxyzABCD" \</span>
<a name="l00016"></a>00016 <span class="preprocessor"> "EFGHIJKLMNOPQRSTUVWXYZ0123456789"</span>
<a name="l00017"></a>00017 <span class="preprocessor"></span>
<a name="l00028"></a><a class="code" href="classCPixmap.html">00028</a> <span class="keyword">class </span><a class="code" href="classCPixmap.html" title="Implementation of CFile handling Pixmap file format.">CPixmap</a> : <span class="keyword">public</span> <a class="code" href="classCBitmap.html" title="Abstract implementation of CFile handling Bitmaps.">CBitmap</a>
<a name="l00029"></a>00029 {
<a name="l00030"></a>00030 <span class="keyword">public</span>:
<a name="l00040"></a>00040 <a class="code" href="classCPixmap.html#32f42f22fc98398d87946895139d0b60" title="Default ctor.">CPixmap</a>();
<a name="l00041"></a>00041
<a name="l00051"></a><a class="code" href="classCPixmap.html#6bba8999f9c8bfd410561bc62a4fd6fc">00051</a> <a class="code" href="classCPixmap.html#6bba8999f9c8bfd410561bc62a4fd6fc" title="Default dtor.">~CPixmap</a>()
<a name="l00052"></a>00052 {}
<a name="l00053"></a>00053
<a name="l00065"></a>00065 <span class="keywordtype">void</span> <a class="code" href="classCPixmap.html#ef3b715729ca384e6817a3fcdddfa261" title="Reads Pixmap from filestream. On error an exception is thrown.">read</a>(std::ifstream& in);
<a name="l00066"></a>00066
<a name="l00077"></a>00077 <span class="keywordtype">void</span> <a class="code" href="classCPixmap.html#507d5a88f8af0e41e418108e01572f13" title="Writes Pixmap to filestream.">write</a>(std::ofstream& out);
<a name="l00078"></a>00078
<a name="l00079"></a>00079 <span class="preprocessor">#ifdef DEBUG</span>
<a name="l00080"></a>00080 <span class="preprocessor"></span>
<a name="l00089"></a>00089 <span class="keywordtype">void</span> dump(std::ostream& out);
<a name="l00090"></a>00090 <span class="preprocessor">#endif</span>
<a name="l00091"></a>00091 <span class="preprocessor"></span>
<a name="l00101"></a><a class="code" href="classCPixmap.html#740486bba3c8ea24f306a7b8248652e2">00101</a> <span class="keyword">const</span> uint32_t <a class="code" href="classCPixmap.html#740486bba3c8ea24f306a7b8248652e2" title="Return size of pixelbuffer.">getPixelDataSize</a>()
<a name="l00102"></a>00102 {
<a name="l00103"></a>00103 <span class="keywordflow">return</span> <a class="code" href="classCPixmap.html#5ca3e44f4f5a3d7a94d0f7a83d30eb2b">m_fileheader</a>.<a class="code" href="structCPixmap_1_1PIXMAP__FILEHEADER.html#51b15ae3b5f34919d86a49b8aed289e6">width</a> * <a class="code" href="classCPixmap.html#5ca3e44f4f5a3d7a94d0f7a83d30eb2b">m_fileheader</a>.<a class="code" href="structCPixmap_1_1PIXMAP__FILEHEADER.html#9f340ab3d55aefd4af98a340db6fb332">height</a> * <span class="keyword">sizeof</span>(uint32_t);
<a name="l00104"></a>00104 }
<a name="l00105"></a>00105
<a name="l00115"></a><a class="code" href="classCPixmap.html#3f50d434556073a883bb5a2650cf2f71">00115</a> <span class="keyword">const</span> uint32_t <a class="code" href="classCPixmap.html#3f50d434556073a883bb5a2650cf2f71" title="Return height of bitmap in pixel.">getHeight</a>()
<a name="l00116"></a>00116 {
<a name="l00117"></a>00117 <span class="keywordflow">return</span> <a class="code" href="classCPixmap.html#5ca3e44f4f5a3d7a94d0f7a83d30eb2b">m_fileheader</a>.<a class="code" href="structCPixmap_1_1PIXMAP__FILEHEADER.html#9f340ab3d55aefd4af98a340db6fb332">height</a>;
<a name="l00118"></a>00118 }
<a name="l00119"></a>00119
<a name="l00129"></a><a class="code" href="classCPixmap.html#f3419c1f68c7aa2c69d1e83b2ee6be8c">00129</a> <span class="keyword">const</span> uint32_t <a class="code" href="classCPixmap.html#f3419c1f68c7aa2c69d1e83b2ee6be8c" title="Return width of bitmap in pixel.">getWidth</a>()
<a name="l00130"></a>00130 {
<a name="l00131"></a>00131 <span class="keywordflow">return</span> <a class="code" href="classCPixmap.html#5ca3e44f4f5a3d7a94d0f7a83d30eb2b">m_fileheader</a>.<a class="code" href="structCPixmap_1_1PIXMAP__FILEHEADER.html#51b15ae3b5f34919d86a49b8aed289e6">width</a>;
<a name="l00132"></a>00132 }
<a name="l00133"></a>00133
<a name="l00144"></a><a class="code" href="classCPixmap.html#fc2876d5d93122f22eb1759381030980">00144</a> <span class="keyword">const</span> <span class="keywordtype">bool</span> <a class="code" href="classCPixmap.html#fc2876d5d93122f22eb1759381030980" title="Check if bitmap has a colortable (we don&#39;t support this yet for windows bitmaps)...">hasColorTable</a>()
<a name="l00145"></a>00145 {
<a name="l00146"></a>00146 <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00147"></a>00147 }
<a name="l00148"></a>00148
<a name="l00158"></a><a class="code" href="classCPixmap.html#0cbf88af3060d338b1d288cb930c8b49">00158</a> <span class="keyword">const</span> <span class="keywordtype">bool</span> <a class="code" href="classCPixmap.html#0cbf88af3060d338b1d288cb930c8b49" title="Windows Bitmaps can be stored upside down.">isMirrored</a>()
<a name="l00159"></a>00159 {
<a name="l00160"></a>00160 <span class="comment">/* pixmap is never mirrored */</span>
<a name="l00161"></a>00161 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00162"></a>00162 }
<a name="l00163"></a>00163
<a name="l00164"></a>00164 <span class="keyword">protected</span>:
<a name="l00175"></a>00175 std::string <a class="code" href="classCPixmap.html#0d93bfe35b557f3827f90aa81685aff4" title="read trimmed line (terminated by ) from filestream">getLine</a>(std::ifstream& in, <span class="keywordtype">bool</span> ignore_comments = <span class="keyword">true</span>);
<a name="l00176"></a>00176
<a name="l00186"></a>00186 std::string <a class="code" href="classCPixmap.html#4fea1d2e3e528e660f48f37fa91aedae" title="read trimmed c-arrayline from filestream">getCArrayLine</a>(std::ifstream& in);
<a name="l00187"></a>00187
<a name="l00198"></a>00198 <span class="keyword">const</span> std::string <a class="code" href="classCPixmap.html#51b3aeac4afa31c11188cf844a40f0fc" title="get xpm color identifier, generated using an index">getXPMColorID</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> index, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> length);
<a name="l00199"></a>00199
<a name="l00203"></a><a class="code" href="structCPixmap_1_1PIXMAP__FILEHEADER.html">00203</a> <span class="keyword">typedef</span> <span class="keyword">struct</span>
<a name="l00204"></a>00204 {
<a name="l00206"></a><a class="code" href="structCPixmap_1_1PIXMAP__FILEHEADER.html#51b15ae3b5f34919d86a49b8aed289e6">00206</a> uint32_t width;
<a name="l00208"></a><a class="code" href="structCPixmap_1_1PIXMAP__FILEHEADER.html#9f340ab3d55aefd4af98a340db6fb332">00208</a> uint32_t height;
<a name="l00210"></a><a class="code" href="structCPixmap_1_1PIXMAP__FILEHEADER.html#a5dd63000c19f0624fb397b2d9b6df7b">00210</a> uint32_t nColor;
<a name="l00212"></a><a class="code" href="structCPixmap_1_1PIXMAP__FILEHEADER.html#d3658696ed9270577e42c1eaaf82c798">00212</a> uint32_t nChar;
<a name="l00214"></a><a class="code" href="structCPixmap_1_1PIXMAP__FILEHEADER.html#f3075cc873003e3609a47d51e0b218fc">00214</a> uint32_t xHotspot;
<a name="l00216"></a><a class="code" href="structCPixmap_1_1PIXMAP__FILEHEADER.html#7e67fb4ccd100cffd2a8add526a7a6ef">00216</a> uint32_t yHotspot;
<a name="l00218"></a><a class="code" href="structCPixmap_1_1PIXMAP__FILEHEADER.html#b6a9327ef06aaf7659875b60f31ebf5f">00218</a> <span class="keywordtype">bool</span> _HOTSPOT;
<a name="l00220"></a><a class="code" href="structCPixmap_1_1PIXMAP__FILEHEADER.html#d418915065f86a80ff9b078934574453">00220</a> <span class="keywordtype">bool</span> _XPMEXT;
<a name="l00222"></a><a class="code" href="structCPixmap_1_1PIXMAP__FILEHEADER.html#015f7ddbfea9093a637396bea1d12f10">00222</a> std::string extension;
<a name="l00223"></a>00223 } <a class="code" href="structCPixmap_1_1PIXMAP__FILEHEADER.html" title="Pixmap Header structure.">PIXMAP_FILEHEADER</a>;
<a name="l00224"></a>00224
<a name="l00225"></a>00225 <span class="comment">/* members */</span>
<a name="l00227"></a><a class="code" href="classCPixmap.html#5ca3e44f4f5a3d7a94d0f7a83d30eb2b">00227</a> <a class="code" href="structCPixmap_1_1PIXMAP__FILEHEADER.html" title="Pixmap Header structure.">PIXMAP_FILEHEADER</a> <a class="code" href="classCPixmap.html#5ca3e44f4f5a3d7a94d0f7a83d30eb2b">m_fileheader</a>;
<a name="l00229"></a><a class="code" href="classCPixmap.html#ac8ee30e3375e15684c1263d7c9b8dd4">00229</a> std::string <a class="code" href="classCPixmap.html#ac8ee30e3375e15684c1263d7c9b8dd4">m_imagename</a>;
<a name="l00230"></a>00230 };
<a name="l00231"></a>00231
<a name="l00232"></a>00232 <span class="preprocessor">#endif</span>
<a name="l00233"></a>00233 <span class="preprocessor"></span>
<a name="l00234"></a>00234 <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
<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>
|