QSDK 1.1 Documentation
Main Page | Modules | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

Maths::Color4b Struct Reference
[QMaths]

#include <Q/maths.h>

List of all members.

Public Member Functions

 Color4b ()
 Color4b (const Color4b &c)
 Color4b (unsigned int v)
 Color4b (unsigned int r, unsigned int g, unsigned int b)
 Color4b (unsigned int r, unsigned int g, unsigned int b, unsigned int a)
 Color4b (const Vec3b &v)
 Color4b (const Vec4b &v)
 Color4b (const Vec3f &v)
 Color4b (const Vec4f &v)
 Color4b (const Vec4ui &v)
unsigned int alpha () const
unsigned int red () const
unsigned int green () const
unsigned int blue () const
unsigned int value () const
 operator unsigned int () const
 operator Vec4b () const
 operator Vec4f () const
 operator Vec3f () const
Color4boperator= (const Color4b &c)
void alpha (unsigned int a)
void red (unsigned int a)
void green (unsigned int a)
void blue (unsigned int a)
void value (unsigned int value)

Friends

Color4b operator+ (const Color4b &c1, const Color4b &c2)
Color4b operator- (const Color4b &c1, const Color4b &c2)
Color4b operator- (float m, const Color4b &c1)
Color4b operator * (const Color4b &c1, const Color4b &c2)
Color4b operator * (const Color4b &c1, float m)
Color4b operator * (float m, const Color4b &c1)
int operator== (const Color4b &c1, const Color4b &c2)
int operator!= (const Color4b &c1, const Color4b &c2)


Detailed Description

BGRA Color definition and manipulation.


Constructor & Destructor Documentation

Maths::Color4b::Color4b  )  [inline]
 

Construct a black transparent color.

Maths::Color4b::Color4b const Color4b c  )  [inline]
 

Construct a color, copied from c.

Maths::Color4b::Color4b unsigned int  v  )  [inline, explicit]
 

Construct a color of value v.

Maths::Color4b::Color4b unsigned int  r,
unsigned int  g,
unsigned int  b
[inline]
 

Construct an opaque color.

Parameters:
r The value of the red channel (0-255)
g The value of the green channel (0-255)
b The value of the blue channel (0-255)

Maths::Color4b::Color4b unsigned int  r,
unsigned int  g,
unsigned int  b,
unsigned int  a
[inline]
 

Construct a color.

Parameters:
r The value of the red channel (0-255)
g The value of the green channel (0-255)
b The value of the blue channel (0-255)
a The value of the alpha channel (0-255)

Maths::Color4b::Color4b const Vec3b v  )  [inline, explicit]
 

Construct an opaque color from the Vec3<unsigned char>, such that v.x sets the red channel, v.y sets the green channel and v.z sets the blue channel.

Maths::Color4b::Color4b const Vec4b v  )  [inline, explicit]
 

Construct a color from the Vec4<unsigned char>, such that v.x sets the red channel, v.y sets the green channel, v.z sets the blue channel and v.w sets the alpha channel.

Maths::Color4b::Color4b const Vec3f v  )  [inline, explicit]
 

Construct an opaque color from the Vec3<float>, such that v.x sets the red channel, v.y sets the green channel and v.z sets the blue channel. The values of each element of the vector are clamped between 0 and 1.

Maths::Color4b::Color4b const Vec4f v  )  [inline, explicit]
 

Construct a color from the Vec4<float>, such that v.x sets the red channel, v.y sets the green channel, v.z sets the blue channel and v.w sets the alpha channel. The values of each element of the vector are clamped between 0 and 1.

Maths::Color4b::Color4b const Vec4ui v  )  [inline, explicit]
 

Construct a color from the Vec4<unsigned int>, such that v.x sets the red channel, v.y sets the green channel, v.z sets the blue channel and v.w sets the alpha channel. The values of each element of the vector are clamped between 0 and 255.


Member Function Documentation

void Maths::Color4b::alpha unsigned int  a  )  [inline]
 

Set the alpha channel of the color.

unsigned int Maths::Color4b::alpha  )  const [inline]
 

Return the alpha component of the color.

void Maths::Color4b::blue unsigned int  a  )  [inline]
 

Set the blue channel of the color.

unsigned int Maths::Color4b::blue  )  const [inline]
 

Return the blue component of the color.

void Maths::Color4b::green unsigned int  a  )  [inline]
 

Set the green channel of the color.

unsigned int Maths::Color4b::green  )  const [inline]
 

Return the green component of the color.

Maths::Color4b::operator unsigned int  )  const [inline]
 

Return the diect value of the color.

Maths::Color4b::operator Vec3f  )  const [inline]
 

Return the color as a Vec3<float>.

Maths::Color4b::operator Vec4b  )  const [inline]
 

Return the color as a Vec4<unsigned char>.

Maths::Color4b::operator Vec4f  )  const [inline]
 

Return the color as a Vec4<float>.

void Maths::Color4b::red unsigned int  a  )  [inline]
 

Set the red channel of the color.

unsigned int Maths::Color4b::red  )  const [inline]
 

Return the red component of the color.

void Maths::Color4b::value unsigned int  value  )  [inline]
 

Set the direct value of the color.

unsigned int Maths::Color4b::value  )  const [inline]
 

Return the direct value of the color.


Friends And Related Function Documentation

Color4b operator * float  m,
const Color4b c1
[friend]
 

Scale each component of c1 by m and clamp the result.

Color4b operator * const Color4b c1,
float  m
[friend]
 

Scale each component of c1 by m and clamp the result.

Color4b operator * const Color4b c1,
const Color4b c2
[friend]
 

Scale each component of c1 by the respective component of c2 and clamp the result.

Color4b operator+ const Color4b c1,
const Color4b c2
[friend]
 

Add the individual components of the color together and clamp the result.

Color4b operator- float  m,
const Color4b c1
[friend]
 

Subtract the individual components of c2 from a color that has m as the value of each component and clamp the result.

Color4b operator- const Color4b c1,
const Color4b c2
[friend]
 

Subtract the individual components of c2 from c1 and clamp the result.

Return to QSDK documentation Contents page. Contact details for support, information and fault-reporting.
Qube Software Limited © 2000-2004