csColor Class Reference
A class used to represent a color in RGB space. More...
#include <csutil/cscolor.h>
Inheritance diagram for csColor:
Public Member Functions | |
void | Add (float r, float g, float b) |
Add given R,G,B components to color. | |
void | Clamp (float r, float g, float b) |
Clamp color to given R,G,B values. | |
void | ClampDown () |
Make sure color components are not negative. | |
csColor (const csColor &c) | |
Initialize a color object with an existing color. | |
csColor (float v) | |
Initialize a color object with same content in R,G,B components. | |
csColor (float r, float g, float b) | |
Initialize a color object with given R,G,B components. | |
csColor () | |
Initialize a color object (contents undefined). | |
bool | IsBlack (float threshold) const |
Check if color is all black (red green and blue all below threshold). | |
bool | IsBlack () const |
Check if color is all black (red green and blue all 0). | |
float | Luminance () const |
Return luminance of pixel (assuming sRGB color space). | |
bool | operator!= (const csColor &c) const |
Compare inequality of two colors. | |
csColor | operator* (const float f) |
Multiply this color by a scalar, return result. | |
csColor & | operator*= (const csColor &c) |
Multiply another color with this one. | |
csColor & | operator*= (float f) |
Multiply this color by a scalar value. | |
csColor & | operator+= (const csColor &c) |
Add another color to this one. | |
csColor & | operator-= (const csColor &c) |
Subtract another color to this one. | |
csColor & | operator= (const csColor &c) |
Assign one color object to another. | |
bool | operator== (const csColor &c) const |
Compare equality of two colors. | |
float & | operator[] (size_t n) |
Returns n-th component of the color. | |
float | operator[] (size_t n) const |
Returns n-th component of the color. | |
void | Set (const csColor &c) |
Set color to given color. | |
void | Set (float r, float g, float b) |
Set color to given R,G,B components. | |
void | Subtract (float r, float g, float b) |
Subtract given R,G,B components from color. |
Detailed Description
A class used to represent a color in RGB space.
This class is similar to csRGBpixel and csRGBcolor except that it uses floating-point values to store R,G,B values.
Definition at line 33 of file cscolor.h.
Constructor & Destructor Documentation
csColor::csColor | ( | ) | [inline] |
csColor::csColor | ( | float | r, | |
float | g, | |||
float | b | |||
) | [inline] |
csColor::csColor | ( | float | v | ) | [inline] |
csColor::csColor | ( | const csColor & | c | ) | [inline] |
Member Function Documentation
void csColor::Add | ( | float | r, | |
float | g, | |||
float | b | |||
) | [inline] |
void csColor::Clamp | ( | float | r, | |
float | g, | |||
float | b | |||
) | [inline] |
void csColor::ClampDown | ( | ) | [inline] |
bool csColor::IsBlack | ( | float | threshold | ) | const [inline] |
bool csColor::IsBlack | ( | ) | const [inline] |
float csColor::Luminance | ( | ) | const [inline] |
bool csColor::operator!= | ( | const csColor & | c | ) | const [inline] |
csColor csColor::operator* | ( | const float | f | ) | [inline] |
csColor& csColor::operator*= | ( | float | f | ) | [inline] |
bool csColor::operator== | ( | const csColor & | c | ) | const [inline] |
float& csColor::operator[] | ( | size_t | n | ) | [inline] |
float csColor::operator[] | ( | size_t | n | ) | const [inline] |
void csColor::Set | ( | const csColor & | c | ) | [inline] |
void csColor::Set | ( | float | r, | |
float | g, | |||
float | b | |||
) | [inline] |
void csColor::Subtract | ( | float | r, | |
float | g, | |||
float | b | |||
) | [inline] |
Member Data Documentation
float csColor::blue |
float csColor::green |
float csColor::m[3] |
float csColor::red |
The documentation for this class was generated from the following file:
- csutil/cscolor.h
Generated for Crystal Space 2.0 by doxygen 1.6.1