diff options
Diffstat (limited to 'ue2/imgsynth2/cpixelformat.h')
| -rw-r--r-- | ue2/imgsynth2/cpixelformat.h | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/ue2/imgsynth2/cpixelformat.h b/ue2/imgsynth2/cpixelformat.h index 2300f2f..18d1a7d 100644 --- a/ue2/imgsynth2/cpixelformat.h +++ b/ue2/imgsynth2/cpixelformat.h | |||
| @@ -10,11 +10,9 @@ | |||
| 10 | #define CPIXELFORMAT_H | 10 | #define CPIXELFORMAT_H |
| 11 | 11 | ||
| 12 | #include <fstream> | 12 | #include <fstream> |
| 13 | #include <string> | ||
| 14 | #include <stdexcept> | 13 | #include <stdexcept> |
| 15 | 14 | ||
| 16 | class CBitmap; | 15 | class CBitmap; |
| 17 | #include "cbitmap.h" | ||
| 18 | 16 | ||
| 19 | /** | 17 | /** |
| 20 | * @class CPixelFormat | 18 | * @class CPixelFormat |
| @@ -73,9 +71,22 @@ class CPixelFormat | |||
| 73 | {}; | 71 | {}; |
| 74 | 72 | ||
| 75 | /** | 73 | /** |
| 76 | * @method setPixel | 74 | * @brief RGB Pixel structure |
| 77 | * @brief Modifies pixel at coordinates x, y | 75 | */ |
| 78 | * @param pixel pointer to new pixel data | 76 | typedef struct |
| 77 | { | ||
| 78 | /** red */ | ||
| 79 | uint32_t red; | ||
| 80 | /** green */ | ||
| 81 | uint32_t green; | ||
| 82 | /** blue */ | ||
| 83 | uint32_t blue; | ||
| 84 | } RGBPIXEL; | ||
| 85 | |||
| 86 | /** | ||
| 87 | * @method getPixel | ||
| 88 | * @brief Get pixel at coordinates x, y | ||
| 89 | * @param pixel reference to pixel data | ||
| 79 | * @param x x-coordinate | 90 | * @param x x-coordinate |
| 80 | * @param y y-coordinate | 91 | * @param y y-coordinate |
| 81 | * @return - | 92 | * @return - |
| @@ -83,12 +94,12 @@ class CPixelFormat | |||
| 83 | * @exception PixelFormatError | 94 | * @exception PixelFormatError |
| 84 | * @conditions none | 95 | * @conditions none |
| 85 | */ | 96 | */ |
| 86 | virtual void setPixel(const uint32_t *pixel, const uint32_t x, const uint32_t y) = 0; | 97 | virtual void getPixel(RGBPIXEL& pixel, const uint32_t x, const uint32_t y) = 0; |
| 87 | 98 | ||
| 88 | /** | 99 | /** |
| 89 | * @method getPixel | 100 | * @method setPixel |
| 90 | * @brief Get pixel at coordinates x, y | 101 | * @brief Modifies pixel at coordinates x, y |
| 91 | * @param pixel pointer to pixel data | 102 | * @param pixel reference to new pixel data |
| 92 | * @param x x-coordinate | 103 | * @param x x-coordinate |
| 93 | * @param y y-coordinate | 104 | * @param y y-coordinate |
| 94 | * @return - | 105 | * @return - |
| @@ -96,7 +107,7 @@ class CPixelFormat | |||
| 96 | * @exception PixelFormatError | 107 | * @exception PixelFormatError |
| 97 | * @conditions none | 108 | * @conditions none |
| 98 | */ | 109 | */ |
| 99 | virtual void getPixel(uint32_t *pixel, const uint32_t x, const uint32_t y) = 0; | 110 | virtual void setPixel(const RGBPIXEL& pixel, const uint32_t x, const uint32_t y) = 0; |
| 100 | 111 | ||
| 101 | /** | 112 | /** |
| 102 | * @method getBitCount | 113 | * @method getBitCount |
| @@ -109,20 +120,16 @@ class CPixelFormat | |||
| 109 | */ | 120 | */ |
| 110 | virtual uint32_t getBitCount() = 0; | 121 | virtual uint32_t getBitCount() = 0; |
| 111 | 122 | ||
| 112 | /** | 123 | /** |
| 113 | * @method getColorMode | 124 | * @method getMaxColor |
| 114 | * @brief returns the color mode supported by this class | 125 | * @brief Get maximum values for RGB pixel |
| 115 | * @param - | 126 | * @param pixel reference to pixel struct |
| 116 | * @return color mode supported by this class | 127 | * @return - |
| 117 | * @globalvars none | 128 | * @globalvars none |
| 118 | * @exception none | 129 | * @exception none |
| 119 | * @conditions none | 130 | * @conditions none |
| 120 | */ | 131 | */ |
| 121 | virtual std::string getColorMode() = 0; | 132 | virtual void getMaxColor(RGBPIXEL& pixel) = 0; |
| 122 | /* | ||
| 123 | * TODO | ||
| 124 | */ | ||
| 125 | virtual void getMaxColor(unsigned int *red, unsigned int *green, unsigned int *blue) = 0; | ||
| 126 | 133 | ||
| 127 | protected: | 134 | protected: |
| 128 | /* members */ | 135 | /* members */ |
