Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes

sp::video::color Class Reference

#include <spMaterialColor.hpp>

List of all members.

Public Member Functions

 color ()
 color (u8 Brightness)
 color (u8 R, u8 G, u8 B, u8 A=255)
 color (const color &other)
 color (const color &other, u8 A)
 color (const dim::vector3df &Color, bool Adjust=true)
 color (const dim::vector4df &Color, bool Adjust=true)
 ~color ()
bool operator== (const color &other) const
bool operator!= (const color &other) const
color operator+ (const color &other) const
coloroperator+= (const color &other)
color operator- (const color &other) const
coloroperator-= (const color &other)
color operator/ (const color &other) const
coloroperator/= (const color &other)
color operator/ (u8 Factor) const
coloroperator/= (u8 Factor)
color operator* (const color &other) const
coloroperator*= (const color &other)
color operator* (u8 Factor) const
coloroperator*= (u8 Factor)
color operator* (f32 Factor) const
coloroperator*= (f32 Factor)
const u8 operator[] (s32 i) const
u8operator[] (s32 i)
color getInverse () const
colorsetInverse ()
color getInverse (bool isRedInverse, bool isGreenInverse, bool isBlueInverse, bool isAlphaInverse=false) const
colorsetInverse (bool isRedInverse, bool isGreenInverse, bool isBlueInverse, bool isAlphaInverse=false)
void setFloatArray (const f32 *ColorArray)
void getFloatArray (f32 *ColorArray) const
void setIntensity (const color &other)
color getIntensity (const color &other) const
void setIntensity (f32 Intensity)
color getIntensity (f32 Intensity) const
void set (u8 R, u8 G, u8 B, u8 A)
u32 getSingle () const
void setSingle (u32 Color)
bool equal (const color &other, bool isIncludingAlpha=true) const
bool gray () const
 Returns true if the color is gray scaled, i.e. all color components (red, green and blue) are equal.
dim::vector3df getVector (bool Adjust=false) const
template<typename T >
getBrightness () const

Static Public Member Functions

static color fromName (io::stringc Name)

Public Attributes

u8 Red
u8 Green
u8 Blue
u8 Alpha

Static Public Attributes

static const color empty
 color(0, 0, 0, 0).
static const color red
 color(255, 0, 0, 255).
static const color green
 color(0, 255, 0, 255).
static const color blue
 color(0, 0, 255, 255).
static const color yellow
 color(255, 255, 0, 255).
static const color pink
 color(255, 0, 255, 255).
static const color black
 color(0, 0, 0, 255).
static const color white
 color(255, 255, 255, 255).

Constructor & Destructor Documentation

sp::video::color::color (  )  [inline]
sp::video::color::color ( u8  Brightness  )  [inline]
sp::video::color::color ( u8  R,
u8  G,
u8  B,
u8  A = 255 
) [inline]
sp::video::color::color ( const color other  )  [inline]
sp::video::color::color ( const color other,
u8  A 
) [inline]
sp::video::color::color ( const dim::vector3df Color,
bool  Adjust = true 
) [inline]
sp::video::color::color ( const dim::vector4df Color,
bool  Adjust = true 
) [inline]
sp::video::color::~color (  )  [inline]

Member Function Documentation

bool sp::video::color::equal ( const color other,
bool  isIncludingAlpha = true 
) const [inline]
static color sp::video::color::fromName ( io::stringc  Name  )  [inline, static]

Returns a color derived from the given name.

Parameters:
[in] Name Specifies the color name. Valid values are:

  • red video::color(255, 0, 0)
  • green video::color(0, 255, 0)
  • blue video::color(0, 0, 255)
  • yellow video::color(255, 255, 0)
  • black video::color(0)
  • white video::color(255) Otherwise a hex-code can be used: e.g. "#ff00e8".
Returns:
The specified color or transparent-black (video::color(0, 0, 0, 0)) if the name could not be parsed correctly.
template<typename T >
T sp::video::color::getBrightness (  )  const [inline]
void sp::video::color::getFloatArray ( f32 ColorArray  )  const [inline]

Stores the color data into the given float array.

Parameters:
[out] ColorArray Pointer to the float array where the color data is to be stored. This must have at least 4 elements! The components are then in the range [0.0 .. 1.0].

        f32 ColorArray[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
        MyColor.getFloatArray(ColorArray);
See also:
setFloatArray
color sp::video::color::getIntensity ( const color other  )  const [inline]
color sp::video::color::getIntensity ( f32  Intensity  )  const [inline]
color sp::video::color::getInverse ( bool  isRedInverse,
bool  isGreenInverse,
bool  isBlueInverse,
bool  isAlphaInverse = false 
) const [inline]
color sp::video::color::getInverse (  )  const [inline]
u32 sp::video::color::getSingle (  )  const [inline]
dim::vector3df sp::video::color::getVector ( bool  Adjust = false  )  const [inline]
bool sp::video::color::gray (  )  const [inline]

Returns true if the color is gray scaled, i.e. all color components (red, green and blue) are equal.

bool sp::video::color::operator!= ( const color other  )  const [inline]
color sp::video::color::operator* ( const color other  )  const [inline]
color sp::video::color::operator* ( u8  Factor  )  const [inline]
color sp::video::color::operator* ( f32  Factor  )  const [inline]
color& sp::video::color::operator*= ( f32  Factor  )  [inline]
color& sp::video::color::operator*= ( const color other  )  [inline]
color& sp::video::color::operator*= ( u8  Factor  )  [inline]
color sp::video::color::operator+ ( const color other  )  const [inline]
color& sp::video::color::operator+= ( const color other  )  [inline]
color sp::video::color::operator- ( const color other  )  const [inline]
color& sp::video::color::operator-= ( const color other  )  [inline]
color sp::video::color::operator/ ( const color other  )  const [inline]
color sp::video::color::operator/ ( u8  Factor  )  const [inline]
color& sp::video::color::operator/= ( const color other  )  [inline]
color& sp::video::color::operator/= ( u8  Factor  )  [inline]
bool sp::video::color::operator== ( const color other  )  const [inline]
const u8 sp::video::color::operator[] ( s32  i  )  const [inline]
u8& sp::video::color::operator[] ( s32  i  )  [inline]
void sp::video::color::set ( u8  R,
u8  G,
u8  B,
u8  A 
) [inline]
void sp::video::color::setFloatArray ( const f32 ColorArray  )  [inline]

Sets the color with the specified float array. This is the opposite function for "getFloatArray".

See also:
getFloatArray
void sp::video::color::setIntensity ( const color other  )  [inline]
void sp::video::color::setIntensity ( f32  Intensity  )  [inline]
color& sp::video::color::setInverse (  )  [inline]
color& sp::video::color::setInverse ( bool  isRedInverse,
bool  isGreenInverse,
bool  isBlueInverse,
bool  isAlphaInverse = false 
) [inline]
void sp::video::color::setSingle ( u32  Color  )  [inline]

Member Data Documentation

color(0, 0, 0, 255).

const color sp::video::color::blue [static]

color(0, 0, 255, 255).

color(0, 0, 0, 0).

color(0, 255, 0, 255).

const color sp::video::color::pink [static]

color(255, 0, 255, 255).

const color sp::video::color::red [static]

color(255, 0, 0, 255).

color(255, 255, 255, 255).

color(255, 255, 0, 255).


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines