summaryrefslogtreecommitdiffstats
path: root/ue2/imgsynth2/cbitmap.h
diff options
context:
space:
mode:
authormanuel <manuel@clan-server.at>2009-04-28 18:32:15 +0200
committermanuel <manuel@clan-server.at>2009-04-28 18:32:15 +0200
commit5f499a8233c7bb68b52b8fdeddac9a06061ea4d7 (patch)
tree894f18cf427eb83c6463a92da76f4a3808a8187c /ue2/imgsynth2/cbitmap.h
parentd7893436cefc6b3cef78ad765dba4fa1740d0f15 (diff)
downloadooprog-5f499a8233c7bb68b52b8fdeddac9a06061ea4d7.tar.gz
ooprog-5f499a8233c7bb68b52b8fdeddac9a06061ea4d7.tar.bz2
ooprog-5f499a8233c7bb68b52b8fdeddac9a06061ea4d7.zip
Moved a lot of stuff around to get abstract cbitmap working
Diffstat (limited to 'ue2/imgsynth2/cbitmap.h')
-rw-r--r--ue2/imgsynth2/cbitmap.h77
1 files changed, 72 insertions, 5 deletions
diff --git a/ue2/imgsynth2/cbitmap.h b/ue2/imgsynth2/cbitmap.h
index c43e01d..c8a7f0d 100644
--- a/ue2/imgsynth2/cbitmap.h
+++ b/ue2/imgsynth2/cbitmap.h
@@ -1,7 +1,7 @@
1/** 1/**
2 * @module cbitmap 2 * @module cbitmap
3 * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348) 3 * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348)
4 * @brief Implementation of CFile handling Bitmaps. 4 * @brief Abstract implementation of CFile handling Bitmaps.
5 * @date 17.04.2009 5 * @date 17.04.2009
6 */ 6 */
7 7
@@ -37,8 +37,10 @@ class CBitmap : public CFile
37 * @conditions none 37 * @conditions none
38 */ 38 */
39 CBitmap() 39 CBitmap()
40 : m_pixeldata(NULL), m_pixelformat(NULL)
40 {} 41 {}
41 42
43
42 /** 44 /**
43 * @method ~CBitmap 45 * @method ~CBitmap
44 * @brief Default dtor 46 * @brief Default dtor
@@ -48,8 +50,7 @@ class CBitmap : public CFile
48 * @exception none 50 * @exception none
49 * @conditions none 51 * @conditions none
50 */ 52 */
51 virtual ~CBitmap() 53 virtual ~CBitmap();
52 {};
53 54
54 /** 55 /**
55 * TODO 56 * TODO
@@ -62,9 +63,75 @@ class CBitmap : public CFile
62 virtual void write(std::ofstream& out) = 0; 63 virtual void write(std::ofstream& out) = 0;
63 64
64 /** 65 /**
65 * TODO 66 * @method getPixelData
67 * @brief Returns pointer to pixelbuffer
68 * @param -
69 * @return pointer to pixelbuffer
70 * @globalvars none
71 * @exception none
72 * @conditions none
73 */
74 uint8_t *getPixelData()
75 {
76 return m_pixeldata;
77 }
78
79 /* TODO */
80 virtual const uint32_t getPixelDataSize() = 0;
81 /* TODO */
82 virtual const uint32_t getHeight() = 0;
83 /* TODO */
84 virtual const uint32_t getWidth() = 0;
85 /* TODO */
86 virtual const bool isMirrored() = 0;
87
88 protected:
89 /**
90 * @method callFunc
91 * @brief Delegates the function and its parameters to the correct
92 * internal method
93 * @param func function name
94 * @param params function parameters as list
95 * @return -
96 * @globalvars none
97 * @exception ParserError
98 * @conditions none
99 */
100 void callFunc(const std::string& func, const std::list<std::string>& params);
101
102 /**
103 * @method fillrect
104 * @brief Fills rectangle in image starting on position x, y
105 * width size width, height and color red, green, blue.
106 * @param params function parameters as list
107 * @return -
108 * @globalvars none
109 * @exception FileError
110 * @conditions none
111 *
112 * Scriptfile syntax: fillrect(x, y, width, height, red, green, blue)
66 */ 113 */
67 virtual void callFunc(const std::string& func, const std::list<std::string>& params) = 0; 114 void fillrect(std::list<std::string> params);
115
116 /* TODO */
117 void invert(std::list<std::string> params);
118
119 /* TODO */
120 void brightness(std::list<std::string> params);
121
122 /* TODO */
123 void mirror_y(std::list<std::string> params);
124
125 /* TODO */
126 void mirror_x(std::list<std::string> params);
127
128 /* members */
129 /** pointer to pixelbuffer */
130 uint8_t *m_pixeldata;
131 /** set of supported PixelFormat handlers */
132 std::set<CPixelFormat *> m_handlers;
133 /** pointer to CPixelFormat implementation */
134 CPixelFormat *m_pixelformat;
68}; 135};
69 136
70#endif 137#endif