Main Page | Class Hierarchy | Class List | File List | Class Members

PLib::Color Class Reference

A class for a RGB color. More...

#include <color.h>

List of all members.

Public Member Functions

 Color (const unsigned char R=0, const unsigned char G=0, const unsigned char B=0)
Coloroperator+= (const Color &a)
Coloroperator-= (const Color &a)
Coloroperator *= (double a)
Coloroperator/= (double a)
Coloroperator= (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


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

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

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

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

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


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

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


The documentation for this class was generated from the following file:
Generated on Wed Nov 17 20:07:50 2004 for NURBS++ by  doxygen 1.3.9.1