#include <CColor.h>
Public Member Functions | |
| CColor (float r=0, float g=0, float b=0, float a=0) | |
| This is the CColor simple constructor. | |
| float & | operator[] (int i) |
| This operator returns a reference to the color component corresponding to the index. | |
| float | operator[] (int i) const |
| This const operator returns the color component corresponding to the index. | |
| void | Clamp (void) |
| This function clamps the four components of the color between 0 and 1. | |
| CColor | operator+ (const CColor &c) const |
| This operator adds two colors. | |
| CColor | operator * (const CColor &c) const |
| This operator multiplies two colors. | |
| CColor | operator * (float k) const |
| This operator returns the product of a color and a scalar. | |
| CColor | operator+= (const CColor &c) |
| This operator is the same as + with an additionnal assignment. | |
| CColor | operator-= (const CColor &c) |
| This operator is the same as - with an additionnal assignment. | |
| CColor | operator *= (const CColor &c) |
| This operator is the same as * with an additionnal assignment. | |
| CColor | operator *= (float k) |
| This operator is the same as * with an additionnal assignment. | |
Private Attributes | |
| float | red |
| float | green |
| float | blue |
| float | alpha |
Friends | |
| CColor | operator * (float k, const CColor &c) |
| This operator returns the product of a scalar and a color. | |
| std::ostream & | operator<< (std::ostream &o, const CColor &c) |
| This operator prints the value of the color. | |
It holds four reel numbers meant to be clamped between 0 and 1.
Definition at line 21 of file CColor.h.
| CColor::CColor | ( | float | r = 0, |
|
| float | g = 0, |
|||
| float | b = 0, |
|||
| float | a = 0 | |||
| ) | [inline] |
This is the CColor simple constructor.
Definition at line 27 of file CColor.h.
References alpha, blue, green, and red.
Referenced by operator *(), and operator+().
| float& CColor::operator[] | ( | int | i | ) | [inline] |
| float CColor::operator[] | ( | int | i | ) | const [inline] |
| void CColor::Clamp | ( | void | ) | [inline] |
| CColor CColor::operator * | ( | float | k | ) | const [inline] |
| CColor CColor::operator *= | ( | float | k | ) | [inline] |
| std::ostream& operator<< | ( | std::ostream & | o, | |
| const CColor & | c | |||
| ) | [friend] |
float CColor::red [private] |
Red component of the color.
Definition at line 182 of file CColor.h.
Referenced by CColor(), Clamp(), operator *(), operator *(), operator *=(), operator+(), operator+=(), operator-=(), operator<<(), and operator[]().
float CColor::green [private] |
Green component of the color.
Definition at line 183 of file CColor.h.
Referenced by CColor(), Clamp(), operator *(), operator *(), operator *=(), operator+(), operator+=(), operator-=(), operator<<(), and operator[]().
float CColor::blue [private] |
Blue component of the color.
Definition at line 184 of file CColor.h.
Referenced by CColor(), Clamp(), operator *(), operator *(), operator *=(), operator+(), operator+=(), operator-=(), operator<<(), and operator[]().
float CColor::alpha [private] |
Alpha component of the color.
Definition at line 185 of file CColor.h.
Referenced by CColor(), Clamp(), operator *(), operator *(), operator *=(), operator+(), operator+=(), operator-=(), operator<<(), and operator[]().
1.5.4