summaryrefslogtreecommitdiffstats
path: root/ue2/doxygen/cpixelformat__bgr555_8h-source.html
blob: 7734d94672bc7c96a12dd0d51988eab0e2fc84c3 (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
<!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/cpixelformat_bgr555.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/cpixelformat_bgr555.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00009"></a>00009 <span class="preprocessor">#ifndef CPIXELFORMAT_BGR555_H</span>
<a name="l00010"></a>00010 <span class="preprocessor"></span><span class="preprocessor">#define CPIXELFORMAT_BGR555_H</span>
<a name="l00011"></a>00011 <span class="preprocessor"></span>
<a name="l00012"></a>00012 <span class="preprocessor">#include &lt;fstream&gt;</span>
<a name="l00013"></a>00013 <span class="preprocessor">#include "cpixelformat.h"</span>
<a name="l00014"></a>00014 
<a name="l00015"></a>00015 <span class="comment">/* to (un-)pack pixel values */</span>
<a name="l00016"></a>00016 <span class="preprocessor">#define BGR555_RED_SHIFT    10</span>
<a name="l00017"></a>00017 <span class="preprocessor"></span><span class="preprocessor">#define BGR555_GREEN_SHIFT  5</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define BGR555_BLUE_SHIFT   0</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#define BGR555_RED_MASK     0x7C00</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span><span class="preprocessor">#define BGR555_GREEN_MASK   0x03E0</span>
<a name="l00021"></a>00021 <span class="preprocessor"></span><span class="preprocessor">#define BGR555_BLUE_MASK    0x001F</span>
<a name="l00022"></a>00022 <span class="preprocessor"></span>
<a name="l00030"></a><a class="code" href="classCPixelFormat__BGR555.html">00030</a> <span class="keyword">class </span><a class="code" href="classCPixelFormat__BGR555.html" title="Implementation of CPixelFormat handling BGR555 color (real color) Windows Bitmaps...">CPixelFormat_BGR555</a> : <span class="keyword">public</span> <a class="code" href="classCPixelFormat.html" title="Abstract class for handling different color bitcount of Bitmaps.">CPixelFormat</a>
<a name="l00031"></a>00031 {
<a name="l00032"></a>00032   <span class="keyword">public</span>:
<a name="l00042"></a><a class="code" href="classCPixelFormat__BGR555.html#c3fa9af8106ca1a2615f74562d2bde53">00042</a>     <a class="code" href="classCPixelFormat__BGR555.html#c3fa9af8106ca1a2615f74562d2bde53" title="Default ctor.">CPixelFormat_BGR555</a>(<a class="code" href="classCBitmap.html" title="Abstract implementation of CFile handling Bitmaps.">CBitmap</a> *bitmap)
<a name="l00043"></a>00043       : <a class="code" href="classCPixelFormat.html" title="Abstract class for handling different color bitcount of Bitmaps.">CPixelFormat</a>(bitmap)
<a name="l00044"></a>00044     {}
<a name="l00045"></a>00045 
<a name="l00055"></a><a class="code" href="classCPixelFormat__BGR555.html#74adfd6f7bc4f80a3176a292f44f56d3">00055</a>     <a class="code" href="classCPixelFormat__BGR555.html#74adfd6f7bc4f80a3176a292f44f56d3" title="Default dtor.">~CPixelFormat_BGR555</a>()
<a name="l00056"></a>00056     {}
<a name="l00057"></a>00057 
<a name="l00069"></a>00069     <span class="keywordtype">void</span> <a class="code" href="classCPixelFormat__BGR555.html#412147b04dddc1e563425aabb71575c4" title="Get pixel at coordinates x, y.">getPixel</a>(RGBPIXEL&amp; pixel, uint32_t x, uint32_t y);
<a name="l00070"></a>00070 
<a name="l00082"></a>00082     <span class="keywordtype">void</span> <a class="code" href="classCPixelFormat__BGR555.html#5c6f6b8feac223de4a702489bdb3dd4a" title="Modifies pixel at coordinates x, y.">setPixel</a>(<span class="keyword">const</span> RGBPIXEL&amp; pixel, uint32_t x, uint32_t y);
<a name="l00083"></a>00083 
<a name="l00093"></a><a class="code" href="classCPixelFormat__BGR555.html#5b9994732731fa813b055df01cb2dd05">00093</a>     uint32_t <a class="code" href="classCPixelFormat__BGR555.html#5b9994732731fa813b055df01cb2dd05" title="returns color bitcount supported by this class">getBitCount</a>()
<a name="l00094"></a>00094     {
<a name="l00095"></a>00095       <span class="keywordflow">return</span> 16;
<a name="l00096"></a>00096     }
<a name="l00097"></a>00097 
<a name="l00107"></a><a class="code" href="classCPixelFormat__BGR555.html#c3991530246a1ca0bd1ec5ad0327a42c">00107</a>     <span class="keywordtype">void</span> <a class="code" href="classCPixelFormat__BGR555.html#c3991530246a1ca0bd1ec5ad0327a42c" title="Get maximum values for RGB pixel.">getMaxColor</a>(RGBPIXEL&amp; pixel)
<a name="l00108"></a>00108     {
<a name="l00109"></a>00109       <span class="comment">/* value = 2^5 - 1 */</span>
<a name="l00110"></a>00110       pixel.red = pixel.green = pixel.blue = 31;
<a name="l00111"></a>00111     }
<a name="l00112"></a>00112 };
<a name="l00113"></a>00113 
<a name="l00114"></a>00114 <span class="preprocessor">#endif</span>
<a name="l00115"></a>00115 <span class="preprocessor"></span>
<a name="l00116"></a>00116 <span class="comment">/* vim: set et sw=2 ts=2: */</span>
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Sat May 2 18:58:11 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>