28 #ifndef _COLOURVALUE_H__ 29 #define _COLOURVALUE_H__ 70 float alpha = 1.0f ) : r(red), g(green), b(blue), a(alpha)
80 RGBA getAsRGBA(
void)
const;
84 ARGB getAsARGB(
void)
const;
88 BGRA getAsBGRA(
void)
const;
91 ABGR getAsABGR(
void)
const;
95 void setAsRGBA(
const RGBA val);
99 void setAsARGB(
const ARGB val);
103 void setAsBGRA(
const BGRA val);
107 void setAsABGR(
const ABGR val);
144 inline float operator [] (
const size_t i )
const 152 inline float& operator [] (
const size_t i )
165 inline const float*
ptr()
const 176 kSum.
r = r + rkVector.
r;
177 kSum.
g = g + rkVector.
g;
178 kSum.
b = b + rkVector.
b;
179 kSum.
a = a + rkVector.
a;
188 kDiff.
r = r - rkVector.
r;
189 kDiff.
g = g - rkVector.
g;
190 kDiff.
b = b - rkVector.
b;
191 kDiff.
a = a - rkVector.
a;
234 assert( fScalar != 0.0 );
238 float fInv = 1.0f / fScalar;
251 kProd.
r = fScalar * rkVector.
r;
252 kProd.
g = fScalar * rkVector.
g;
253 kProd.
b = fScalar * rkVector.
b;
254 kProd.
a = fScalar * rkVector.
a;
291 assert( fScalar != 0.0 );
293 float fInv = 1.0f / fScalar;
308 void setHSB(
Real hue,
Real saturation,
Real brightness);
315 void getHSB(
Real* hue,
Real* saturation,
Real* brightness)
const;
321 inline _OgreExport friend std::ostream&
operator <<
324 o <<
"ColourValue(" << c.r <<
", " << c.g <<
", " << c.b <<
", " << c.a <<
")";
static const ColourValue ZERO
static const ColourValue Green
Class representing colour.
float Real
Software floating point type.
ColourValue(float red=1.0f, float green=1.0f, float blue=1.0f, float alpha=1.0f)
static const ColourValue Black
ColourValue saturateCopy(void) const
As saturate, except that this colour value is unaffected and the saturated colour value is returned a...
const float * ptr() const
Pointer accessor for direct copying.
float * ptr()
Pointer accessor for direct copying.
static const ColourValue White
bool operator!=(STLAllocator< T, P > const &, STLAllocator< T2, P > const &)
determine equality, can memory from another allocator be released by this allocator, (ISO C++)
static const ColourValue Blue
bool operator==(STLAllocator< T, P > const &, STLAllocator< T2, P > const &)
determine equality, can memory from another allocator be released by this allocator, (ISO C++)
void saturate(void)
Clamps colour value to the range [0, 1].
Radian operator/(Real a, const Radian &b)
static const ColourValue Red
Radian operator*(Real a, const Radian &b)