hoa_video::Color Class Reference

Representation of a single RGBA color. More...

#include <color.h>

Collaboration diagram for hoa_video::Color:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Color (float r, float g, float b, float a)
 Color ()
float GetAlpha () const
float GetBlue () const
const float * GetColors () const
 Class member access functions.
float GetGreen () const
float GetRed () const
void SetAlpha (float a)
void SetBlue (float b)
void SetGreen (float g)
void SetRed (float r)
Color operator * (float f) const
Color operator * (const Color &c) const
Color operator *= (const Color &c)
bool operator!= (const Color &c) const
Color operator+ (const Color &c) const
bool operator== (const Color &c) const
 Overloaded Operators.
const float & operator[] (int32 i) const
float & operator[] (int32 i)

Static Public Attributes

static Color aqua
 Aqua color (r=0.0, g=1.0, b=1.0, a=1.0).
static Color black
 Black color (r=0.0, g=0.0, b=0.0, a=1.0).
static Color blue
 Blue color (r=0.0, g=0.0, b=1.0, a=1.0).
static Color brown
 Brown color (r=0.6, g=0.3, b=0.1, a=1.0).
static Color clear
 Default colors for user convenience. These are defined in the file video.cpp. All colors are opaque (0.0f alpha value) except for "clear". Clear (transparent) color (r=0.0, g=0.0, b=0.0, a=0.0).
static Color gray
 Gray color (r=0.5, g=0.5, b=0.5, a=1.0).
static Color green
 Green color (r=0.0, g=1.0, b=0.0, a=1.0).
static Color orange
 Orangecolor (r=1.0, g=0.4, b=0.0, a=1.0).
static Color red
 Red color (r=1.0, g=0.0, b=0.0, a=1.0).
static Color violet
 Violet color (r=1.0, g=0.0, b=1.0, a=1.0).
static Color white
 White color (r=1.0, g=1.0, b=1.0, a=1.0).
static Color yellow
 Yellow color (r=1.0, g=1.0, b=0.0, a=1.0).

Private Attributes

float _colors [4]
 The four RGBA values that represent the color These values range from 0.0 to 1.0. The indeces of the array represent: red, green, blue, and alpha in that order.

Detailed Description

Representation of a single RGBA color.

****************************************************************************

This class encapsulates an array of 4 floats, and allows you to do basic operations like adding and multiplying colors.

Definition at line 30 of file color.h.


Constructor & Destructor Documentation

hoa_video::Color::Color (  )  [inline]

Definition at line 50 of file color.h.

References _colors.

Referenced by operator *(), operator *=(), and operator+().

hoa_video::Color::Color ( float  r,
float  g,
float  b,
float  a 
) [inline]

Definition at line 53 of file color.h.

References _colors.


Member Function Documentation

float hoa_video::Color::GetAlpha (  )  const [inline]

Definition at line 110 of file color.h.

References _colors.

Referenced by hoa_map::private_map::EnemySprite::Update().

float hoa_video::Color::GetBlue (  )  const [inline]

Definition at line 107 of file color.h.

References _colors.

const float* hoa_video::Color::GetColors (  )  const [inline]

Class member access functions.

Definition at line 98 of file color.h.

References _colors.

Referenced by hoa_video::GameVideo::EnableFog().

float hoa_video::Color::GetGreen (  )  const [inline]

Definition at line 104 of file color.h.

References _colors.

float hoa_video::Color::GetRed (  )  const [inline]

Definition at line 101 of file color.h.

References _colors.

Color hoa_video::Color::operator * ( float  f  )  const [inline]

Definition at line 80 of file color.h.

References _colors, and Color().

Here is the call graph for this function:

Color hoa_video::Color::operator * ( const Color c  )  const [inline]

Definition at line 77 of file color.h.

References _colors, and Color().

Here is the call graph for this function:

Color hoa_video::Color::operator *= ( const Color c  )  [inline]

Definition at line 74 of file color.h.

References _colors, and Color().

Here is the call graph for this function:

bool hoa_video::Color::operator!= ( const Color c  )  const [inline]

Definition at line 61 of file color.h.

References _colors.

Color hoa_video::Color::operator+ ( const Color c  )  const [inline]

Definition at line 64 of file color.h.

References _colors, and Color().

Here is the call graph for this function:

bool hoa_video::Color::operator== ( const Color c  )  const [inline]

Overloaded Operators.

Definition at line 58 of file color.h.

References _colors.

const float& hoa_video::Color::operator[] ( int32  i  )  const [inline]

Note:
No checking of array bounds are done here for efficiency reasons. If safety is a concern, use the class member access functions instead.

Definition at line 92 of file color.h.

References _colors.

