Main Page   Class Hierarchy   Compound List   File List   Compound Members  

PLib::Color Class Reference

A class for a RGB color. More...

#include <color.h>

List of all members.

Public Methods

 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)


Detailed Description

A class for a RGB color.

Defines a class containing the RGB component of a color pixel. Each component is an unsigned char valid for the range [0..255].

Author:
Philippe Lavoie
Date:
4 October 1996

Definition at line 45 of file color.h.


Member Function Documentation

void PLib::Color::fromHSV double    h,
double    s,
double    v
[inline]
 

from the HSV color space.

Parameters:
h  hue valid inside [0,360]
s  saturation valid inside [0,1]
v  value valid inside [0,1]
Author:
Philippe Lavoie
Date:
14 May 1999

Definition at line 255 of file color.h.

void PLib::Color::fromXYZ double    x,
double    y,
double    z
[inline]
 

transforms from the XYZ color space to the RGB colorspace.

Author:
Philippe Lavoie
Date:
17 March 1999

Definition at line 196 of file color.h.

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

Parameters:
y  the luminicance
i  the chromacity
q  the chromacity
Author:
Philippe Lavoie
Date:
14 May 1999

Definition at line 218 of file color.h.

void PLib::Color::toHSV double &    h,
double &    s,
double &    v
[inline]
 

to the HSV color space.

Parameters:
h  hue valid inside [0,360]
s  saturation valid inside [0,1]
v  value valid inside [0,1]
Author:
Philippe Lavoie
Date:
14 May 1999

Definition at line 309 of file color.h.

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

Parameters:
y  the luminicance
i  the chromacity
q  the chromacity
Author:
Philippe Lavoie
Date:
14 May 1999

Definition at line 236 of file color.h.


Friends And Related Function Documentation

ostream& operator<< ostream &    os,
const Color &    point
[friend]
 

The output operator of a color to an ostream.

Parameters:
os  the ostream
c  the color to output
Returns:
the ostream with the color $c$.
Author:
Philippe Lavoie
Date:
24 January 1997

Definition at line 168 of file color.h.

istream& operator>> istream &    os,
Color &    point
[friend]
 

the input operator of a color from an istream.

Initialize a color from an istream

Parameters:
os  the input stream
c  the color to initialize
Returns:
the istream without the color
Author:
Philippe Lavoie
Date:
24 January 1997

Definition at line 185 of file color.h.


The documentation for this class was generated from the following file:
Generated on Tue Jun 24 13:26:59 2003 for NURBS++ by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002