OGRE 14.3
Object-Oriented Graphics Rendering Engine
Loading...
Searching...
No Matches
Ogre::ColourValue Class Reference

Class representing colour. More...

#include <OgreColourValue.h>

Public Member Functions

 ColourValue (const uchar *byte)
 
 ColourValue (float red=1.0f, float green=1.0f, float blue=1.0f, float alpha=1.0f)
 
void getHSB (float &hue, float &saturation, float &brightness) const
 Convert the current colour to Hue, Saturation and Brightness values.
 
void getHSB (float *hue, float *saturation, float *brightness) const
 
bool operator!= (const ColourValue &rhs) const
 
ColourValue operator* (const ColourValue &rhs) const
 
ColourValue operator* (const float fScalar) const
 
ColourValueoperator*= (const float fScalar)
 
ColourValue operator+ (const ColourValue &rkVector) const
 
ColourValueoperator+= (const ColourValue &rkVector)
 
ColourValue operator- (const ColourValue &rkVector) const
 
ColourValueoperator-= (const ColourValue &rkVector)
 
ColourValue operator/ (const ColourValue &rhs) const
 
ColourValue operator/ (const float fScalar) const
 
ColourValueoperator/= (const float fScalar)
 
bool operator== (const ColourValue &rhs) const
 
floatoperator[] (const size_t i)
 Array accessor operator.
 
float operator[] (const size_t i) const
 Array accessor operator.
 
floatptr ()
 Pointer accessor for direct copying.
 
const floatptr () const
 Pointer accessor for direct copying.
 
void saturate (void)
 Clamps colour value to the range [0, 1].
 
ColourValue saturateCopy (void) const
 As saturate, except that this colour value is unaffected and the saturated colour value is returned as a copy.
 
void setHSB (float hue, float saturation, float brightness)
 Set a colour value from Hue, Saturation and Brightness.
 
conversions from/ to native-endian packed formats
RGBA getAsRGBA (void) const
 value packed as PF_R8G8B8A8
 
ARGB getAsARGB (void) const
 value packed as PF_A8R8G8B8
 
BGRA getAsBGRA (void) const
 value packed as PF_B8G8R8A8
 
ABGR getAsABGR (void) const
 value packed as PF_A8B8G8R8
 
RGBA getAsBYTE () const
 value packed as PF_BYTE_RGBA
 
void setAsRGBA (RGBA val)
 Set value from PF_R8G8B8A8.
 
void setAsARGB (ARGB val)
 Set value from PF_A8R8G8B8.
 
void setAsBGRA (BGRA val)
 Set value from PF_B8G8R8A8.
 
void setAsABGR (ABGR val)
 Set value from PF_A8B8G8R8.
 

Public Attributes

float a
 
float b
 
float g
 
float r
 

Static Public Attributes

static const ColourValue Black
 
static const ColourValue Blue
 
static const ColourValue Green
 
static const ColourValue Red
 
static const ColourValue White
 
static const ColourValue ZERO
 

Detailed Description

Class representing colour.

Colour is represented as 4 components, each of which is a floating-point value from 0.0 to 1.0.

The 3 'normal' colour components are red, green and blue, a higher number indicating greater amounts of that component in the colour. The forth component is the 'alpha' value, which represents transparency. In this case, 0.0 is completely transparent and 1.0 is fully opaque.

Constructor & Destructor Documentation

◆ ColourValue() [1/2]

Ogre::ColourValue::ColourValue ( float  red = 1.0f,
float  green = 1.0f,
float  blue = 1.0f,
float  alpha = 1.0f 
)
inlineexplicit

◆ ColourValue() [2/2]

Ogre::ColourValue::ColourValue ( const uchar byte)
inlineexplicit

Member Function Documentation

◆ operator==()

bool Ogre::ColourValue::operator== ( const ColourValue rhs) const
inline

◆ operator!=()

bool Ogre::ColourValue::operator!= ( const ColourValue rhs) const
inline

◆ getAsRGBA()

RGBA Ogre::ColourValue::getAsRGBA ( void  ) const

value packed as PF_R8G8B8A8

◆ getAsARGB()

ARGB Ogre::ColourValue::getAsARGB ( void  ) const

value packed as PF_A8R8G8B8

◆ getAsBGRA()

