From 5f499a8233c7bb68b52b8fdeddac9a06061ea4d7 Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 28 Apr 2009 18:32:15 +0200 Subject: Moved a lot of stuff around to get abstract cbitmap working --- ue2/imgsynth2/cwindowsbitmap.h | 77 +++++++++++------------------------------- 1 file changed, 19 insertions(+), 58 deletions(-) (limited to 'ue2/imgsynth2/cwindowsbitmap.h') 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 @@ #include #include "cbitmap.h" -class CPixelFormat; -#include "cpixelformat.h" - /** * @class CWindowsBitmap * @brief Implementation of CBitmap handling Windows Bitmaps. * - * In order to support operations on bitmaps with different color bitcounts - * different implementations of CPixelFormat are used. These classes are - * allowed to modify the bitmap headers and pixelbuffer directly. - * * On error CFile::FileError is thrown. */ class CWindowsBitmap : public CBitmap @@ -74,19 +67,6 @@ class CWindowsBitmap : public CBitmap */ void write(std::ofstream& out); - /** - * @method callFunc - * @brief Delegates the function and its parameters to the correct - * internal method - * @param func function name - * @param params function parameters as list - * @return - - * @globalvars none - * @exception ParserError - * @conditions none - */ - void callFunc(const std::string& func, const std::list& params); - #ifdef DEBUG /** * @method dump @@ -177,58 +157,39 @@ class CWindowsBitmap : public CBitmap return m_infoheader; } - /** - * @method getPixelData - * @brief Returns pointer to pixelbuffer - * @param - - * @return pointer to pixelbuffer - * @globalvars none - * @exception none - * @conditions none - */ - uint8_t *getPixelData() + /* TODO */ + const uint32_t getPixelDataSize() { - return m_pixeldata; + return m_infoheader.biSizeImage; } - protected: - /** - * @method fillrect - * @brief Fills rectangle in image starting on position x, y - * width size width, height and color red, green, blue. - * @param params function parameters as list - * @return - - * @globalvars none - * @exception FileError - * @conditions none - * - * Scriptfile syntax: fillrect(x, y, width, height, red, green, blue) - */ - void fillrect(std::list params); - - /* TODO */ - void invert(std::list params); - /* TODO */ - void brightness(std::list params); + const uint32_t getHeight() + { + /* width and height can be negativ */ + return static_cast(abs(m_infoheader.biHeight)); + } /* TODO */ - void mirror_y(std::list params); + const uint32_t getWidth() + { + /* width and height can be negativ */ + return static_cast(abs(m_infoheader.biWidth)); + } /* TODO */ - void mirror_x(std::list params); + const bool isMirrored() + { + /* if height is positive the y-coordinates are mirrored */ + return (m_infoheader.biHeight > 0) ? true : false; + } + protected: /* members */ /** fileheader */ BITMAP_FILEHEADER m_fileheader; /** infoheader */ BITMAP_INFOHEADER m_infoheader; - /** pointer to pixelbuffer */ - uint8_t *m_pixeldata; - /** set of supported PixelFormat handlers */ - std::set m_handlers; - /** pointer to CPixelFormat implementation */ - CPixelFormat *m_pixelformat; }; #endif -- cgit v1.2.3