summaryrefslogtreecommitdiffstats
path: root/ue2/imgsynth2/cpixelformat_bgr555.h
diff options
context:
space:
mode:
Diffstat (limited to 'ue2/imgsynth2/cpixelformat_bgr555.h')
-rw-r--r--ue2/imgsynth2/cpixelformat_bgr555.h43
1 files changed, 23 insertions, 20 deletions
diff --git a/ue2/imgsynth2/cpixelformat_bgr555.h b/ue2/imgsynth2/cpixelformat_bgr555.h
index 890b744..f131214 100644
--- a/ue2/imgsynth2/cpixelformat_bgr555.h
+++ b/ue2/imgsynth2/cpixelformat_bgr555.h
@@ -12,7 +12,7 @@
12#include <fstream> 12#include <fstream>
13#include "cpixelformat.h" 13#include "cpixelformat.h"
14 14
15/* TODO */ 15/* to (un-)pack pixel values */
16#define BGR555_RED_SHIFT 10 16#define BGR555_RED_SHIFT 10
17#define BGR555_GREEN_SHIFT 5 17#define BGR555_GREEN_SHIFT 5
18#define BGR555_BLUE_SHIFT 0 18#define BGR555_BLUE_SHIFT 0
@@ -55,13 +55,23 @@ class CPixelFormat_BGR555 : public CPixelFormat
55 ~CPixelFormat_BGR555() 55 ~CPixelFormat_BGR555()
56 {} 56 {}
57 57
58 /* TODO */ 58 /**
59 void getPixel(uint32_t *pixel, uint32_t x, uint32_t y); 59 * @method getPixel
60 * @brief Get pixel at coordinates x, y
61 * @param pixel reference to pixel data
62 * @param x x-coordinate
63 * @param y y-coordinate
64 * @return -
65 * @globalvars none
66 * @exception PixelFormatError
67 * @conditions none
68 */
69 void getPixel(RGBPIXEL& pixel, uint32_t x, uint32_t y);
60 70
61 /** 71 /**
62 * @method setPixel 72 * @method setPixel
63 * @brief Modifies pixel at coordinates x, y 73 * @brief Modifies pixel at coordinates x, y
64 * @param pixel pointer to new pixel data 74 * @param pixel reference to new pixel data
65 * @param x x-coordinate 75 * @param x x-coordinate
66 * @param y y-coordinate 76 * @param y y-coordinate
67 * @return - 77 * @return -
@@ -69,7 +79,7 @@ class CPixelFormat_BGR555 : public CPixelFormat
69 * @exception PixelFormatError 79 * @exception PixelFormatError
70 * @conditions none 80 * @conditions none
71 */ 81 */
72 void setPixel(const uint32_t *pixel, uint32_t x, uint32_t y); 82 void setPixel(const RGBPIXEL& pixel, uint32_t x, uint32_t y);
73 83
74 /** 84 /**
75 * @method getBitCount 85 * @method getBitCount
@@ -85,26 +95,19 @@ class CPixelFormat_BGR555 : public CPixelFormat
85 return 16; 95 return 16;
86 } 96 }
87 97
88 /** 98 /**
89 * @method getColorMode 99 * @method getMaxColor
90 * @brief returns the color mode supported by this class 100 * @brief Get maximum values for RGB pixel
91 * @param - 101 * @param pixel reference to pixel struct
92 * @return color mode supported by this class 102 * @return -
93 * @globalvars none 103 * @globalvars none
94 * @exception none 104 * @exception none
95 * @conditions none 105 * @conditions none
96 */ 106 */
97 std::string getColorMode() 107 void getMaxColor(RGBPIXEL& pixel)
98 {
99 return "c";
100 }
101
102 /*
103 * TODO
104 */
105 void getMaxColor(unsigned int *red, unsigned int *green, unsigned int *blue)
106 { 108 {
107 *red = *green = *blue = 31; /* 2^5 -1 */ 109 /* value = 2^5 - 1 */
110 pixel.red = pixel.green = pixel.blue = 31;
108 } 111 }
109}; 112};
110 113