Open Inventor Reference
|
Color vector class. More...
#include <Inventor/SbColor.h>
Public Member Functions | |
SbColor () | |
Default constructor. | |
SbColor (const SbVec3f vec3f) | |
Constructors for color vector. | |
SbColor (const float rgb[3]) | |
Constructors for color vector. | |
SbColor (float r, float g, float b) | |
Constructors for color vector. | |
SbColor & | setHSVValue (float h, float s, float v) |
Sets value of color vector from 3 HSV (Hue, Saturation, and Value) components. | |
SbColor & | setHSVValue (const float hsv[3]) |
Sets value of color vector from array of 3 HSV components. | |
void | getHSVValue (float &h, float &s, float &v) const |
Returns 3 individual hsv components. | |
void | getHSVValue (float hsv[3]) const |
Returns an array of 3 hsv components. | |
SbColor & | setPackedValue (uint32_t orderedRGBA, float &transparency) |
Sets value of color vector from an RGBA packed color value. | |
uint32_t | getPackedValue (float transparency=0.0) const |
Returns an RGBA packed color value, derived from the color vector and the passed transparency value. | |
![]() | |
SbVec3f () | |
Default constructor. | |
SbVec3f (const float v[3]) | |
Constructor given vector components. | |
SbVec3f (float x, float y, float z) | |
Constructor given vector components. | |
SbVec3f (SbPlane &p0, SbPlane &p1, SbPlane &p2) | |
Constructor given 3 planes. | |
SbVec3f | cross (const SbVec3f &v) const |
Returns right-handed cross product of vector and another vector. | |
float | dot (const SbVec3f &v) const |
Returns dot (inner) product of vector and another vector. | |
const float * | getValue () const |
Returns vector components. | |
void | getValue (float &x, float &y, float &z) const |
Returns vector components. | |
float | length () const |
Returns geometric length of vector. | |
float | normalize () |
Changes vector to be unit length, returning the length before normalization. | |
void | negate () |
Negates each component of vector in place. | |
SbVec3f & | setValue (const float v[3]) |
Sets the vector components. | |
SbVec3f & | setValue (float x, float y, float z) |
Sets the vector components. | |
SbVec3f & | setValue (const SbVec3f &barycentic, const SbVec3f &v0, const SbVec3f &v1, const SbVec3f &v2) |
Sets value of vector to be convex combination of 3 other vectors, using barycentic coordinates. | |
float & | operator[] (int i) |
Accesses indexed component of vector. | |
const float & | operator[] (int i) const |
SbVec3f & | operator*= (float d) |
Component-wise scalar multiplication and division operators. | |
SbVec3f & | operator/= (float d) |
Component-wise scalar multiplication and division operators. | |
SbVec3f & | operator+= (SbVec3f v) |
Component-wise vector addition and subtraction operators. | |
SbVec3f & | operator-= (SbVec3f v) |
Component-wise vector addition and subtraction operators. | |
SbVec3f | operator- () const |
Nondestructive unary negation - returns a new vector. | |
bool | equals (const SbVec3f v, float tolerance) const |
Equality comparison within given tolerance em the square of the length of the maximum distance between the two vectors. | |
SbVec3f | getClosestAxis () const |
Returns principal axis that is closest (based on maximum dot product) to this vector. | |
Additional Inherited Members | |
![]() | |
float | vec [3] |
Storage for vector components. | |
This class is used to represent an RGB color. Each component of the vector is a floating-point number between 0.0 and 1.0. There are routines to convert back and forth between RGB and HSV. {}
SbColor::SbColor | ( | ) |
Referenced by setHSVValue(), setHSVValue(), and setPackedValue().
|
inline |
Definition at line 90 of file SbColor.h.
References SbVec3f::getValue(), SbVec3f::SbVec3f(), and SbVec3f::setValue().
|
inline |
Definition at line 93 of file SbColor.h.
References SbVec3f::setValue().
|
inline |
Definition at line 96 of file SbColor.h.
References SbVec3f::setValue().
void SbColor::getHSVValue | ( | float & | h, |
float & | s, | ||
float & | v ) const |
Referenced by getHSVValue().
|
inline |
Definition at line 110 of file SbColor.h.
References getHSVValue().
uint32_t SbColor::getPackedValue | ( | float | transparency = 0.0 | ) | const |
The alpha component is set to (1.0 - transparency) * 255, resulting in a hex value between 0 and 0xFF.
If transparency not specified, alpha is set to 0xFF (opaque).
|
inline |
Definition at line 103 of file SbColor.h.
References SbColor(), and setHSVValue().
SbColor & SbColor::setHSVValue | ( | float | h, |
float | s, | ||
float | v ) |
The packed color format expressed in hexadecimal is 0xrrggbbaa, where
RGBA component values range from 0 to 0xFF (255). The returned transparency value is a floating point value between 0.0 (opaque) and 1.0 (completely transparent). It is derived from the alpha component of the RGBA color.
References SbColor().