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/cpixelformat_bgr555.h | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) (limited to 'ue2/imgsynth2/cpixelformat_bgr555.h') diff --git a/ue2/imgsynth2/cpixelformat_bgr555.h b/ue2/imgsynth2/cpixelformat_bgr555.h index b04e4be..f131214 100644 --- a/ue2/imgsynth2/cpixelformat_bgr555.h +++ b/ue2/imgsynth2/cpixelformat_bgr555.h @@ -12,7 +12,7 @@ #include #include "cpixelformat.h" -/* TODO */ +/* to (un-)pack pixel values */ #define BGR555_RED_SHIFT 10 #define BGR555_GREEN_SHIFT 5 #define BGR555_BLUE_SHIFT 0 @@ -55,13 +55,23 @@ class CPixelFormat_BGR555 : public CPixelFormat ~CPixelFormat_BGR555() {} - /* TODO */ - void getPixel(uint32_t *pixel, uint32_t x, uint32_t y); + /** + * @method getPixel + * @brief Get pixel at coordinates x, y + * @param pixel reference to pixel data + * @param x x-coordinate + * @param y y-coordinate + * @return - + * @globalvars none + * @exception PixelFormatError + * @conditions none + */ + void getPixel(RGBPIXEL& pixel, uint32_t x, uint32_t y); /** * @method setPixel * @brief Modifies pixel at coordinates x, y - * @param pixel pointer to new pixel data + * @param pixel reference to new pixel data * @param x x-coordinate * @param y y-coordinate * @return - @@ -69,7 +79,7 @@ class CPixelFormat_BGR555 : public CPixelFormat * @exception PixelFormatError * @conditions none */ - void setPixel(const uint32_t *pixel, uint32_t x, uint32_t y); + void setPixel(const RGBPIXEL& pixel, uint32_t x, uint32_t y); /** * @method getBitCount @@ -85,12 +95,19 @@ class CPixelFormat_BGR555 : public CPixelFormat return 16; } - /* - * TODO + /** + * @method getMaxColor + * @brief Get maximum values for RGB pixel + * @param pixel reference to pixel struct + * @return - + * @globalvars none + * @exception none + * @conditions none */ - void getMaxColor(unsigned int *red, unsigned int *green, unsigned int *blue) + void getMaxColor(RGBPIXEL& pixel) { - *red = *green = *blue = 31; /* 2^5 -1 */ + /* value = 2^5 - 1 */ + pixel.red = pixel.green = pixel.blue = 31; } }; -- cgit v1.2.3