float& hoa_video::Color::operator[] ( int32  i  )  [inline]

Note:
No checking of array bounds are done here for efficiency reasons. If safety is a concern, use the class member access functions instead.

Definition at line 86 of file color.h.

References _colors.

void hoa_video::Color::SetAlpha ( float  a  )  [inline]

Definition at line 122 of file color.h.

References _colors.

Referenced by hoa_map::private_map::EnemySprite::ChangeStateHostile(), hoa_map::MapMode::Draw(), hoa_map::private_map::EnemySprite::Reset(), hoa_map::private_map::EnemySprite::Update(), and hoa_map::private_map::VirtualSprite::Update().

void hoa_video::Color::SetBlue ( float  b  )  [inline]

Definition at line 119 of file color.h.

References _colors.

void hoa_video::Color::SetGreen ( float  g  )  [inline]

Definition at line 116 of file color.h.

References _colors.

void hoa_video::Color::SetRed ( float  r  )  [inline]

Definition at line 113 of file color.h.

References _colors.


Member Data Documentation

float hoa_video::Color::_colors[4] [private]

The four RGBA values that represent the color These values range from 0.0 to 1.0. The indeces of the array represent: red, green, blue, and alpha in that order.

Definition at line 131 of file color.h.

Referenced by Color(), GetAlpha(), GetBlue(), GetColors(), GetGreen(), GetRed(), operator *(), operator *=(), operator!=(), operator+(), operator==(), operator[](), SetAlpha(), SetBlue(), SetGreen(), and SetRed().

Color hoa_video::Color::aqua [static]

Aqua color (r=0.0, g=1.0, b=1.0, a=1.0).

Definition at line 44 of file color.h.

Color hoa_video::Color::black [static]

Black color (r=0.0, g=0.0, b=0.0, a=1.0).

Definition at line 39 of file color.h.

Referenced by hoa_video::GameVideo::_GetTextShadowColor(), hoa_video::GameVideo::Clear(), and hoa_video::GameVideo::DrawText().

Color hoa_video::Color::blue [static]

Blue color (r=0.0, g=0.0, b=1.0, a=1.0).

Definition at line 45 of file color.h.

Color hoa_video::Color::brown [static]

Brown color (r=0.6, g=0.3, b=0.1, a=1.0).

Definition at line 47 of file color.h.

Color hoa_video::Color::clear [static]

Default colors for user convenience. These are defined in the file video.cpp. All colors are opaque (0.0f alpha value) except for "clear". Clear (transparent) color (r=0.0, g=0.0, b=0.0, a=0.0).

Definition at line 36 of file color.h.

Referenced by hoa_video::GameVideo::LoadMenuSkin().

Color hoa_video::Color::gray [static]

Gray color (r=0.5, g=0.5, b=0.5, a=1.0).

Definition at line 38 of file color.h.

Referenced by hoa_video::OptionBox::Draw().

Color hoa_video::Color::green [static]

Green color (r=0.0, g=1.0, b=0.0, a=1.0).

Definition at line 43 of file color.h.

Color hoa_video::Color::orange [static]

Orangecolor (r=1.0, g=0.4, b=0.0, a=1.0).

Definition at line 41 of file color.h.

Color hoa_video::Color::red [static]

Red color (r=1.0, g=0.0, b=0.0, a=1.0).

Definition at line 40 of file color.h.

Color hoa_video::Color::violet [static]

Violet color (r=1.0, g=0.0, b=1.0, a=1.0).

Definition at line 46 of file color.h.

Color hoa_video::Color::white [static]

White color (r=1.0, g=1.0, b=1.0, a=1.0).

Definition at line 37 of file color.h.

Referenced by hoa_video::ImageDescriptor::_Clear(), hoa_video::GameVideo::_DrawStillImage(), hoa_video::GameVideo::_GetTextShadowColor(), hoa_video::AnimatedImage::Clear(), hoa_video::StillImage::Clear(), hoa_video::GameVideo::DisableSceneLighting(), hoa_video::private_video::ParticleSystem::Draw(), hoa_video::OptionBox::Draw(), hoa_video::MenuWindow::Draw(), hoa_video::private_video::GUISupervisor::DrawFPS(), hoa_video::GameVideo::DrawText(), hoa_video::ImageDescriptor::ImageDescriptor(), and hoa_video::private_video::ImageElement::ImageElement().

Color hoa_video::Color::yellow [static]

Yellow color (r=1.0, g=1.0, b=0.0, a=1.0).

Definition at line 42 of file color.h.


The documentation for this class was generated from the following files:
Generated on Fri Jul 6 23:16:14 2007 for Hero of Allacrost by  doxygen 1.5.1