#include <Inventor/SbColor4f.h>
Public Methods | |
SbColor4f (void) | |
SbColor4f (const SbColor &rgb, const float alpha) | |
SbColor4f (const SbVec4f &v) | |
SbColor4f (const float *const rgba) | |
SbColor4f (const float r, const float g, const float b, const float a=1.0f) | |
void | setValue (const float r, const float g, const float b, const float a=1.0f) |
void | setValue (const float col[4]) |
const float * | getValue () const |
void | getValue (float &r, float &g, float &b, float &a) |
SbColor4f & | setRGB (const SbColor &col) |
void | getRGB (SbColor &color) |
SbColor4f & | setHSVValue (float h, float s, float v, float a=1.0f) |
SbColor4f & | setHSVValue (const float hsv[3], float alpha=1.0f) |
void | getHSVValue (float &h, float &s, float &v) const |
void | getHSVValue (float hsv[3]) const |
SbColor4f & | setPackedValue (const uint32_t rgba) |
uint32_t | getPackedValue () const |
float | operator[] (const int idx) const |
float & | operator[] (const int idx) |
SbColor4f & | operator *= (const float d) |
SbColor4f & | operator/= (const float d) |
SbColor4f & | operator+= (const SbColor4f &c) |
SbColor4f & | operator-= (const SbColor4f &c) |
Friends | |
COIN_DLL_API SbColor4f | operator * (const SbColor4f &c, const float d) |
COIN_DLL_API SbColor4f | operator * (const float d, const SbColor4f &c) |
COIN_DLL_API SbColor4f | operator/ (const SbColor4f &c, const float d) |
COIN_DLL_API SbColor4f | operator+ (const SbColor4f &v1, const SbColor4f &v2) |
COIN_DLL_API SbColor4f | operator- (const SbColor4f &v1, const SbColor4f &v2) |
COIN_DLL_API int | operator== (const SbColor4f &v1, const SbColor4f &v2) |
COIN_DLL_API int | operator!= (const SbColor4f &v1, const SbColor4f &v2) |
This class is used internally within other classes in Coin. It contains a 4 component vector as a position in the RGB cube with an additional transparency value.
The red, green and blue values should be between 0.0 and 1.0, where 0.0 is interpreted as minimum intensity, and 1.0 is maximum intensity. The transparency value is also between 0.0 and 1.0.
SbColor4f contains methods for convenient handling of setting and getting color values as 32 bit packed values or as HSV values.
Note: this class is not part of Open Inventor, but is an extension to the API. Don't use it if you want your code to be compatible with Open Inventor.
|
Default constructor. The color value will be uninitialized until explicitly set. |
|
Construct and initialize an SbColor4f with the red, green and blue components from the SbColor |
|
Construct and initialize an SbColor4f with the red, green, blue and alpha values given by the |
|
Construct and initialize an SbColor4f with the red, green, blue and alpha taken from given |
|
Construct and initialize an SbColor4f with the given red, green, blue and alpha values. |
|
Set a new color. |
|
Set a new color. The elements of the array will be read in turned as red, green, blue and transparency. |
|
Return pointer to array of 4 float values representing the red, green, blue and transparency values of the color. |
|
Return components of the stored color. |
|
Sets the RGB components of the color. The alpha component is left unchanged. |
|
Returns the RGB components of this color. |
|
Set the color as a
|
|
Set the color as a
|
|
Return the color as a
|
|
Return the color as a
|
|
Set the color value as a 32 bit combined red/green/blue/alpha value. Each component is 8 bit wide (i.e. from 0x00 to 0xff), and the red value should be stored leftmost, like this: 0xRRGGBBAA.
|
|
Return color as a 32 bit packed integer in the form 0xRRGGBBAA.
|
|
Returns the color component represented by the given index idx. 0 is red, 1 is green, 2 is blue and 3 is the transparency value. |
|
Returns the color component represented by the given index idx. 0 is red, 1 is green, 2 is blue and 3 is the transparency value. |
|
Multiplies the RGB components by |
|
Divides the RGB components by |
|
Adds the RGB components. Alpha is ignored. |
|
Subtracts the RGB components. Alpha is ignored. |
|
Multiplies the RGB components by |
|
Multiplies the RGB components by |
|
Divides the RGB components by |
|
Adds the RGB components of the two colors. Alpha is taken from the first color ( |
|
Subtracts the RGB components of the two colors. Alpha is taken from the first color ( |
|
Check if two colors are equal. Returns 1 if equal, 0 if unequal. |
|
Check if two colors are unequal. Returns 0 if equal, 1 if unequal. |