Contents User Forum Source Index APIs by Task APIs by Level Data


G3D::Color3 Class Reference

Do not subclass-- this implementation makes assumptions about the memory layout. More...

#include <Color3.h>

List of all members.

Public Member Functions

float average () const
 Color3 (const class Color3uint8 &other)
 Color3 (const Color3 &other)
 Color3 (const float value[3])
 Color3 (const class Vector3 &v)
 Color3 (float r, float g, float b)
 Color3 (class BinaryInput &bi)
 Color3 ()
Color3 cross (const Color3 &rkVector) const
void deserialize (class BinaryInput &bi)
Color3 direction () const
float dot (const Color3 &rkVector) const
bool fuzzyEq (const Color3 &other) const
bool fuzzyNe (const Color3 &other) const
size_t hashCode () const
float length () const
Color3 lerp (const Color3 &other, float a) const
Color3 max (const Color3 &other) const
Color3 min (const Color3 &other) const
Color3 operator * (const Color3 &rkVector) const
Color3 operator * (float fScalar) const
Color3operator *= (float fScalar)
Color3operator *= (const Color3 &rkVector)
 operator const float * () const
 operator float * ()
bool operator!= (const Color3 &rkVector) const
Color3 operator+ (const Color3 &rkVector) const
Color3operator+= (const Color3 &rkVector)
Color3 operator- () const
Color3 operator- (const Color3 &rkVector) const
Color3operator-= (const Color3 &rkVector)
Color3 operator/ (float fScalar) const
Color3operator/= (float fScalar)
Color3operator= (const Color3 &rkVector)
bool operator== (const Color3 &rkVector) const
float & operator[] (int i)
const float & operator[] (int i) const
Color3 pow (float other) const
Color3 pow (const Color3 &other) const
void serialize (class BinaryOutput &bo) const
float squaredLength () const
float sum () const
std::string toString () const
Color3 unitCross (const Color3 &rkVector) const
float unitize (float fTolerance=1e-06)

Static Public Member Functions

static const Color3black ()
static const Color3blue ()
static const Color3brown ()
static const Color3cyan ()
static Color3 fromARGB (uint32)
static Color3 fromHSV (const Vector3 &_hsv)
static const Color3gray ()
static const Color3green ()
static Color3 jetColorMap (const float &val)
static const Color3one ()
static const Color3orange ()
static const Color3purple ()
static Color3 rainbowColorMap (float hue)
static Color3 random ()
static const Color3red ()
static Vector3 toHSV (const Color3 &_rgb)
static const Color3wheelRandom ()
static const Color3white ()
static const Color3yellow ()
static const Color3zero ()

Public Attributes

float b
float g
float r


Detailed Description

Do not subclass-- this implementation makes assumptions about the memory layout.


Constructor & Destructor Documentation

G3D::Color3::Color3 (  )  [inline]

Does not initialize fields.

G3D::Color3::Color3 ( class BinaryInput bi  ) 

G3D::Color3::Color3 ( float  r,
float  g,
float  b 
) [inline]

G3D::Color3::Color3 ( const class Vector3 v  ) 

G3D::Color3::Color3 ( const float  value[3]  )  [inline]

G3D::Color3::Color3 ( const Color3 other  )  [inline]

Initialize from another color.

G3D::Color3::Color3 ( const class Color3uint8 other  ) 


Member Function Documentation

float G3D::Color3::average (  )  const [inline]

static const Color3& G3D::Color3::black (  )  [static]

static const Color3& G3D::Color3::blue (  )  [static]

static const Color3& G3D::Color3::brown (  )  [static]

Color3 G3D::Color3::cross ( const Color3 rkVector  )  const [inline]

static const Color3& G3D::Color3::cyan (  )  [static]

void G3D::Color3::deserialize ( class BinaryInput bi  ) 

Color3 G3D::Color3::direction (  )  const [inline]

float G3D::Color3::dot ( const Color3 rkVector  )  const [inline]

static Color3 G3D::Color3::fromARGB ( uint32   )  [static]

Initialize from an HTML-style color (e.g.

0xFF0000 == RED)

static Color3 G3D::Color3::fromHSV ( const Vector3 _hsv  )  [static]

