3 #define raCOLORCON (0.003921568627450980392156862745098f) 28 raColor(
float _r,
float _g,
float _b,
float _a) : r(_r), g(_g), b(_b), a(_a) {}
29 raColor(
float _r,
float _g,
float _b) : r(_r), g(_g), b(_b), a(1.0f) {}
30 raColor(
float f) : r(f), g(f), b(f), a(f) {}
31 raColor(
float *com) : r(com[0]), g(com[1]), b(com[2]), a(com[3]) {}
37 operator unsigned long ()
const 39 return ((a >= 1.0f ? 255 : a <= 0.0f ? 0 : (DWORD)(a * 255.0f)) << 24) |
40 ((r >= 1.0f ? 255 : r <= 0.0f ? 0 : (DWORD)(r * 255.0f)) << 16) |
41 ((g >= 1.0f ? 255 : g <= 0.0f ? 0 : (DWORD)(g * 255.0f)) << 8) |
42 (b >= 1.0f ? 255 : b <= 0.0f ? 0 : (DWORD)(b * 255.0f));
44 operator float* () {
return (
float*)(c);}
51 raColor& operator *= (
const float f) {r *= f; g *= f; b *= f; a *= f;
return *
this;}
53 raColor& operator /= (
const float f) {r /= f; g /= f; b /= f; a /= f;
return *
this;}
bool operator==(const raColor &a, const raColor &b)
raColor(float _r, float _g, float _b, float _a)
RAPI raColor raColorFromCMY(float c, float m, float y)
raColor operator-(const raColor &a, const raColor &b)
RAPI raColor raColorFromHSV(float h, float s, float v)
raColor operator/(const raColor &a, const raColor &b)
raColor operator*(const raColor &a, const raColor &b)
raColor(const int _r, const int _g, const int _b)
raColor(const int _r, const int _g, const int _b, const int _a)
bool operator!=(const raColor &a, const raColor &b)
raColor(float _r, float _g, float _b)
raColor raColorInterpolate(const raColor &c1, const raColor &c2, const float p)
float raColorBrightness(const raColor &c)
raColor raColorNegate(const raColor &c)
raColor raColorMax(const raColor &c1, const raColor &c2)
raColor(const int *pComponent)
raColor raColorMin(const raColor &c1, const raColor &c2)
raColor operator+(const raColor &a, const raColor &b)
RAPI raColor raColorFromYUV(float y, float u, float v)