Go to the documentation of this file.
28 #ifndef _COLOURVALUE_H__
29 #define _COLOURVALUE_H__
70 float alpha = 1.0f ) : r(red), g(green), b(blue), a(alpha)
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;
324 o <<
"ColourValue(" << c.r <<
", " << c.g <<
", " << c.b <<
", " << c.a <<
")";
RGBA getAsRGBA(void) const
Retrieves colour as RGBA.
bool operator==(const ColourValue &rhs) const
void getHSB(Real *hue, Real *saturation, Real *brightness) const
Convert the current colour to Hue, Saturation and Brightness values.
void saturate(void)
Clamps colour value to the range [0, 1].
static const ColourValue ZERO
Radian operator*(Real a, const Radian &b)
ABGR getAsABGR(void) const
Retrieves colours as ABGR.
Radian operator/(Real a, const Radian &b)
void setAsRGBA(const RGBA val)
Sets colour as RGBA.
bool operator!=(const ColourValue &rhs) const
BGRA getAsBGRA(void) const
Retrieves colour as BGRA.
ColourValue(float red=1.0f, float green=1.0f, float blue=1.0f, float alpha=1.0f)
static const ColourValue White
static const ColourValue Blue
static const ColourValue Red
ARGB getAsARGB(void) const
Retrieves colour as ARGB.
static const ColourValue Green
Class representing colour.
void setAsARGB(const ARGB val)
Sets colour as ARGB.
void setAsBGRA(const BGRA val)
Sets colour as BGRA.
ColourValue saturateCopy(void) const
As saturate, except that this colour value is unaffected and the saturated colour value is returned a...
static const ColourValue Black
void setHSB(Real hue, Real saturation, Real brightness)
Set a colour value from Hue, Saturation and Brightness.
float Real
Software floating point type.
float * ptr()
Pointer accessor for direct copying.
const float * ptr() const
Pointer accessor for direct copying.
void setAsABGR(const ABGR val)
Sets colour as ABGR.
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.