class Color

This class is designed to handle colors

Public Fields

[more] fields

Public Methods

[more] constructors and destructor
[more] methods


This class is designed to handle colors

o fields

ounsigned char data0
the R or Y color component

ounsigned char data1
the G or U color component

ounsigned char data2
the B or V color component

ochar* coding
the name of the colorspace ("rgb" or "yuv")

o constructors and destructor

o Color()
Makes a black RGB color object.

		Some colors are already instanciated, so you can do:
			Color c;
			c = black;
			c = white;
			c = green;
			c = red;
			c = blue;
			c = yellow;
			c = cyan;
			c = pink;
			c = orange;

o Color(unsigned char data0_, unsigned char data1_, unsigned char data2_, const char* coding_ = "rgb")
Makes a color in coding_ colorspace.

data0_ - is the RED component (if coding_ is set to "rgb") or the Y component (if coding_ is set to "yuv")
data1_ - is the GREEN component (if coding_ is set to "rgb") or the U component (if coding_ is set to "yuv")
data2_ - is the BLUE component (if coding_ is set to "rgb") or the V component (if coding_ is set to "yuv")
coding_ - is the coding (RGB by default)
Color w(255, 255, 255);
Color r(255, 0, 0);

o Color(const char* color_name_)
Makes a RGB color from a string.

color_name - is the X11 color name (see file rgb.txt for the list of color names)
Color w("white");
Color r("red");
Color p("peach puff");
@see rgb.txt for the list of color names.

o ~Color()

o methods

ovoid setGray(unsigned char gray_)
Set a gray scale value

ovoid setRGB(unsigned char r_, unsigned char g_, unsigned char b_)
Set a RGB color

ovoid setYUV(unsigned char y_, unsigned char u_, unsigned char v_)
Set a YUB color

This class has no child classes.
Sebastien Marcel (
2.0 Fri 15 Jul 2005 11:35:10 AM CEST

Alphabetic index HTML hierarchy of classes or Java

This page was generated with the help of DOC++.