Open Inventor Reference
SbColor Class Reference

Color vector class. More...

#include <Inventor/SbColor.h>

Inheritance diagram for SbColor:
SbVec3f

List of all members.

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.
SbColorsetHSVValue (float h, float s, float v)
 Sets value of color vector from 3 HSV (Hue, Saturation, and Value) components.
SbColorsetHSVValue (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.
SbColorsetPackedValue (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.

Detailed Description

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. {}

See Also
SbVec3f

Definition at line 84 of file SbColor.h.


Constructor & Destructor Documentation

SbColor::SbColor ( )
SbColor::SbColor ( const SbVec3f  vec3f) [inline]

Definition at line 90 of file SbColor.h.

References SbVec3f::getValue(), and SbVec3f::setValue().

SbColor::SbColor ( const float  rgb[3]) [inline]

Definition at line 93 of file SbColor.h.

References SbVec3f::setValue().

SbColor::SbColor ( float  r,
float  g,
float  b 
) [inline]

Definition at line 96 of file SbColor.h.

References SbVec3f::setValue().


Member Function Documentation

void SbColor::getHSVValue ( float &  h,
float &  s,
float &  v 
) const
void SbColor::getHSVValue ( float  hsv[3]) const [inline]

Definition at line 110 of file SbColor.h.

References getHSVValue().

Referenced by 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).

SbColor& SbColor::setHSVValue ( const float  hsv[3]) [inline]

Definition at line 103 of file SbColor.h.

References setHSVValue().

Referenced by setHSVValue().

SbColor& SbColor::setHSVValue ( float  h,
float  s,
float  v 
)

Value is the same as brightness of the color.

SbColor& SbColor::setPackedValue ( uint32_t  orderedRGBA,
float &  transparency 
)

The packed color format expressed in hexadecimal is 0xrrggbbaa, where

        rr is the red value
        gg is the green value
        bb is the blue value
        aa is the alpha value

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.


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