VEE_Rgba Class Reference

Simple floating point RGBA color class. More...

#include <vee_color.h>

Collaboration diagram for VEE_Rgba:

Collaboration graph
[legend]
List of all members.

Public Member Functions

Static Public Attributes

Protected Attributes


Detailed Description

Simple floating point RGBA color class.

The color is defined by five variables:

  1. Red
  2. Green
  3. Blue
  4. Alpha
  5. Theta

All the components can have any values. Note that for most of the existing displays the only range 0.0-1.0 is useful.

A couple of example colors:

Note: Alpha-blending is always a tricky question. There are many different possibilities for alpha-blending. The exact blending mode you are after may be something that this class does not provide. So, if you use alpha-blending, be more careful with your operations -- especially operators.

Author:
Tommi Ilmonen


Constructor & Destructor Documentation

VEE_Rgba::VEE_Rgba  )  [inline]
 

Empty constructor (does not initialize any values).

VEE_Rgba::VEE_Rgba float  r,
float  g,
float  b,
float  a = 1.0,
float  t = 0.5
[inline]
 

VEE_Rgba::~VEE_Rgba  )  [inline]
 


Member Function Documentation

void VEE_Rgba::set float  r,
float  g,
float  b,
float  a = 1.0,
float  t = 0.5
[inline]
 

template<class S>
void VEE_Rgba::copy const S *  c,
int  n
[inline]
 

float VEE_Rgba::red  )  const [inline]
 

float VEE_Rgba::green  )  const [inline]
 

float VEE_Rgba::blue  )  const [inline]
 

float VEE_Rgba::alpha  )  const [inline]
 

float VEE_Rgba::theta  )  const [inline]
 

unsigned VEE_Rgba::getARGB  )  const
 

Returns the color coded into a 32-bit integer.

Each color component has 8 bits. The components are ordered from MSB: alpha, red, green, blue.

void VEE_Rgba::setRed float  r  )  [inline]
 

void VEE_Rgba::setGreen float  g  )  [inline]
 

void VEE_Rgba::setBlue float  b  )  [inline]
 

void VEE_Rgba::setAlpha float  a  )  [inline]
 

void VEE_Rgba::setTheta float  t  )  [inline]
 

float* VEE_Rgba::data  )  [inline]
 

Returns pointer to the data area.

const float* VEE_Rgba::data  )  const [inline]
 

void VEE_Rgba::clampNth unsigned  index,
float  minVal,
float  maxVal
[inline]
 

Limit the nth componeent to soecified range.

  • index The index of the component, range: 0-3.

void VEE_Rgba::clampRgb float  minVal,
float  maxVal
 

Clamp (limit) the RGB -components to a given range.

This method does not modify the alpha value.

void VEE_Rgba::clampRgba float  minVal,
float  maxVal
 

Clamp (limit) the RGB and A -components to a given range.

VEE_Rgba VEE_Rgba::farColor  )  const [inline]
 

Calculates a color that is as far as possible from the original in the RGB cube.

void VEE_Rgba::normalize  )  [inline]
 

Normalize all components between zero and one.

VEE_Rgba VEE_Rgba::mulRgba float  mul  )  const [inline]
 

Multiplication operator.

This operator multiplies the RGBA components.

VEE_Rgba VEE_Rgba::mulRgb float  mul  )  const [inline]
 

Multiplication operator.

This operator multiplies the RGBA components.

VEE_Rgba VEE_Rgba::addRgba const VEE_Rgba rgb  )  const [inline]
 

VEE_Rgba VEE_Rgba::operator * float  mul  )  const [inline]
 

Multiplication operator.

This operator multiplies all components.

VEE_Rgba VEE_Rgba::operator+ const VEE_Rgba rgb  )  const [inline]
 

Addition operator.

This operator adds the RGB components and averages the alpha components of the two colors.

VEE_Rgba VEE_Rgba::operator- const VEE_Rgba rgb  )  const [inline]
 

Subtraction operator.

This operator subtracts the RGB components and averages the alpha components of the two colors.

float& VEE_Rgba::operator[] int  n  )  [inline]
 

const float& VEE_Rgba::operator[] int  n  )  const [inline]
 


Member Data Documentation

const VEE_Rgba VEE_Rgba::White [static]
 

Solid white color.

const VEE_Rgba VEE_Rgba::Gray [static]
 

const VEE_Rgba VEE_Rgba::Black [static]
 

const VEE_Rgba VEE_Rgba::BlackTransparent [static]
 

const VEE_Rgba VEE_Rgba::Red [static]
 

const VEE_Rgba VEE_Rgba::Green [static]
 

const VEE_Rgba VEE_Rgba::Blue [static]
 

const VEE_Rgba VEE_Rgba::Cyan [static]
 

const VEE_Rgba VEE_Rgba::Magenta [static]
 

const VEE_Rgba VEE_Rgba::Yellow [static]
 

float VEE_Rgba::m_r [protected]
 

float VEE_Rgba::m_g [protected]
 

float VEE_Rgba::m_b [protected]
 

float VEE_Rgba::m_a [protected]
 

float VEE_Rgba::m_t [protected]
 


The documentation for this class was generated from the following files:
Generated on Mon Mar 12 21:09:36 2007 for VEE - The Visual Effects Engine by  doxygen 1.4.6