From b0442de485dcb6328366d9b05a62af345e5fa39f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Neuwirth?= Date: Fri, 1 May 2009 14:58:58 +0200 Subject: Adding cpixelformat_indexd8.h and .cpp. Adding virtual methode getColorMode to CPixelFormat. Adding color table to CBitmap. Adding implementation of CPixmap --- ue2/imgsynth2/cpixelformat_indexed8.h | 102 ++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 ue2/imgsynth2/cpixelformat_indexed8.h (limited to 'ue2/imgsynth2/cpixelformat_indexed8.h') diff --git a/ue2/imgsynth2/cpixelformat_indexed8.h b/ue2/imgsynth2/cpixelformat_indexed8.h new file mode 100644 index 0000000..ff95840 --- /dev/null +++ b/ue2/imgsynth2/cpixelformat_indexed8.h @@ -0,0 +1,102 @@ +/** + * @module cpixelformat_bgr24 + * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348) + * @brief Implementation of CPixelFormat handling 24bit color Windows Bitmaps. + * @date 18.04.2009 + */ + +#ifndef CPixelFormat_Indexed8_H +#define CPixelFormat_Indexed8_H + +#include +#include "cpixelformat.h" +#include "cpixmap.h" +/** + * @class CPixelFormat_Indexed8 + * @brief Implementation of CPixelFormat handling 24bit color Windows Bitmaps. + * + * On error CPixelFormat::PixelFormatError is thrown. + */ +class CPixelFormat_Indexed8 : public CPixelFormat +{ + public: + /** + * @method CPixelFormat_Indexed8 + * @brief Default ctor + * @param bitmap pointer to CBitmap instance + * @return - + * @globalvars none + * @exception none + * @conditions none + */ + CPixelFormat_Indexed8(CPixmap *pixmap) + : CPixelFormat(pixmap) + {} + + /** + * @method ~CPixelFormat_Indexed8 + * @brief Default dtor + * @param - + * @return - + * @globalvars none + * @exception none + * @conditions none + */ + ~CPixelFormat_Indexed8() + {} + + /** + * @method setPixel + * @brief Modifies pixel at coordinates x, y + * @param pixel pointer to new pixel data + * @param x x-coordinate + * @param y y-coordinate + * @return - + * @globalvars none + * @exception PixelFormatError + * @conditions none + */ + void setPixel(const uint32_t *pixel, uint32_t x, uint32_t y); + + /* TODO */ + void getPixel(uint32_t *pixel, uint32_t x, uint32_t y); + + /** + * @method getBitCount + * @brief returns the bitcount needed for indexing the color tabel. + * @param - + * @return bitcount of indexes supported by this class + * @globalvars none + * @exception none + * @conditions none + */ + uint32_t getBitCount() + { + return 8; + } + + /** + * @method getColorMode + * @brief returns the color mode supported by this class + * @param - + * @return color mode supported by this class + * @globalvars none + * @exception none + * @conditions none + */ + std::string getColorMode() + { + return "c"; + } + /* + * TODO + */ + void getMaxColor(unsigned int *red, unsigned int *green, unsigned int *blue) + { + *red = *green = *blue = 255; /* 2^8 - 1 */ + } +}; + +#endif + +/* vim: set et sw=2 ts=2: */ -- cgit v1.2.3