Main Page | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

ARLib::Graphics::ARColour Struct Reference

Colour data type for specified red, green and blue component value. More...

#include <arcolour.h>

List of all members.

Public Member Functions

 ARColour (unsigned char r, unsigned char g, unsigned char b)
 Constructor for specifying red, green and blue channel components.
 ARColour (unsigned char r, unsigned char g, unsigned char b, unsigned char a)
 Constructor for specifying red, green, blue and alpha channel components.
unsigned char GetLuminance ()
 Returns the luminance of the pixel.
unsigned char GetGrey ()
 Returns a grey value equivalent of the red, green and blue channels.
void SetRGB (unsigned char r, unsigned char g, unsigned char b)
 Helper function for setting the red, green and blue channels of the pixel.

Public Attributes

unsigned char red
 The value of the red channel of the pixel.
unsigned char green
 The value of the green channel of the pixel.
unsigned char blue
 The value of the blue channel of the pixel.
unsigned char alpha
 The value of the alpha channel of the pixel.


Detailed Description

Colour data type for specified red, green and blue component value.

This data type can be used to define a colour variable or use when passing colour information as an argument. For example...

ARColour red(255,0,0);
ARColour blue(0,0,255);

DrawBox( 10, 10, 110, 110, ARColour(128,255,128) );


Member Function Documentation

unsigned char ARLib::Graphics::ARColour::GetGrey  )  [inline]
 

Returns a grey value equivalent of the red, green and blue channels.

Returns an average of the red, green and blue channels...

 Grey = (0.3333 * red) + (0.3333 * green) + (0.3333 * blue) 
Returns:
A value in the range of 0 to 255.

unsigned char ARLib::Graphics::ARColour::GetLuminance  )  [inline]
 

Returns the luminance of the pixel.

Uses a standard formula for calculating the luminance...

 Lum = (0.3 * red) + (0.59 * green) + (0.11 * blue ) 
Returns:
A value in the range of 0 to 255.

void ARLib::Graphics::ARColour::SetRGB unsigned char  r,
unsigned char  g,
unsigned char  b
[inline]
 

Helper function for setting the red, green and blue channels of the pixel.

Parameters:
r The value to assign to the red channel.
g The value to assign to the green channel.
b The value to assign to the blue channel.


The documentation for this struct was generated from the following file:
Generated on Wed Aug 31 18:01:39 2005 for ARLib by  doxygen 1.3.9.1