Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef OVR_Color_h
00017 #define OVR_Color_h
00018
00019 #include "OVR_Types.h"
00020
00021 namespace OVR {
00022
00023 struct Color
00024 {
00025 UByte R,G,B,A;
00026
00027 Color() {}
00028
00029
00030
00031 Color(unsigned char r,unsigned char g,unsigned char b, unsigned char a = 0xFF)
00032 : R(r), G(g), B(b), A(a) { }
00033
00034
00035 Color(unsigned c)
00036 : R((unsigned char)(c>>16)), G((unsigned char)(c>>8)),
00037 B((unsigned char)c), A((unsigned char)(c>>24)) { }
00038
00039 bool operator==(const Color& b) const
00040 {
00041 return R == b.R && G == b.G && B == b.B && A == b.A;
00042 }
00043
00044 void GetRGBA(float *r, float *g, float *b, float* a) const
00045 {
00046 *r = R / 255.0f;
00047 *g = G / 255.0f;
00048 *b = B / 255.0f;
00049 *a = A / 255.0f;
00050 }
00051 };
00052
00053 }
00054
00055 #endif