From b22395ec4de60326eb629df882b4b8781dbca15c Mon Sep 17 00:00:00 2001 From: manuel Date: Fri, 1 May 2009 14:54:45 +0200 Subject: - removed runtime generated output files - implemented brightness() - implemented invert() - implemented getPixel in CPixelFormat_BGR24 and CPixelFormat_BGR555 --- ue2/imgsynth2/cbitmap.h | 130 +++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 117 insertions(+), 13 deletions(-) (limited to 'ue2/imgsynth2/cbitmap.h') diff --git a/ue2/imgsynth2/cbitmap.h b/ue2/imgsynth2/cbitmap.h index f8f8850..df7dc84 100644 --- a/ue2/imgsynth2/cbitmap.h +++ b/ue2/imgsynth2/cbitmap.h @@ -9,9 +9,8 @@ #define CBITMAP_H #include +#include #include "cfile.h" - -class CPixelFormat; #include "cpixelformat.h" /** @@ -53,12 +52,28 @@ class CBitmap : public CFile virtual ~CBitmap(); /** - * TODO + * @method read + * @brief Reads Windows Bitmap from filestream. + * On error an exception is thrown. + * @param in filestream to read data from + * @return - + * @globalvars none + * @exception CFile::FileError + * @exception bad_alloc + * @conditions none */ virtual void read(std::ifstream& in) = 0; /** - * TODO + * @method write + * @brief Writes Windows Bitmap to filestream. + * @param out filestream to read data from + * @param filename filename (maybe useful for some handlers) + * @return - + * @globalvars none + * @exception FileError + * @exception bad_alloc + * @conditions none */ virtual void write(std::ofstream& out, std::string& filename) = 0; @@ -76,15 +91,62 @@ class CBitmap : public CFile return m_pixeldata; } - /* TODO */ + /** + * @method getPixelDataSize + * @brief Return size of pixelbuffer + * @param - + * @return size of pixelbuffer + * @globalvars none + * @exception none + * @conditions none + */ virtual const uint32_t getPixelDataSize() = 0; - /* TODO */ + + /** + * @method getHeight + * @brief Return height of bitmap in pixel + * @param - + * @return height of bitmap in pixel + * @globalvars none + * @exception none + * @conditions none + */ virtual const uint32_t getHeight() = 0; - /* TODO */ + + /** + * @method getWidth + * @brief Return width of bitmap in pixel + * @param - + * @return width of bitmap in pixel + * @globalvars none + * @exception none + * @conditions none + */ virtual const uint32_t getWidth() = 0; - /* TODO */ + + /** + * @method isMirrored + * @brief Windows Bitmaps can be stored upside down + * @param - + * @return true if bitmap is stored upside down. false otherwise + * @globalvars none + * @exception none + * @conditions none + */ virtual const bool isMirrored() = 0; + /** + * @method hasColorTable + * @brief Check if bitmap has a colortable + * (we don't support this yet for windows bitmaps) + * @param - + * @return true if bitmap has a colortable. false otherwise + * @globalvars none + * @exception none + * @conditions none + */ + virtual const bool hasColorTable() = 0; + protected: /** * @method callFunc @@ -99,7 +161,7 @@ class CBitmap : public CFile */ void callFunc(const std::string& func, const std::list& params); - /** + /** * @method fillrect * @brief Fills rectangle in image starting on position x, y * width size width, height and color red, green, blue. @@ -113,21 +175,63 @@ class CBitmap : public CFile */ void fillrect(std::list params); - /* TODO */ + /** + * @method invert + * @brief Invert image + * @param params function parameters as list + * @return - + * @globalvars none + * @exception FileError + * @conditions none + * + * Scriptfile syntax: invert() + */ void invert(std::list params); - /* TODO */ + /** + * @method brightness + * @brief Increase/decrease brightness of image + * @param params function parameters as list + * @return - + * @globalvars none + * @exception FileError + * @conditions none + * + * Scriptfile syntax: brightness(factor) + */ void brightness(std::list params); - /* TODO */ + /** + * @method mirror_y + * @brief Mirror image around the y-axis + * @param params function parameters as list + * @return - + * @globalvars none + * @exception FileError + * @conditions none + * + * Scriptfile syntax: mirror_y() + */ void mirror_y(std::list params); - /* TODO */ + /** + * @method mirror_x + * @brief Mirror image around the x-axis + * @param params function parameters as list + * @return - + * @globalvars none + * @exception FileError + * @conditions none + * + * Scriptfile syntax: mirror_y() + */ void mirror_x(std::list params); /* members */ /** pointer to pixelbuffer */ uint8_t *m_pixeldata; + /** colortable map */ + std::map m_colortable; /** set of supported PixelFormat handlers */ std::set m_handlers; /** pointer to CPixelFormat implementation */ -- cgit v1.2.3