55 unsigned char rgba[ 4 ];
61 rgba[ 0 ] = rgba[ 1 ] = rgba[ 2 ] = rgba[ 3 ] = 0;
70 GlsColor(
unsigned char r,
unsigned char g,
unsigned char b,
unsigned char a = 255 )
83 rgba[ 0 ] = newColor[ 0 ];
84 rgba[ 1 ] = newColor[ 1 ];
85 rgba[ 2 ] = newColor[ 2 ];
86 rgba[ 3 ] = newColor[ 3 ];
94 rgba[ 0 ] = (
unsigned char)( ( rgbaVal & 0xFF000000 ) >> 24 );
95 rgba[ 1 ] = (
unsigned char)( ( rgbaVal & 0x00FF0000 ) >> 16 );
96 rgba[ 2 ] = (
unsigned char)( ( rgbaVal & 0x0000FF00 ) >> 8 );
97 rgba[ 3 ] = (
unsigned char)( ( rgbaVal & 0x000000FF ) );
104 memcpy( rgba, color.rgba,
sizeof(
unsigned char ) * 4 );
113 void SetRGBA4f(
float r,
float g,
float b,
float a = 1 )
115 rgba[ 0 ] = (
unsigned char)( r * 255.0f );
116 rgba[ 1 ] = (
unsigned char)( g * 255.0f );
117 rgba[ 2 ] = (
unsigned char)( b * 255.0f );
118 rgba[ 3 ] = (
unsigned char)( a * 255.0f );
127 void GetRGBA4f(
float& r,
float& g,
float& b,
float& a )
const
129 r = (float)rgba[ 0 ] / 255.0f;
130 g = (float)rgba[ 1 ] / 255.0f;
131 b = (float)rgba[ 2 ] / 255.0f;
132 a = (float)rgba[ 3 ] / 255.0f;
141 void SetRGBA4d(
double r,
double g,
double b,
double a = 1 )
143 rgba[ 0 ] = (
unsigned char)( r * 255.0 );
144 rgba[ 1 ] = (
unsigned char)( g * 255.0 );
145 rgba[ 2 ] = (
unsigned char)( b * 255.0 );
146 rgba[ 3 ] = (
unsigned char)( a * 255.0 );
155 void GetRGBA4d(
double& r,
double& g,
double& b,
double& a )
const
157 r = (double)rgba[ 0 ] / 255.0;
158 g = (double)rgba[ 1 ] / 255.0;
159 b = (double)rgba[ 2 ] / 255.0;
160 a = (double)rgba[ 3 ] / 255.0;
169 void RGBA(
unsigned char r,
unsigned char g,
unsigned char b,
unsigned char a = 255 )
180 void RGBA(
const unsigned char newColor[] )
182 memcpy( rgba, newColor,
sizeof(
unsigned char ) * 4 );
188 void RGBA(
unsigned long rgbaVal )
190 rgba[ 0 ] = (
unsigned char)( ( rgbaVal & 0xFF000000 ) >> 24 );
191 rgba[ 1 ] = (
unsigned char)( ( rgbaVal & 0x00FF0000 ) >> 16 );
192 rgba[ 2 ] = (
unsigned char)( ( rgbaVal & 0x0000FF00 ) >> 8 );
193 rgba[ 3 ] = (
unsigned char)( ( rgbaVal & 0x000000FF ) );
198 unsigned char*
RGBA() {
return rgba; }
202 const unsigned char*
RGBA()
const {
return rgba; }
207 return ( rgba[ 0 ] << 24 ) | ( rgba[ 1 ] << 16 ) | ( rgba[ 2 ] << 8 ) | rgba[ 3 ];
211 unsigned char R()
const {
return rgba[ 0 ]; }
214 unsigned char G()
const {
return rgba[ 1 ]; }
217 unsigned char B()
const {
return rgba[ 2 ]; }
220 unsigned char A()
const {
return rgba[ 3 ]; }
225 void R(
const unsigned char val ) { rgba[ 0 ] = val; }
230 void G(
const unsigned char val ) { rgba[ 1 ] = val; }
235 void B(
const unsigned char val ) { rgba[ 2 ] = val; }
240 void A(
const unsigned char val ) { rgba[ 3 ] = val; }
248 return 0 == memcmp( rgba, arg.rgba,
sizeof(
unsigned char ) * 4 );
257 return 0 != memcmp( rgba, arg.rgba,
sizeof(
unsigned char ) * 4 );
267 memcpy( rgba, color.rgba,
sizeof(
unsigned char ) * 4 );
Definition: gls_color.h:54
GlsColor & operator=(const GlsColor &color)
Definition: gls_color.h:263
void A(const unsigned char val)
Definition: gls_color.h:240
unsigned char G() const
Definition: gls_color.h:214
void GetRGBA4f(float &r, float &g, float &b, float &a) const
Definition: gls_color.h:127
void R(const unsigned char val)
Definition: gls_color.h:225
void B(const unsigned char val)
Definition: gls_color.h:235
void RGBA(const unsigned char newColor[])
Definition: gls_color.h:180
void SetRGBA4f(float r, float g, float b, float a=1)
Definition: gls_color.h:113
unsigned char R() const
Definition: gls_color.h:211
void RGBA(unsigned long rgbaVal)
Definition: gls_color.h:188
void SetRGBA4d(double r, double g, double b, double a=1)
Definition: gls_color.h:141
bool operator==(const GlsColor &arg) const
Definition: gls_color.h:246
GlsColor()
Definition: gls_color.h:59
void G(const unsigned char val)
Definition: gls_color.h:230
GlsColor(unsigned long rgbaVal)
Definition: gls_color.h:92
bool operator!=(const GlsColor &arg) const
Definition: gls_color.h:255
void GetRGBA4d(double &r, double &g, double &b, double &a) const
Definition: gls_color.h:155
unsigned char B() const
Definition: gls_color.h:217
unsigned long RGBA_ULong() const
Definition: gls_color.h:205
const unsigned char * RGBA() const
Definition: gls_color.h:202
GlsColor(const unsigned char newColor[])
Definition: gls_color.h:81
GlsColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a=255)
Definition: gls_color.h:70
unsigned char A() const
Definition: gls_color.h:220
unsigned char * RGBA()
Definition: gls_color.h:198
GlsColor(const GlsColor &color)
Definition: gls_color.h:102
void RGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a=255)
Definition: gls_color.h:169
A file for all GL Studio files to include.
Force inclusion of the DirectShow library.
Definition: bmpimage.h:47
std::ostream & operator<<(std::ostream &outstr, const AttributeName &name)
GlsColor glsColor
Alias for backwards compatibility.
Definition: gls_color.h:286
std::istream & operator>>(std::istream &instr, GlsColor &color)
The DistiUnhideGlobalsDummyClass class.