BGRA Ogre::ColourValue::getAsBGRA ( void  ) const

value packed as PF_B8G8R8A8

◆ getAsABGR()

ABGR Ogre::ColourValue::getAsABGR ( void  ) const

◆ getAsBYTE()

RGBA Ogre::ColourValue::getAsBYTE ( ) const
inline

◆ setAsRGBA()

void Ogre::ColourValue::setAsRGBA ( RGBA  val)

Set value from PF_R8G8B8A8.

◆ setAsARGB()

void Ogre::ColourValue::setAsARGB ( ARGB  val)

Set value from PF_A8R8G8B8.

◆ setAsBGRA()

void Ogre::ColourValue::setAsBGRA ( BGRA  val)

Set value from PF_B8G8R8A8.

◆ setAsABGR()

void Ogre::ColourValue::setAsABGR ( ABGR  val)

Set value from PF_A8B8G8R8.

◆ saturate()

void Ogre::ColourValue::saturate ( void  )
inline

Clamps colour value to the range [0, 1].

◆ saturateCopy()

ColourValue Ogre::ColourValue::saturateCopy ( void  ) const
inline

As saturate, except that this colour value is unaffected and the saturated colour value is returned as a copy.

◆ operator[]() [1/2]

float Ogre::ColourValue::operator[] ( const size_t  i) const
inline

Array accessor operator.

◆ operator[]() [2/2]

float & Ogre::ColourValue::operator[] ( const size_t  i)
inline

Array accessor operator.

◆ ptr() [1/2]

float * Ogre::ColourValue::ptr ( )
inline

Pointer accessor for direct copying.

◆ ptr() [2/2]

const float * Ogre::ColourValue::ptr ( ) const
inline

Pointer accessor for direct copying.

◆ operator+()

ColourValue Ogre::ColourValue::operator+ ( const ColourValue rkVector) const
inline

◆ operator-()

ColourValue Ogre::ColourValue::operator- ( const ColourValue rkVector) const
inline

◆ operator*() [1/2]

ColourValue Ogre::ColourValue::operator* ( const float  fScalar) const
inline

◆ operator*() [2/2]

ColourValue Ogre::ColourValue::operator* ( const ColourValue rhs) const
inline

◆ operator/() [1/2]

ColourValue Ogre::ColourValue::operator/ ( const ColourValue rhs) const
inline

◆ operator/() [2/2]

ColourValue Ogre::ColourValue::operator/ ( const float  fScalar) const
inline

◆ operator+=()

ColourValue & Ogre::ColourValue::operator+= ( const ColourValue rkVector)
inline

◆ operator-=()

ColourValue & Ogre::ColourValue::operator-= ( const ColourValue rkVector)
inline

◆ operator*=()

ColourValue & Ogre::ColourValue::operator*= ( const float  fScalar)
inline

◆ operator/=()

ColourValue & Ogre::ColourValue::operator/= ( const float  fScalar)
inline

◆ setHSB()

void Ogre::ColourValue::setHSB ( float  hue,
float  saturation,
float  brightness 
)

Set a colour value from Hue, Saturation and Brightness.

Parameters
hueHue value, scaled to the [0,1] range as opposed to the 0-360
saturationSaturation level, [0,1]
brightnessBrightness level, [0,1]

◆ getHSB() [1/2]

void Ogre::ColourValue::getHSB ( float hue,
float saturation,
float brightness 
) const

Convert the current colour to Hue, Saturation and Brightness values.

Parameters
hueOutput hue value, scaled to the [0,1] range as opposed to the 0-360
saturationOutput saturation level, [0,1]
brightnessOutput brightness level, [0,1]

◆ getHSB() [2/2]

void Ogre::ColourValue::getHSB ( float hue,
float saturation,
float brightness 
) const
inline

Member Data Documentation

◆ ZERO

const ColourValue Ogre::ColourValue::ZERO
static

◆ Black

const ColourValue Ogre::ColourValue::Black
static

◆ White

const ColourValue Ogre::ColourValue::White
static

◆ Red

const ColourValue Ogre::ColourValue::Red
static

◆ Green

const ColourValue Ogre::ColourValue::Green
static

◆ Blue

const ColourValue Ogre::ColourValue::Blue
static

◆ r

◆ g

◆ b

◆ a


The documentation for this class was generated from the following file: