Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Colour.h File Reference

#include "gcl/GCLConfig.h"
#include "vl/VLf.h"
#include "cl/Array.h"
#include "cl/NArray.h"

Include dependency graph for Colour.h:

Go to the source code of this file.


Typedefs

typedef Vec3f Colour
A standard tri-stimulus colour. More...

typedef Vec4f Colour4
A Colour with a transparency channel.

typedef Mat3f ClrMat
A colour basis transformation matrix. More...

typedef Mat4f ClrTrans
A colour transformation. More...

typedef Float ClrReal
The type used for colour components.

typedef Colour Reflectance
typedef NArray<ColourColourList
typedef NArray<Colour4Colour4List
typedef ColourList ReflList

Functions

Colour RGBCol (ClrReal r, ClrReal g, ClrReal b)
Colour HSVCol (ClrReal hue, ClrReal saturation, ClrReal value)
ColourClipColour (Colour &c)
Clips colour to [0, 1] for display.

ColourClipColourZero (Colour &c)
Clips colour to zero only.

Colour ClrMix (const Colour &c1, const Colour &c2, ClrReal mix)
Mixes two colours.

const Reflectance cRGBToNTSCLum (0.299, 0.587, 0.114)
Converts RGB to greyscale, assuming we're in an NTSC colourspace with gamma = 2.2.

const Reflectance cRGBToLum (0.3086, 0.6094, 0.0820)
Convert RGB to greyscale, assuming a linear colour space.

const ClrMat cNTSCToCIE ( 0.67, 0.21, 0.14, 0.33, 0.71, 0.08, 0.00, 0.08, 0.78)
const ClrMat cCIEToNTSC ( 1.730, -0.482, -0.261, -0.814, 1.652, -0.023, 0.083, -0.169, 1.284)
const ClrMat cRGBToYIQ ( 0.299, 0.587, 0.114, 0.596, -0.275, -0.321, 0.212, -0.523, 0.311)
const ClrMat cYIQToRGB ( 1.0, 0.956, 0.621, 1.0, -0.272, -0.647, 1.0, -1.105, 1.702)
Colour YUVToRGB (const Colour &yuv)
Colour RGBToYUV (const Colour &rgb)
YUV == YCbCr.

const Colour cBlack (0, 0, 0)
const Colour cWhite (1, 1, 1)
const Colour cGrey (cWhite * 0.5)
const Colour cGrey05 (cWhite * 0.05)
const Colour cGrey10 (cWhite * 0.1)
const Colour cGrey25 (cWhite * 0.25)
const Colour cGrey50 (cWhite * 0.5)
const Colour cGrey75 (cWhite * 0.75)
const Colour cGrey90 (cWhite * 0.90)
const Colour cGrey95 (cWhite * 0.95)
const Colour cRed (1, 0, 0)
const Colour cOrange (1, 0.5, 0)
const Colour cYellow (1, 1, 0)
const Colour cGreen (0, 1, 0)
const Colour cCyan (0, 1, 1)
const Colour cBlue (0, 0, 1)
const Colour cPurple (1, 0, 1)
ClrTrans RGBScale (ClrReal rscale, ClrReal gscale, ClrReal bscale)
use Image::Transform() to apply these to an image.

ClrTrans RGBOffset (const Colour &c)
ClrTrans RGBReplace (const Colour &c)
ClrTrans RGBToLum ()
ClrTrans RGBSaturate (ClrReal sat)
Saturate image sat < 1.0 decreases saturation towards 0.0 (greyscale), sat > 1.0 increases it.

ClrTrans RGBPixelMix (ClrReal mix, const Colour &c)
Mix with colour If you use c = cBlack, mix < 1.0 will darken the image, and mix > 1.0 will lighten it. More...

ClrTrans RGBHueRotate (ClrReal degrees)
Rotate hue of image in HSV space.


Variables

const Int hsvRed = 0
const Int hsvOrange = 30
const Int hsvYellow = 60
const Int hsvGreen = 120
const Int hsvCyan = 180
const Int hsvBlue = 240
const Int hsvPurple = 300


Typedef Documentation

ClrMat

A colour basis transformation matrix.

Used for converting between tri-stimulus colour spaces.

Definition at line 20 of file Colour.h.

ClrReal

The type used for colour components.

Definition at line 22 of file Colour.h.

ClrTrans

A colour transformation.

Can be applied to an Image with Image::Transform().

Definition at line 21 of file Colour.h.

Colour

A standard tri-stimulus colour.

We don't store a tag saying what basis functions the colour depends on for efficiency reasons.

Definition at line 18 of file Colour.h.

Colour4

A Colour with a transparency channel.

Definition at line 19 of file Colour.h.

typedef NArray<Colour4> Colour4List

Definition at line 50 of file Colour.h.

typedef NArray<Colour> ColourList

Definition at line 49 of file Colour.h.

