SbColorRGBA Class Reference
[Basics]

ColorRGBA vector class. More...

#include <Inventor/SbColorRGBA.h>

Inheritance diagram for SbColorRGBA:
SbVec4f

List of all members.

Public Member Functions

 SbColorRGBA ()
 SbColorRGBA (const SbVec4f vec4f)
 SbColorRGBA (const float rgba[4])
 SbColorRGBA (float r, float g, float b, float a)
SbColorRGBAsetPackedValue (uint32_t orderedRGBA)
uint32_t getPackedValue () const
SbColorRGBAsetHSVAValue (float h, float s, float v, float a)
SbColorRGBAsetHSVAValue (const float hsva[4])
void getHSVAValue (float &h, float &s, float &v, float &a) const
void getHSVAValue (float hsva[4]) const

Detailed Description

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.

Starting with Open Inventor 9.0, packed color storage is consistent with documentation: previously, alpha value using packed color access method was considered as transparency. Nevertheless, for compatibility reason, user can go back to previous behavior by setting the OIV_COMPAT_COLOR_RGBA environment variable to 1.

SEE ALSO

SbColor, SbVec4f


Constructor & Destructor Documentation

SbColorRGBA::SbColorRGBA (  ) 

Default constructor.

The color value is not initialized.

SbColorRGBA::SbColorRGBA ( const SbVec4f  vec4f  )  [inline]

Constructor that takes an RGBA vector value.

SbColorRGBA::SbColorRGBA ( const float  rgba[4]  )  [inline]

Constructor that takes an RGBA value as an array of 4 floats.

SbColorRGBA::SbColorRGBA ( float  r,
float  g,
float  b,
float  a 
) [inline]

Constructor that takes an RGBA value as 4 floats.

See also OIV_COMPAT_COLOR_RGBA.


Member Function Documentation

void SbColorRGBA::getHSVAValue ( float  hsva[4]  )  const [inline]

Returns color value in the HSV (hue, saturation and value) plus Alpha color space.

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.

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.

SbColorRGBA& SbColorRGBA::setHSVAValue ( const float  hsva[4]  )  [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.

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

  • 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).

See also OIV_COMPAT_COLOR_RGBA.


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

Open Inventor by FEI reference manual, generated on 19 Aug 2019
Copyright © FEI S.A.S. All rights reserved.
http://www.openinventor.com/