summaryrefslogtreecommitdiffstats
path: root/ue2/imgsynth2/cpixelformat_indexed8.h
diff options
context:
space:
mode:
authorGünther Neuwirth <e0626638@student.tuwien.ac.at>2009-05-01 14:58:58 +0200
committerGünther Neuwirth <e0626638@student.tuwien.ac.at>2009-05-01 14:58:58 +0200
commitb0442de485dcb6328366d9b05a62af345e5fa39f (patch)
tree594628ba235e526ed54554cf72794b71624f4591 /ue2/imgsynth2/cpixelformat_indexed8.h
parent6b89034cd15a2ca270591aec89b8b13c868b86fc (diff)
downloadooprog-b0442de485dcb6328366d9b05a62af345e5fa39f.tar.gz
ooprog-b0442de485dcb6328366d9b05a62af345e5fa39f.tar.bz2
ooprog-b0442de485dcb6328366d9b05a62af345e5fa39f.zip
Adding cpixelformat_indexd8.h and .cpp. Adding virtual methode getColorMode to CPixelFormat. Adding color table to CBitmap. Adding implementation of CPixmap
Diffstat (limited to 'ue2/imgsynth2/cpixelformat_indexed8.h')
-rw-r--r--ue2/imgsynth2/cpixelformat_indexed8.h102
1 files changed, 102 insertions, 0 deletions
diff --git a/ue2/imgsynth2/cpixelformat_indexed8.h b/ue2/imgsynth2/cpixelformat_indexed8.h
new file mode 100644
index 0000000..ff95840
--- /dev/null
+++ b/ue2/imgsynth2/cpixelformat_indexed8.h
@@ -0,0 +1,102 @@
1/**
2 * @module cpixelformat_bgr24
3 * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348)
4 * @brief Implementation of CPixelFormat handling 24bit color Windows Bitmaps.
5 * @date 18.04.2009
6 */
7
8#ifndef CPixelFormat_Indexed8_H
9#define CPixelFormat_Indexed8_H
10
11#include <fstream>
12#include "cpixelformat.h"
13#include "cpixmap.h"
14/**
15 * @class CPixelFormat_Indexed8
16 * @brief Implementation of CPixelFormat handling 24bit color Windows Bitmaps.
17 *
18 * On error CPixelFormat::PixelFormatError is thrown.
19 */
20class CPixelFormat_Indexed8 : public CPixelFormat
21{
22 public:
23 /**
24 * @method CPixelFormat_Indexed8
25 * @brief Default ctor
26 * @param bitmap pointer to CBitmap instance
27 * @return -
28 * @globalvars none
29 * @exception none
30 * @conditions none
31 */
32 CPixelFormat_Indexed8(CPixmap *pixmap)
33 : CPixelFormat(pixmap)
34 {}
35
36 /**
37 * @method ~CPixelFormat_Indexed8
38 * @brief Default dtor
39 * @param -
40 * @return -
41 * @globalvars none
42 * @exception none
43 * @conditions none
44 */
45 ~CPixelFormat_Indexed8()
46 {}
47
48 /**
49 * @method setPixel
50 * @brief Modifies pixel at coordinates x, y
51 * @param pixel pointer to new pixel data
52 * @param x x-coordinate
53 * @param y y-coordinate
54 * @return -
55 * @globalvars none
56 * @exception PixelFormatError
57 * @conditions none
58 */
59 void setPixel(const uint32_t *pixel, uint32_t x, uint32_t y);
60
61 /* TODO */
62 void getPixel(uint32_t *pixel, uint32_t x, uint32_t y);
63
64 /**
65 * @method getBitCount
66 * @brief returns the bitcount needed for indexing the color tabel.
67 * @param -
68 * @return bitcount of indexes supported by this class
69 * @globalvars none
70 * @exception none
71 * @conditions none
72 */
73 uint32_t getBitCount()
74 {
75 return 8;
76 }
77
78 /**
79 * @method getColorMode
80 * @brief returns the color mode supported by this class
81 * @param -
82 * @return color mode supported by this class
83 * @globalvars none
84 * @exception none
85 * @conditions none
86 */
87 std::string getColorMode()
88 {
89 return "c";
90 }
91 /*
92 * TODO
93 */
94 void getMaxColor(unsigned int *red, unsigned int *green, unsigned int *blue)
95 {
96 *red = *green = *blue = 255; /* 2^8 - 1 */
97 }
98};
99
100#endif
101
102/* vim: set et sw=2 ts=2: */