typedef ColourList ReflList

Definition at line 51 of file Colour.h.

typedef Colour Reflectance

Definition at line 48 of file Colour.h.


Function Documentation

Colour & ClipColour (Colour & c)

Clips colour to [0, 1] for display.

Definition at line 32 of file Colour.cc.

Colour & ClipColourZero (Colour & c)

Clips colour to zero only.

Definition at line 44 of file Colour.cc.

Colour ClrMix (const Colour & c1, const Colour & c2, ClrReal mix) [inline]

Mixes two colours.

Definition at line 57 of file Colour.h.

Colour HSVCol (ClrReal hue, ClrReal saturation, ClrReal value)

Definition at line 53 of file Colour.cc.

Colour RGBCol (ClrReal r, ClrReal g, ClrReal b) [inline]

Definition at line 44 of file Colour.h.

ClrTrans RGBHueRotate (ClrReal degrees)

Rotate hue of image in HSV space.

Definition at line 132 of file Colour.cc.

ClrTrans RGBOffset (const Colour & c)

Definition at line 127 of file Colour.cc.

ClrTrans RGBPixelMix (ClrReal mix, const Colour & c)

Mix with colour If you use c = cBlack, mix < 1.0 will darken the image, and mix > 1.0 will lighten it.

If you use the average colour of an image, c = img.AverageColour(), mix < 1.0 will lower contrast, mix > 1.0 raise it.

Definition at line 118 of file Colour.cc.

ClrTrans RGBReplace (const Colour & c)

Definition at line 105 of file Colour.cc.

ClrTrans RGBSaturate (ClrReal sat)

Saturate image sat < 1.0 decreases saturation towards 0.0 (greyscale), sat > 1.0 increases it.

Definition at line 99 of file Colour.cc.

ClrTrans RGBScale (ClrReal rscale, ClrReal gscale, ClrReal bscale)

use Image::Transform() to apply these to an image.

Definition at line 82 of file Colour.cc.

ClrTrans RGBToLum ()

Definition at line 87 of file Colour.cc.

Colour RGBToYUV (const Colour & rgb)

YUV == YCbCr.

Definition at line 174 of file Colour.cc.

Colour YUVToRGB (const Colour & yuv)

Definition at line 163 of file Colour.cc.

const Colour cBlack (0, 0, 0)

const Colour cBlue (0, 0, 1)

const ClrMat cCIEToNTSC (1. 730, -0. 482, -0. 261, -0. 814, 1. 652, -0. 023, 0. 083, -0. 169, 1. 284)

const Colour cCyan (0, 1, 1)

const Colour cGreen (0, 1, 0)

const Colour cGrey (cWhite *0. 5)

const Colour cGrey05 (cWhite *0. 05)

const Colour cGrey10 (cWhite *0. 1)

const Colour cGrey25 (cWhite *0. 25)

const Colour cGrey50 (cWhite *0. 5)

const Colour cGrey75 (cWhite *0. 75)

const Colour cGrey90 (cWhite *0. 90)

const Colour cGrey95 (cWhite *0. 95)

const ClrMat cNTSCToCIE (0. 67, 0. 21, 0. 14, 0. 33, 0. 71, 0. 08, 0. 00, 0. 08, 0. 78)

const Colour cOrange (1, 0. 5, 0)

const Colour cPurple (1, 0, 1)

const Reflectance cRGBToLum (0. 3086, 0. 6094, 0. 0820)

Convert RGB to greyscale, assuming a linear colour space.

const Reflectance cRGBToNTSCLum (0. 299, 0. 587, 0. 114)

Converts RGB to greyscale, assuming we're in an NTSC colourspace with gamma = 2.2.

const ClrMat cRGBToYIQ (0. 299, 0. 587, 0. 114, 0. 596, -0. 275, -0. 321, 0. 212, -0. 523, 0. 311)

const Colour cRed (1, 0, 0)

const Colour cWhite (1, 1, 1)

const ClrMat cYIQToRGB (1. 0, 0. 956, 0. 621, 1. 0, -0. 272, -0. 647, 1. 0, -1. 105, 1. 702)

const Colour cYellow (1, 1, 0)


Variable Documentation

const Int hsvBlue = 240

Definition at line 129 of file Colour.h.

const Int hsvCyan = 180

Definition at line 128 of file Colour.h.

const Int hsvGreen = 120

Definition at line 127 of file Colour.h.

const Int hsvOrange = 30

Definition at line 125 of file Colour.h.

const Int hsvPurple = 300

Definition at line 130 of file Colour.h.

const Int hsvRed = 0

Definition at line 124 of file Colour.h.

const Int hsvYellow = 60

Definition at line 126 of file Colour.h.


Generated at Sat Aug 5 00:16:58 2000 for Graphics Class Library by doxygen 1.1.0 written by Dimitri van Heesch, © 1997-2000