ML Reference
ml::ColorField Class Reference

Field to encapsulate a vector of 3 float values representing an (rgb) color with all properties of Vector3Field. More...

#include <mlFields.h>

Inheritance diagram for ml::ColorField:
ml::Vector3Field ml::Field

List of all members.

Public Member Functions

 ColorField ()
 Default constructor, do not use it.
 ColorField (const std::string &name)
 Constructor, create a field with a name to manage a vector of 3 float values interpreted as rgb-color values without transparency.
void setColorValue (float r, float g, float b)
 Sets the field value to r, g and b.
void getColorValue (float &r, float &g, float &b) const
 Returns the value of the field into the floats r, g, and b.
void setPackedColorValue (MLuint32 rgba)
 Sets the packed uint32 color value to rgba.
MLuint32 getPackedColorValue () const
 Returns the packed uint32 color value.
Deprecated
 ColorField (const std::string &name, Vector3 *valuePtr)

Detailed Description

Field to encapsulate a vector of 3 float values representing an (rgb) color with all properties of Vector3Field.

Definition at line 1721 of file mlFields.h.


Constructor & Destructor Documentation

ml::ColorField::ColorField ( )

Default constructor, do not use it.

ml::ColorField::ColorField ( const std::string &  name)

Constructor, create a field with a name to manage a vector of 3 float values interpreted as rgb-color values without transparency.

Default value is (0,0,0).

ml::ColorField::ColorField ( const std::string &  name,
Vector3 valuePtr 
)

Member Function Documentation

void ml::ColorField::getColorValue ( float &  r,
float &  g,
float &  b 
) const

Returns the value of the field into the floats r, g, and b.

MLuint32 ml::ColorField::getPackedColorValue ( ) const

Returns the packed uint32 color value.

Last (alpha) value is always set to opaque in bits 24 to 31. Red is read from the lowest 8 bits, green from bits 8-15, and blue from the bits 16 to 23.

void ml::ColorField::setColorValue ( float  r,
float  g,
float  b 
)

Sets the field value to r, g and b.

void ml::ColorField::setPackedColorValue ( MLuint32  rgba)

Sets the packed uint32 color value to rgba.

Last (alpha) value from bits 24 to 31 is ignored; red is read from the lowest 8 bits, green from bits 8-15, and blue from the bits 16 to 23; then value are normalized from ranges [0,255] to range [0,1] and stored as floating point values.


The documentation for this class was generated from the following file: