summaryrefslogtreecommitdiffstats
path: root/ue2/doxygen/cbitmap_8h-source.html
blob: 12165615bd42c171b5a1f11603fad4a3366fae09 (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
<!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/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&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/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 &lt;stdint.h&gt;</span>
<a name="l00012"></a>00012 <span class="preprocessor">#include &lt;map&gt;</span>
<a name="l00013"></a>00013 <span class="preprocessor">#include "cfile.h"</span>
<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="Abstract implementation of CFile handling 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 class="code" href="classCBitmap.html#ce883b7452cd9221c3a89c1369d89ede">m_rowsize</a>(0)
<a name="l00040"></a>00040     {}
<a name="l00041"></a>00041 
<a name="l00042"></a>00042 
<a name="l00052"></a>00052     <span class="keyword">virtual</span> <a class="code" href="classCBitmap.html#7407ebaa7ffc9654bf47d598cb0d877d" title="Default dtor.">~CBitmap</a>();
<a name="l00053"></a>00053 
<a name="l00065"></a>00065     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCBitmap.html#beaf444a418973a1bf8373f236d54421" title="Reads Windows Bitmap from filestream. On error an exception is thrown.">read</a>(std::ifstream&amp; in) = 0;
<a name="l00066"></a>00066 
<a name="l00077"></a>00077     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCBitmap.html#bfa214932af1cc21817dde3dbe3c61c6" title="Writes Windows Bitmap to filestream.">write</a>(std::ofstream&amp; out) = 0;
<a name="l00078"></a>00078 
<a name="l00088"></a><a class="code" href="classCBitmap.html#5701ea86ba64ecd4863b79a32abf1e2e">00088</a>     uint8_t *<a class="code" href="classCBitmap.html#5701ea86ba64ecd4863b79a32abf1e2e" title="Returns pointer to pixelbuffer.">getPixelData</a>()
<a name="l00089"></a>00089     {
<a name="l00090"></a>00090       <span class="keywordflow">return</span> <a class="code" href="classCBitmap.html#fd64be4c5cdaff861f0b040edc697138">m_pixeldata</a>;
<a name="l00091"></a>00091     }
<a name="l00092"></a>00092 
<a name="l00102"></a><a class="code" href="classCBitmap.html#bd838fcd9be4278ad6a58a0c57810a61">00102</a>     std::map&lt;uint32_t, CPixelFormat::RGBPIXEL *&gt;&amp; <a class="code" href="classCBitmap.html#bd838fcd9be4278ad6a58a0c57810a61" title="Returns reference to colortable.">getColorTable</a>()
<a name="l00103"></a>00103     {
<a name="l00104"></a>00104       <span class="keywordflow">return</span> <a class="code" href="classCBitmap.html#75fbe14d624d505e1974a63ed6734ec2">m_colortable</a>;
<a name="l00105"></a>00105     }
<a name="l00106"></a>00106 
<a name="l00116"></a><a class="code" href="classCBitmap.html#e147fecf0bfadb0f31205f9b6c88d022">00116</a>     uint32_t <a class="code" href="classCBitmap.html#e147fecf0bfadb0f31205f9b6c88d022" title="Returns number of bytes of one row.">getRowSize</a>()
<a name="l00117"></a>00117     {
<a name="l00118"></a>00118       <span class="keywordflow">return</span> <a class="code" href="classCBitmap.html#ce883b7452cd9221c3a89c1369d89ede">m_rowsize</a>;
<a name="l00119"></a>00119     }
<a name="l00120"></a>00120 
<a name="l00130"></a>00130     <span class="keyword">virtual</span> <span class="keyword">const</span> uint32_t <a class="code" href="classCBitmap.html#7ea12e77a86c283ce173785c64384c33" title="Return size of pixelbuffer.">getPixelDataSize</a>() = 0;
<a name="l00131"></a>00131 
<a name="l00141"></a>00141     <span class="keyword">virtual</span> <span class="keyword">const</span> uint32_t <a class="code" href="classCBitmap.html#a69618d5309e1f51741a8be98ce44c02" title="Return height of bitmap in pixel.">getHeight</a>() = 0;
<a name="l00142"></a>00142 
<a name="l00152"></a>00152     <span class="keyword">virtual</span> <span class="keyword">const</span> uint32_t <a class="code" href="classCBitmap.html#82ffb686b4d4c7465c5239a984bf6fe4" title="Return width of bitmap in pixel.">getWidth</a>() = 0;
<a name="l00153"></a>00153 
<a name="l00163"></a>00163     <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">bool</span> <a class="code" href="classCBitmap.html#cd6bfd1ffca5f3c6d0faa29275733bad" title="Windows Bitmaps can be stored upside down.">isMirrored</a>() = 0;
<a name="l00164"></a>00164 
<a name="l00175"></a>00175     <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">bool</span> <a class="code" href="classCBitmap.html#9b38397779b83cbc0a71e40cc3995025" title="Check if bitmap has a colortable (we don&amp;#39;t support this yet for windows bitmaps)...">hasColorTable</a>() = 0;
<a name="l00176"></a>00176 
<a name="l00177"></a>00177   <span class="keyword">protected</span>:
<a name="l00189"></a>00189     <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&amp; func, <span class="keyword">const</span> std::list&lt;std::string&gt;&amp; params);
<a name="l00190"></a>00190 
<a name="l00203"></a>00203     <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&lt;std::string&gt; params);
<a name="l00204"></a>00204 
<a name="l00216"></a>00216     <span class="keywordtype">void</span> <a class="code" href="classCBitmap.html#c2f7bb14098df5016402437880635fa0" title="Invert image.">invert</a>(std::list&lt;std::string&gt; params);
<a name="l00217"></a>00217 
<a name="l00229"></a>00229     <span class="keywordtype">void</span> <a class="code" href="classCBitmap.html#5e0048029b6d65ef086e6f293ae36907" title="Increase/decrease brightness of image.">brightness</a>(std::list&lt;std::string&gt; params);
<a name="l00230"></a>00230 
<a name="l00242"></a>00242     <span class="keywordtype">void</span> <a class="code" href="classCBitmap.html#0f0ca031109f3ac980ab90bfb45e8f18" title="Mirror image around the y-axis.">mirror_y</a>(std::list&lt;std::string&gt; params);
<a name="l00243"></a>00243 
<a name="l00255"></a>00255     <span class="keywordtype">void</span> <a class="code" href="classCBitmap.html#3e5ce92bca4798dd6f0764245d9bedee" title="Mirror image around the x-axis.">mirror_x</a>(std::list&lt;std::string&gt; params);
<a name="l00256"></a>00256 
<a name="l00257"></a>00257     <span class="comment">/* members */</span>
<a name="l00259"></a><a class="code" href="classCBitmap.html#fd64be4c5cdaff861f0b040edc697138">00259</a>     uint8_t *<a class="code" href="classCBitmap.html#fd64be4c5cdaff861f0b040edc697138">m_pixeldata</a>;
<a name="l00261"></a><a class="code" href="classCBitmap.html#75fbe14d624d505e1974a63ed6734ec2">00261</a>     std::map&lt;uint32_t, CPixelFormat::RGBPIXEL *&gt; <a class="code" href="classCBitmap.html#75fbe14d624d505e1974a63ed6734ec2">m_colortable</a>;
<a name="l00263"></a><a class="code" href="classCBitmap.html#489f5f53a63fd10246694375f26df57a">00263</a>     std::set&lt;CPixelFormat *&gt; <a class="code" href="classCBitmap.html#489f5f53a63fd10246694375f26df57a">m_handlers</a>;
<a name="l00265"></a><a class="code" href="classCBitmap.html#e9a1708eb34853ade75a0f5d82fbaae3">00265</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="l00267"></a><a class="code" href="classCBitmap.html#ce883b7452cd9221c3a89c1369d89ede">00267</a>     uint32_t <a class="code" href="classCBitmap.html#ce883b7452cd9221c3a89c1369d89ede">m_rowsize</a>;
<a name="l00268"></a>00268 };
<a name="l00269"></a>00269 
<a name="l00270"></a>00270 <span class="preprocessor">#endif</span>
<a name="l00271"></a>00271 <span class="preprocessor"></span>
<a name="l00272"></a>00272 <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:25 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>