ColorRGBA vector class. More...
#include <Inventor/SbColorRGBA.h>
Public Member Functions | |
SbColorRGBA () | |
Default constructor. | |
SbColorRGBA (const SbVec4f vec4f) | |
Constructor that takes an RGBA vector value. | |
SbColorRGBA (const float rgba[4]) | |
Constructor that takes an RGBA value as an array of 4 floats. | |
SbColorRGBA (float r, float g, float b, float a) | |
Constructor that takes an RGBA value as 4 floats. | |
SbColorRGBA (uint32_t orderedRGBA) | |
Constructor that takes an RGBA value as a packed color. | |
SbColorRGBA & | setPackedValue (uint32_t orderedRGBA) |
Sets value of color vector from an RGBA packed color value. | |
uint32_t | getPackedValue () const |
Returns an RGBA packed color value, derived from the color vector. | |
SbColorRGBA & | setHSVAValue (float h, float s, float v, float a) |
Sets value of color vector from an HSV (Hue, Saturation, and Value) plus Alpha color value. | |
SbColorRGBA & | setHSVAValue (const float hsva[4]) |
Sets value of color vector from an HSV (Hue, Saturation, and Value) plus Alpha color value. | |
void | getHSVAValue (float &h, float &s, float &v, float &a) const |
Returns color value in the HSV (hue, saturation and value) plus Alpha color space. | |
void | getHSVAValue (float hsva[4]) const |
Returns color value in the HSV (hue, saturation and value) plus Alpha color space. | |
Public Member Functions inherited from SbVec4f | |
SbVec4f () | |
Default constructor. | |
SbVec4f (const float v[4]) | |
Constructor given vector components. | |
SbVec4f (float x, float y, float z, float w) | |
Constructor given vector components. | |
float | dot (const SbVec4f &v) const |
Returns dot (inner) product of vector and another vector. | |
void | getReal (SbVec3f &v) const |
Returns the real portion of the vector by dividing by the fourth value. | |
const float * | getValue () const |
Returns vector components. | |
void | getValue (float &x, float &y, float &z, float &w) const |
Returns vector components. | |
float | length () const |
Returns geometric length of vector. | |
float | lengthSquared () const |
Returns square length of vector. | |
void | negate () |
Negates each component of vector in place. | |
float | normalize () |
Changes vector to be unit length. | |
SbVec4f & | setValue (const float v[4]) |
Sets the vector components. | |
SbVec4f & | setValue (float x, float y, float z, float w) |
Sets the vector components. | |
SbVec4f & | setValue (const SbVec4d &vec4d) |
Sets value of vector from a double precision vector. | |
float & | operator[] (int i) |
Accesses indexed component of vector. | |
const float & | operator[] (int i) const |
SbVec4f & | operator*= (float d) |
Component-wise scalar multiplication operator. | |
SbVec4f & | operator/= (float d) |
Component-wise scalar division operator. | |
SbVec4f & | operator+= (const SbVec4f &u) |
Component-wise vector addition operator. | |
SbVec4f & | operator-= (const SbVec4f &u) |
Component-wise vector subtraction operator. | |
SbVec4f | operator- () const |
Nondestructive unary negation - returns a new vector. | |
SbBool | equals (const SbVec4f &v, float tolerance) const |
Equality comparison within given tolerance - the square of the length of the maximum distance between the two vectors. | |
template<typename T > | |
SbVec4f (const T &v) | |
Constructor that converts an arbitrary SbVec4 to an SbVec4f. | |
ColorRGBA vector class.
This class is used to represent an RGBA color. Each component of the vector is a floating-point number between 0.0 and 1.0. RGBA stands for red, green, blue and alpha. Alpha is the inverse of "transparency", in other words 0 is fully transparent and 1 is fully opaque.
Values may be specified in the HSV (hue, saturation and value) color space, but are stored internally as RGBA values.
Definition at line 61 of file SbColorRGBA.h.
SbColorRGBA::SbColorRGBA | ( | ) |
Default constructor.
The color value is not initialized.
|
inline |
Constructor that takes an RGBA vector value.
Definition at line 71 of file SbColorRGBA.h.
|
inline |
Constructor that takes an RGBA value as an array of 4 floats.
Definition at line 77 of file SbColorRGBA.h.
|
inline |
Constructor that takes an RGBA value as 4 floats.
Definition at line 83 of file SbColorRGBA.h.
SbColorRGBA::SbColorRGBA | ( | uint32_t | orderedRGBA | ) |
Constructor that takes an RGBA value as a packed color.
void SbColorRGBA::getHSVAValue | ( | float & | h, |
float & | s, | ||
float & | v, | ||
float & | a | ||
) | const |
Returns color value in the HSV (hue, saturation and value) plus Alpha color space.
|
inline |
Returns color value in the HSV (hue, saturation and value) plus Alpha color space.
Definition at line 139 of file SbColorRGBA.h.
uint32_t SbColorRGBA::getPackedValue | ( | ) | const |
Returns an RGBA packed color value, derived from the color vector.
The packed color format expressed in hexadecimal is 0xrrggbbaa.
|
inline |
Sets value of color vector from an HSV (Hue, Saturation, and Value) plus Alpha color value.
All components must be in the range 0 to 1.
Definition at line 126 of file SbColorRGBA.h.
SbColorRGBA & SbColorRGBA::setHSVAValue | ( | float | h, |
float | s, | ||
float | v, | ||
float | a | ||
) |
Sets value of color vector from an HSV (Hue, Saturation, and Value) plus Alpha color value.
All components must be in the range 0 to 1.
Value is the same as brightness of the color.
SbColorRGBA & SbColorRGBA::setPackedValue | ( | uint32_t | orderedRGBA | ) |
Sets value of color vector from an RGBA packed color value.
The packed color format expressed in hexadecimal is 0xrrggbbaa, where
RGBA component values range from 0 to 0xFF (255).