#include <color.h>
Public Member Functions | |
| Color (const unsigned char R=0, const unsigned char G=0, const unsigned char B=0) | |
| Color & | operator+= (const Color &a) |
| Color & | operator-= (const Color &a) |
| Color & | operator *= (double a) |
| Color & | operator/= (double a) |
| Color & | operator= (const Color &a) |
| void | fromXYZ (double x, double y, double z) |
| void | toXYZ (double &x, double &y, double &z) |
| void | fromYIQ (double q, double i, double y) |
| void | toYIQ (double &q, double &i, double &y) |
| void | fromHSV (double h, double s, double v) |
| void | toHSV (double &h, double &s, double &v) |
Public Attributes | |
| unsigned char | r |
| unsigned char | g |
| unsigned char | b |
Friends | |
| Color | operator * (const double d, const Color &a) |
| Color | operator * (const Color &a, const Color &b) |
| Color | operator+ (const Color &a, const Color &b) |
| ostream & | operator<< (ostream &os, const Color &point) |
| istream & | operator>> (istream &os, Color &point) |
Defines a class containing the RGB component of a color pixel. Each component is an unsigned char valid for the range [0..255].
| void PLib::Color::fromXYZ | ( | double | x, | |
| double | y, | |||
| double | z | |||
| ) | [inline] |
transforms from the XYZ color space to the RGB colorspace
| void PLib::Color::fromYIQ | ( | double | y, | |
| double | i, | |||
| double | q | |||
| ) | [inline] |
transforms from the YIQ color space to the RGB colorspace
This is the same color space used by NTSC
| y | the luminicance | |
| i | the chromacity | |
| q | the chromacity |
| void PLib::Color::toYIQ | ( | double & | y, | |
| double & | i, | |||
| double & | q | |||
| ) | [inline] |
transforms to the YIQ color space to the RGB colorspace
This is the same color space used by NTSC
| y | the luminicance | |
| i | the chromacity | |
| q | the chromacity |
| void PLib::Color::fromHSV | ( | double | h, | |
| double | s, | |||
| double | v | |||
| ) | [inline] |
from the HSV color space
| h | hue valid inside [0,360] | |
| s | saturation valid inside [0,1] | |
| v | value valid inside [0,1] |
| void PLib::Color::toHSV | ( | double & | h, | |
| double & | s, | |||
| double & | v | |||
| ) | [inline] |
to the HSV color space
| h | hue valid inside [0,360] | |
| s | saturation valid inside [0,1] | |
| v | value valid inside [0,1] |
| ostream& operator<< | ( | ostream & | os, | |
| const Color & | point | |||
| ) | [friend] |
The output operator of a color to an ostream.
| os | the ostream | |
| c | the color to output |
| istream& operator>> | ( | istream & | os, | |
| Color & | point | |||
| ) | [friend] |
the input operator of a color from an istream
Initialize a color from an istream
| os | the input stream | |
| c | the color to initialize |
1.5.1