56 unsigned char rgba[4];
63 rgba[0] = rgba[1] = rgba[2] = rgba[3] = 0;
72 glsColor(
unsigned char r,
unsigned char g,
unsigned char b,
unsigned char a)
74 rgba[0] = r; rgba[1] = g; rgba[2] = b; rgba[3] = a;
82 rgba[0] = newColor[0]; rgba[1] = newColor[1]; rgba[2] = newColor[2]; rgba[3] = newColor[3];
90 rgba[0] = (
unsigned char)((rgbaVal & 0xFF000000) >> 24);
91 rgba[1] = (
unsigned char)((rgbaVal & 0x00FF0000) >> 16);
92 rgba[2] = (
unsigned char)((rgbaVal & 0x0000FF00) >> 8);
93 rgba[3] = (
unsigned char)((rgbaVal & 0x000000FF));
99 memcpy(rgba, color.rgba,
sizeof(
unsigned char) * 4);
110 rgba[0] = (
unsigned char)(r*255.0f);
111 rgba[1] = (
unsigned char)(g*255.0f);
112 rgba[2] = (
unsigned char)(b*255.0f);
113 rgba[3] = (
unsigned char)(a*255.0f);
122 void GetRGBA4f(
float &r,
float &g,
float &b,
float &a)
const
124 r = (float)rgba[0] / 255.0f;
125 g = (float)rgba[1] / 255.0f;
126 b = (float)rgba[2] / 255.0f;
127 a = (float)rgba[3] / 255.0f;
138 rgba[0] = (
unsigned char)(r*255.0);
139 rgba[1] = (
unsigned char)(g*255.0);
140 rgba[2] = (
unsigned char)(b*255.0);
141 rgba[3] = (
unsigned char)(a*255.0);
150 void GetRGBA4d(
double &r,
double &g,
double &b,
double &a)
const
152 r = (double)rgba[0] / 255.0;
153 g = (double)rgba[1] / 255.0;
154 b = (double)rgba[2] / 255.0;
155 a = (double)rgba[3] / 255.0;
164 void RGBA(
unsigned char r,
unsigned char g,
unsigned char b,
unsigned char a)
166 rgba[0] = r; rgba[1] = g; rgba[2] = b; rgba[3] = a;
172 void RGBA(
const unsigned char newColor[])
174 memcpy(rgba, newColor,
sizeof(
unsigned char) * 4);
180 void RGBA(
unsigned long rgbaVal)
182 rgba[0] = (
unsigned char)((rgbaVal & 0xFF000000) >> 24);
183 rgba[1] = (
unsigned char)((rgbaVal & 0x00FF0000) >> 16);
184 rgba[2] = (
unsigned char)((rgbaVal & 0x0000FF00) >> 8);
185 rgba[3] = (
unsigned char)((rgbaVal & 0x000000FF));
191 unsigned char *
RGBA(
void) {
return rgba; }
192 const unsigned char *
RGBA(
void)
const {
return rgba; }
197 return (rgba[0] << 24) | (rgba[1] << 16) | (rgba[2] << 8) | rgba[3];
201 unsigned char R(
void)
const {
return rgba[0]; }
204 unsigned char G(
void)
const {
return rgba[1]; }
207 unsigned char B(
void)
const {
return rgba[2]; }
210 unsigned char A(
void)
const {
return rgba[3]; }
215 void R(
const unsigned char val) { rgba[0] = val; }
220 void G(
const unsigned char val) { rgba[1] = val; }
225 void B(
const unsigned char val) { rgba[2] = val; }
230 void A(
const unsigned char val) { rgba[3] = val; }
237 {
return 0 == memcmp(rgba, arg.rgba,
sizeof(
unsigned char) * 4); }
244 {
return 0 != memcmp(rgba, arg.rgba,
sizeof(
unsigned char) * 4); }
251 memcpy(rgba, color.rgba,
sizeof(
unsigned char) * 4);
258 DISTI_EXPORT std::ostream & operator<<(std::ostream & outstr,
const glsColor & color);
259 DISTI_EXPORT std::istream & operator>>(std::istream & instr, glsColor & color);
The DistiUnhideGlobalsDummyClass class.
unsigned char R(void) const
Definition: gls_color.h:201
void SetRGBA4d(double r, double g, double b, double a)
Definition: gls_color.h:136
unsigned char * RGBA(void)
Definition: gls_color.h:191
glsColor(const unsigned char newColor[])
Definition: gls_color.h:80
void SetRGBA4f(float r, float g, float b, float a)
Definition: gls_color.h:108
A file for all GL Studio files to include.
glsColor(void)
Definition: gls_color.h:61
void G(const unsigned char val)
Definition: gls_color.h:220
unsigned long RGBA_ULong(void) const
Definition: gls_color.h:195
void A(const unsigned char val)
Definition: gls_color.h:230
bool operator!=(const glsColor &arg) const
Definition: gls_color.h:243
void R(const unsigned char val)
Definition: gls_color.h:215
void B(const unsigned char val)
Definition: gls_color.h:225
unsigned char G(void) const
Definition: gls_color.h:204
glsColor(unsigned long rgbaVal)
Definition: gls_color.h:88
Definition: gls_color.h:54
void RGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
Definition: gls_color.h:164
bool operator==(const glsColor &arg) const
Definition: gls_color.h:236
glsColor & operator=(const glsColor &color)
Definition: gls_color.h:247
glsColor(const glsColor &color)
Definition: gls_color.h:97
void GetRGBA4d(double &r, double &g, double &b, double &a) const
Definition: gls_color.h:150
glsColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
Definition: gls_color.h:72
unsigned char B(void) const
Definition: gls_color.h:207
void RGBA(const unsigned char newColor[])
Definition: gls_color.h:172
Definition: bmpimage.h:46
unsigned char A(void) const
Definition: gls_color.h:210
void RGBA(unsigned long rgbaVal)
Definition: gls_color.h:180
void GetRGBA4f(float &r, float &g, float &b, float &a) const
Definition: gls_color.h:122