diff options
Diffstat (limited to 'ue2/imgsynth2/cwindowsbitmap.h')
| -rw-r--r-- | ue2/imgsynth2/cwindowsbitmap.h | 77 |
1 files changed, 19 insertions, 58 deletions
diff --git a/ue2/imgsynth2/cwindowsbitmap.h b/ue2/imgsynth2/cwindowsbitmap.h index 420ad1e..d348a93 100644 --- a/ue2/imgsynth2/cwindowsbitmap.h +++ b/ue2/imgsynth2/cwindowsbitmap.h | |||
| @@ -11,17 +11,10 @@ | |||
| 11 | #include <stdint.h> | 11 | #include <stdint.h> |
| 12 | #include "cbitmap.h" | 12 | #include "cbitmap.h" |
| 13 | 13 | ||
| 14 | class CPixelFormat; | ||
| 15 | #include "cpixelformat.h" | ||
| 16 | |||
| 17 | /** | 14 | /** |
| 18 | * @class CWindowsBitmap | 15 | * @class CWindowsBitmap |
| 19 | * @brief Implementation of CBitmap handling Windows Bitmaps. | 16 | * @brief Implementation of CBitmap handling Windows Bitmaps. |
| 20 | * | 17 | * |
| 21 | * In order to support operations on bitmaps with different color bitcounts | ||
| 22 | * different implementations of CPixelFormat are used. These classes are | ||
| 23 | * allowed to modify the bitmap headers and pixelbuffer directly. | ||
| 24 | * | ||
| 25 | * On error CFile::FileError is thrown. | 18 | * On error CFile::FileError is thrown. |
| 26 | */ | 19 | */ |
| 27 | class CWindowsBitmap : public CBitmap | 20 | class CWindowsBitmap : public CBitmap |
| @@ -74,19 +67,6 @@ class CWindowsBitmap : public CBitmap | |||
| 74 | */ | 67 | */ |
| 75 | void write(std::ofstream& out); | 68 | void write(std::ofstream& out); |
| 76 | 69 | ||
| 77 | /** | ||
| 78 | * @method callFunc | ||
| 79 | * @brief Delegates the function and its parameters to the correct | ||
| 80 | * internal method | ||
| 81 | * @param func function name | ||
| 82 | * @param params function parameters as list | ||
| 83 | * @return - | ||
| 84 | * @globalvars none | ||
| 85 | * @exception ParserError | ||
| 86 | * @conditions none | ||
| 87 | */ | ||
| 88 | void callFunc(const std::string& func, const std::list<std::string>& params); | ||
| 89 | |||
| 90 | #ifdef DEBUG | 70 | #ifdef DEBUG |
| 91 | /** | 71 | /** |
| 92 | * @method dump | 72 | * @method dump |
| @@ -177,58 +157,39 @@ class CWindowsBitmap : public CBitmap | |||
| 177 | return m_infoheader; | 157 | return m_infoheader; |
| 178 | } | 158 | } |
| 179 | 159 | ||
| 180 | /** | 160 | /* TODO */ |
| 181 | * @method getPixelData | 161 | const uint32_t getPixelDataSize() |
| 182 | * @brief Returns pointer to pixelbuffer | ||
| 183 | * @param - | ||
| 184 | * @return pointer to pixelbuffer | ||
| 185 | * @globalvars none | ||
| 186 | * @exception none | ||
| 187 | * @conditions none | ||
| 188 | */ | ||
| 189 | uint8_t *getPixelData() | ||
| 190 | { | 162 | { |
| 191 | return m_pixeldata; | 163 | return m_infoheader.biSizeImage; |
| 192 | } | 164 | } |
| 193 | 165 | ||
| 194 | protected: | ||
| 195 | /** | ||
| 196 | * @method fillrect | ||
| 197 | * @brief Fills rectangle in image starting on position x, y | ||
| 198 | * width size width, height and color red, green, blue. | ||
| 199 | * @param params function parameters as list | ||
| 200 | * @return - | ||
| 201 | * @globalvars none | ||
| 202 | * @exception FileError | ||
| 203 | * @conditions none | ||
| 204 | * | ||
| 205 | * Scriptfile syntax: fillrect(x, y, width, height, red, green, blue) | ||
| 206 | */ | ||
| 207 | void fillrect(std::list<std::string> params); | ||
| 208 | |||
| 209 | /* TODO */ | ||
| 210 | void invert(std::list<std::string> params); | ||
| 211 | |||
| 212 | /* TODO */ | 166 | /* TODO */ |
| 213 | void brightness(std::list<std::string> params); | 167 | const uint32_t getHeight() |
| 168 | { | ||
| 169 | /* width and height can be negativ */ | ||
| 170 | return static_cast<uint32_t>(abs(m_infoheader.biHeight)); | ||
| 171 | } | ||
| 214 | 172 | ||
| 215 | /* TODO */ | 173 | /* TODO */ |
| 216 | void mirror_y(std::list<std::string> params); | 174 | const uint32_t getWidth() |
| 175 | { | ||
| 176 | /* width and height can be negativ */ | ||
| 177 | return static_cast<uint32_t>(abs(m_infoheader.biWidth)); | ||
| 178 | } | ||
| 217 | 179 | ||
| 218 | /* TODO */ | 180 | /* TODO */ |
| 219 | void mirror_x(std::list<std::string> params); | 181 | const bool isMirrored() |
| 182 | { | ||
| 183 | /* if height is positive the y-coordinates are mirrored */ | ||
| 184 | return (m_infoheader.biHeight > 0) ? true : false; | ||
| 185 | } | ||
| 220 | 186 | ||
| 187 | protected: | ||
| 221 | /* members */ | 188 | /* members */ |
| 222 | /** fileheader */ | 189 | /** fileheader */ |
| 223 | BITMAP_FILEHEADER m_fileheader; | 190 | BITMAP_FILEHEADER m_fileheader; |
| 224 | /** infoheader */ | 191 | /** infoheader */ |
| 225 | BITMAP_INFOHEADER m_infoheader; | 192 | BITMAP_INFOHEADER m_infoheader; |
| 226 | /** pointer to pixelbuffer */ | ||
| 227 | uint8_t *m_pixeldata; | ||
| 228 | /** set of supported PixelFormat handlers */ | ||
| 229 | std::set<CPixelFormat *> m_handlers; | ||
| 230 | /** pointer to CPixelFormat implementation */ | ||
| 231 | CPixelFormat *m_pixelformat; | ||
| 232 | }; | 193 | }; |
| 233 | 194 | ||
| 234 | #endif | 195 | #endif |
