summaryrefslogtreecommitdiffstats
path: root/ue2/imgsynth2/cpixelformat_indexed8.h
diff options
context:
space:
mode:
authormanuel <manuel@nc8430.lan>2009-05-01 15:41:07 +0200
committermanuel <manuel@nc8430.lan>2009-05-01 15:41:07 +0200
commit766a0da4ab39c26e1d3b591f46cdadcfbe0f8a73 (patch)
treef383a621f2ad762e5be250c2ba9bd4c18bb02a0c /ue2/imgsynth2/cpixelformat_indexed8.h
parentf0442c8d058ae6007023ba1b898197db921e6ce1 (diff)
parentb0442de485dcb6328366d9b05a62af345e5fa39f (diff)
downloadooprog-766a0da4ab39c26e1d3b591f46cdadcfbe0f8a73.tar.gz
ooprog-766a0da4ab39c26e1d3b591f46cdadcfbe0f8a73.tar.bz2
ooprog-766a0da4ab39c26e1d3b591f46cdadcfbe0f8a73.zip
merge
Diffstat (limited to 'ue2/imgsynth2/cpixelformat_indexed8.h')
-rw-r--r--ue2/imgsynth2/cpixelformat_indexed8.h121
1 files changed, 121 insertions, 0 deletions
diff --git a/ue2/imgsynth2/cpixelformat_indexed8.h b/ue2/imgsynth2/cpixelformat_indexed8.h
new file mode 100644
index 0000000..2e2fc01
--- /dev/null
+++ b/ue2/imgsynth2/cpixelformat_indexed8.h
@@ -0,0 +1,121 @@
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/**
16 * @class CPixelFormat_Indexed8
17 * @brief Implementation of CPixelFormat handling 24bit color Windows Bitmaps.
18 *
19 * On error CPixelFormat::PixelFormatError is thrown.
20 */
21class CPixelFormat_Indexed8 : public CPixelFormat
22{
23 public:
24 /**
25 * @method CPixelFormat_Indexed8
26 * @brief Default ctor
27 * @param bitmap pointer to CBitmap instance
28 * @return -
29 * @globalvars none
30 * @exception none
31 * @conditions none
32 */
33 CPixelFormat_Indexed8(CPixmap *pixmap)
34 : CPixelFormat(pixmap)
35 {}
36
37 /**
38 * @method ~CPixelFormat_Indexed8
39 * @brief Default dtor
40 * @param -
41 * @return -
42 * @globalvars none
43 * @exception none
44 * @conditions none
45 */
46 ~CPixelFormat_Indexed8()
47 {}
48
49 /**
50 * @method getPixel
51 * @brief Get pixel at coordinates x, y
52 * @param pixel reference to pixel data
53 * @param x x-coordinate
54 * @param y y-coordinate
55 * @return -
56 * @globalvars none
57 * @exception PixelFormatError
58 * @conditions none
59 */
60 void getPixel(RGBPIXEL& pixel, uint32_t x, uint32_t y);
61
62 /**
63 * @method setPixel
64 * @brief Modifies pixel at coordinates x, y
65 * @param pixel reference to new pixel data
66 * @param x x-coordinate
67 * @param y y-coordinate
68 * @return -
69 * @globalvars none
70 * @exception PixelFormatError
71 * @conditions none
72 */
73 void setPixel(const RGBPIXEL& pixel, uint32_t x, uint32_t y);
74
75 /**
76 * @method getBitCount
77 * @brief returns the bitcount needed for indexing the color tabel.
78 * @param -
79 * @return bitcount of indexes supported by this class
80 * @globalvars none
81 * @exception none
82 * @conditions none
83 */
84 uint32_t getBitCount()
85 {
86 return 8;
87 }
88
89 /**
90 * @method getColorMode
91 * @brief returns the color mode supported by this class
92 * @param -
93 * @return color mode supported by this class
94 * @globalvars none
95 * @exception none
96 * @conditions none
97 */
98 const std::string getColorMode()
99 {
100 return "c";
101 }
102
103 /**
104 * @method getMaxColor
105 * @brief Get maximum values for RGB pixel
106 * @param pixel reference to pixel struct
107 * @return -
108 * @globalvars none
109 * @exception none
110 * @conditions none
111 */
112 void getMaxColor(RGBPIXEL& pixel)
113 {
114 /* value = 2^8 - 1 */
115 pixel.red = pixel.green = pixel.blue = 255;
116 }
117};
118
119#endif
120
121/* vim: set et sw=2 ts=2: */