Public Member Functions | Public Attributes
imagen::iColor Class Reference

Color vector. More...

#include <iColor.h>

List of all members.

Public Member Functions

 iColor ()
 Default constructor.
 iColor (int red, int green, int blue, int alpha=255)
 Full color constructor.
 iColor (int value)
 Single color constructor.
int length () const
 Gets the length of the color vector.
int sqrLength () const
 Gets the square length of the color vector.
int distanceTo (const iColor &col) const
 Gets the distance from this color vector to another iColor.
int dot (const iColor &col) const
 Gets the dot product of this color vector with another iColor.
iColor cross (const iColor &col) const
 Gets the cross product of this color vector with another iColor.
void normalize ()
 Normalizes the color vector.
int average () const
 Returns an average of the color channels.
void clamp ()
 Clamps all colors within the 0-255 range.
iColor operator+ (const iColor &c) const
iColor operator- (const iColor &c) const
iColor operator* (const iColor &c) const
iColor operator/ (const iColor &c) const
iColor operator= (const iColor &c)
iColor operator+= (const iColor &c)
iColor operator-= (const iColor &c)
iColor operator*= (const iColor &c)
iColor operator/= (const iColor &c)
bool operator== (const iColor &c) const
bool operator!= (const iColor &c) const
iColor operator* (float i) const

Public Attributes

int r
 Red component.
int g
 Green component.
int b
 Blue component.
int a
 Alpha component.

Detailed Description

Color vector.

This class stores each color channel as an integer. Range: 0-255.


Constructor & Destructor Documentation

imagen::iColor::iColor ( ) [inline]

Default constructor.

imagen::iColor::iColor ( int  red,
int  green,
int  blue,
int  alpha = 255 
) [inline]

Full color constructor.

Parameters:
red: Red value.
green: Green value.
blue: Blue value.
alpha: Alpha value.
imagen::iColor::iColor ( int  value) [inline]

Single color constructor.

Parameters:
value: Value to apply to all components.

Member Function Documentation

int imagen::iColor::length ( ) const [inline]

Gets the length of the color vector.

int imagen::iColor::sqrLength ( ) const [inline]

Gets the square length of the color vector.

int imagen::iColor::distanceTo ( const iColor col) const [inline]

Gets the distance from this color vector to another iColor.

Parameters:
col: The iColor to get the distance to.
Returns:
The distance to col.
int imagen::iColor::dot ( const iColor col) const [inline]

Gets the dot product of this color vector with another iColor.

Parameters:
col: A iColor.
Returns:
The dot product.
iColor imagen::iColor::cross ( const iColor col) const [inline]

Gets the cross product of this color vector with another iColor.

Parameters:
col: A iColor.
Returns:
The cross product.
void imagen::iColor::normalize ( ) [inline]

Normalizes the color vector.

int imagen::iColor::average ( ) const [inline]

Returns an average of the color channels.

void imagen::iColor::clamp ( ) [inline]

Clamps all colors within the 0-255 range.

iColor imagen::iColor::operator+ ( const iColor c) const [inline]
iColor imagen::iColor::operator- ( const iColor c) const [inline]
iColor imagen::iColor::operator* ( const iColor c) const [inline]
iColor imagen::iColor::operator/ ( const iColor c) const [inline]
iColor imagen::iColor::operator= ( const iColor c) [inline]
iColor imagen::iColor::operator+= ( const iColor c) [inline]
iColor imagen::iColor::operator-= ( const iColor c) [inline]
iColor imagen::iColor::operator*= ( const iColor c) [inline]
iColor imagen::iColor::operator/= ( const iColor c) [inline]
bool imagen::iColor::operator== ( const iColor c) const [inline]
bool imagen::iColor::operator!= ( const iColor c) const [inline]
iColor imagen::iColor::operator* ( float  i) const [inline]

Member Data Documentation

Red component.

Green component.

Blue component.

Alpha component.


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