summaryrefslogtreecommitdiffstats
path: root/ue2/imgsynth2/cpixelformat_bgr555.h
diff options
context:
space:
mode:
authormanuel <manuel@nc8430.lan>2009-04-27 00:25:16 +0200
committermanuel <manuel@nc8430.lan>2009-04-27 00:25:16 +0200
commitaa139a7d2b3f26af7590edbf413df67195c5d900 (patch)
treeba99ea3b2af9aa191386550f025520117f18f4f8 /ue2/imgsynth2/cpixelformat_bgr555.h
parent384539f7cc9feaa7ef7cee385cce472c6966c843 (diff)
downloadooprog-aa139a7d2b3f26af7590edbf413df67195c5d900.tar.gz
ooprog-aa139a7d2b3f26af7590edbf413df67195c5d900.tar.bz2
ooprog-aa139a7d2b3f26af7590edbf413df67195c5d900.zip
Adding ue2
Diffstat (limited to 'ue2/imgsynth2/cpixelformat_bgr555.h')
-rw-r--r--ue2/imgsynth2/cpixelformat_bgr555.h96
1 files changed, 96 insertions, 0 deletions
diff --git a/ue2/imgsynth2/cpixelformat_bgr555.h b/ue2/imgsynth2/cpixelformat_bgr555.h
new file mode 100644
index 0000000..7a49c7c
--- /dev/null
+++ b/ue2/imgsynth2/cpixelformat_bgr555.h
@@ -0,0 +1,96 @@
1/**
2 * @module cpixelformat_bgr555
3 * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348)
4 * @brief Implementation of CPixelFormat handling BGR555 color (real color)
5 * Windows Bitmaps.
6 * @date 26.04.2009
7 */
8
9#ifndef CPIXELFORMAT_BGR555_H
10#define CPIXELFORMAT_BGR555_H
11
12#include <fstream>
13#include "cpixelformat.h"
14
15/* TODO */
16#define BGR555_RED_SHIFT 10
17#define BGR555_GREEN_SHIFT 5
18#define BGR555_BLUE_SHIFT 0
19#define BGR555_RED_MASK 0x7C00
20#define BGR555_GREEN_MASK 0x03E0
21#define BGR555_BLUE_MASK 0x001F
22
23/**
24 * @class CPixelFormat_BGR555
25 * @brief Implementation of CPixelFormat handling BGR555 color (real color)
26 * Windows Bitmaps.
27 *
28 * On error CPixelFormat::PixelFormatError is thrown.
29 */
30class CPixelFormat_BGR555 : public CPixelFormat
31{
32 public:
33 /**
34 * @method CPixelFormat_BGR55
35 * @brief Default ctor
36 * @param bitmap pointer to CBitmap instance
37 * @return -
38 * @globalvars none
39 * @exception none
40 * @conditions none
41 */
42 CPixelFormat_BGR555(CBitmap *bitmap)
43 : CPixelFormat(bitmap)
44 {}
45
46 /**
47 * @method ~CPixelFormat_BGR555
48 * @brief Default dtor
49 * @param -
50 * @return -
51 * @globalvars none
52 * @exception none
53 * @conditions none
54 */
55 ~CPixelFormat_BGR555()
56 {}
57
58 /**
59 * @method setPixel
60 * @brief Modifies pixel at coordinates x, y
61 * @param pixel pointer to new pixel data
62 * @param x x-coordinate
63 * @param y y-coordinate
64 * @return -
65 * @globalvars none
66 * @exception PixelFormatError
67 * @conditions none
68 */
69 void setPixel(const uint32_t *pixel, uint32_t x, uint32_t y);
70
71 /**
72 * @method getBitCount
73 * @brief returns color bitcount supported by this class
74 * @param -
75 * @return color bitcount supported by this class
76 * @globalvars none
77 * @exception none
78 * @conditions none
79 */
80 uint32_t getBitCount()
81 {
82 return 16;
83 }
84
85 /*
86 * TODO
87 */
88 void getMaxColor(unsigned int *red, unsigned int *green, unsigned int *blue)
89 {
90 *red = *green = *blue = 31; /* 2^5 -1 */
91 }
92};
93
94#endif
95
96/* vim: set et sw=2 ts=2: */