Converts from HSV to RGB , note: toHSV(fromHSV(_hsv)) may not be _hsv, if it is at a grey point or black point.

The components of _hsv should lie in the unit interval.

Referenced Code:
Alvy Ray Smith SIGGRAPH 1978 "Color Gamut Transform Pairs"

bool G3D::Color3::fuzzyEq ( const Color3 other  )  const [inline]

bool G3D::Color3::fuzzyNe ( const Color3 other  )  const [inline]

static const Color3& G3D::Color3::gray (  )  [static]

static const Color3& G3D::Color3::green (  )  [static]

size_t G3D::Color3::hashCode (  )  const

static Color3 G3D::Color3::jetColorMap ( const float &  val  )  [static]

Duplicates the matlab jet colormap maps [0,1] --> (r,g,b) where blue is close to 0 and red is close to 1.

float G3D::Color3::length (  )  const [inline]

Color3 G3D::Color3::lerp ( const Color3 other,
float  a 
) const [inline]

Color3 G3D::Color3::max ( const Color3 other  )  const [inline]

Color3 G3D::Color3::min ( const Color3 other  )  const [inline]

static const Color3& G3D::Color3::one (  )  [static]

Color3 G3D::Color3::operator * ( const Color3 rkVector  )  const [inline]

Color3 G3D::Color3::operator * ( float  fScalar  )  const [inline]

Color3 & G3D::Color3::operator *= ( float  fScalar  )  [inline]

Color3 & G3D::Color3::operator *= ( const Color3 rkVector  )  [inline]

G3D::Color3::operator const float * (  )  const [inline]

G3D::Color3::operator float * (  )  [inline]

bool G3D::Color3::operator!= ( const Color3 rkVector  )  const [inline]

Color3 G3D::Color3::operator+ ( const Color3 rkVector  )  const [inline]

Color3 & G3D::Color3::operator+= ( const Color3 rkVector  )  [inline]

Color3 G3D::Color3::operator- (  )  const [inline]

Color3 G3D::Color3::operator- ( const Color3 rkVector  )  const [inline]

Color3 & G3D::Color3::operator-= ( const Color3 rkVector  )  [inline]

Color3 G3D::Color3::operator/ ( float  fScalar  )  const

Color3& G3D::Color3::operator/= ( float  fScalar  ) 

Color3 & G3D::Color3::operator= ( const Color3 rkVector  )  [inline]

bool G3D::Color3::operator== ( const Color3 rkVector  )  const [inline]

float & G3D::Color3::operator[] ( int  i  )  [inline]

const float & G3D::Color3::operator[] ( int  i  )  const [inline]

static const Color3& G3D::Color3::orange (  )  [static]

Color3 G3D::Color3::pow ( float  other  )  const [inline]

Color3 G3D::Color3::pow ( const Color3 other  )  const [inline]

static const Color3& G3D::Color3::purple (  )  [static]

static Color3 G3D::Color3::rainbowColorMap ( float  hue  )  [static]

Returns colors with maximum saturation and value.

Parameters:
hue [0, 1]

static Color3 G3D::Color3::random (  )  [static]

Random unit vector.

static const Color3& G3D::Color3::red (  )  [static]

void G3D::Color3::serialize ( class BinaryOutput bo  )  const

float G3D::Color3::squaredLength (  )  const [inline]

float G3D::Color3::sum (  )  const [inline]

static Vector3 G3D::Color3::toHSV ( const Color3 _rgb  )  [static]

std::string G3D::Color3::toString (  )  const

Color3 G3D::Color3::unitCross ( const Color3 rkVector  )  const [inline]

float G3D::Color3::unitize ( float  fTolerance = 1e-06  ) 

static const Color3& G3D::Color3::wheelRandom (  )  [static]

Returns one of the color wheel colors (e.g.

RED, GREEN, CYAN). Does not include white, black, or gray.

static const Color3& G3D::Color3::white (  )  [static]

static const Color3& G3D::Color3::yellow (  )  [static]

static const Color3& G3D::Color3::zero (  )  [static]


Member Data Documentation

Channel value.


The documentation for this class was generated from the following file:
Generated on Thu Aug 2 11:40:45 2007 for G3D by doxygen 1.5.2
Hosted by SourceForge.net Logo