SbColor4f   (3) manpage
SbColor4f
3
24 Jun 2004
Version 2.3.0
Coin
\"
-*-
nroff
-*-
  • NAME
      SbColor4f -
  • SYNOPSIS



      #include <Inventor/SbColor4f.h>

  • Detailed Description


      The SbColor4f class contains the red, green, blue and alpha components which make up a color value.
      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.

      See also:
      SbColor





      "Public Member Functions"
      \fBSbColor4f\fP (void)
      \fBSbColor4f\fP (const \fBSbColor\fP &rgb, const float alpha)
      \fBSbColor4f\fP (const \fBSbVec4f\fP &v)
      \fBSbColor4f\fP (const float *const rgba)
      \fBSbColor4f\fP (const float r, const float g, const float b, const float a=1.0f)
      void \fBsetValue\fP (const float r, const float g, const float b, const float a=1.0f)
      void \fBsetValue\fP (const float col[4])
      const float * \fBgetValue\fP () const
      void \fBgetValue\fP (float &r, float &g, float &b, float &a)
      \fBSbColor4f\fP & \fBsetRGB\fP (const \fBSbColor\fP &col)
      void \fBgetRGB\fP (\fBSbColor\fP &color)
      \fBSbColor4f\fP & \fBsetHSVValue\fP (float h, float s, float v, float a=1.0f)
      \fBSbColor4f\fP & \fBsetHSVValue\fP (const float hsv[3], float alpha=1.0f)
      void \fBgetHSVValue\fP (float &h, float &s, float &v) const
      void \fBgetHSVValue\fP (float hsv[3]) const
      \fBSbColor4f\fP & \fBsetPackedValue\fP (const uint32_t rgba)
      uint32_t \fBgetPackedValue\fP () const
      float \fBoperator[]\fP (const int idx) const
      float & \fBoperator[]\fP (const int idx)
      \fBSbColor4f\fP & \fBoperator *=\fP (const float d)
      \fBSbColor4f\fP & \fBoperator/=\fP (const float d)
      \fBSbColor4f\fP & \fBoperator+=\fP (const \fBSbColor4f\fP &c)
      \fBSbColor4f\fP & \fBoperator-=\fP (const \fBSbColor4f\fP &c)
      "Friends"
      \fBSbColor4f\fP \fBoperator *\fP (const \fBSbColor4f\fP &c, const float d)
      \fBSbColor4f\fP \fBoperator *\fP (const float d, const \fBSbColor4f\fP &c)
      \fBSbColor4f\fP \fBoperator/\fP (const \fBSbColor4f\fP &c, const float d)
      \fBSbColor4f\fP \fBoperator+\fP (const \fBSbColor4f\fP &v1, const \fBSbColor4f\fP &v2)
      \fBSbColor4f\fP \fBoperator-\fP (const \fBSbColor4f\fP &v1, const \fBSbColor4f\fP &v2)
      int \fBoperator==\fP (const \fBSbColor4f\fP &v1, const \fBSbColor4f\fP &v2)
      int \fBoperator!=\fP (const \fBSbColor4f\fP &v1, const \fBSbColor4f\fP &v2)
  • Constructor & Destructor Documentation


      "SbColor4f::SbColor4f (void)"

      Default constructor. The color value will be uninitialized until explicitly set. "SbColor4f::SbColor4f (const SbColor & rgb, const float alpha)"

      Construct and initialize an SbColor4f with the red, green and blue components from the SbColor rgb, and the alpha value from the supplied alpha argument. "SbColor4f::SbColor4f (const SbVec4f & v)"

      Construct and initialize an SbColor4f with the red, green, blue and alpha values given by the v vector. "SbColor4f::SbColor4f (const float *const rgba)"

      Construct and initialize an SbColor4f with the red, green, blue and alpha taken from given rgba array "SbColor4f::SbColor4f (const float r, const float g, const float b, const float a = 1.0f)"

      Construct and initialize an SbColor4f with the given red, green, blue and alpha values.
  • Member Function Documentation


      "void SbColor4f::setValue (const float r, const float g, const float b, const float a = 1.0f)"

      Set a new color. "void SbColor4f::setValue (const float col[4])"

      Set a new color. The elements of the array will be read in turned as red, green, blue and transparency. "const float * SbColor4f::getValue () const"

      Return pointer to array of 4 float values representing the red, green, blue and transparency values of the color. "void SbColor4f::getValue (float & r, float & g, float & b, float & a)"

      Return components of the stored color. "SbColor4f & SbColor4f::setRGB (const SbColor & col)"

      Sets the RGB components of the color. The alpha component is left unchanged. "void SbColor4f::getRGB (SbColor & color)"

      Returns the RGB components of this color. "SbColor4f & SbColor4f::setHSVValue (float hue, float saturation, float value, float alpha = 1.0f)"

      Set the color as a hue, saturation, value triplet. The hue component should be normalized to within [0, 1] before you call this method, where 0 is equal to 0? and 1 is equal to 360?.

      See also:
      getHSVValue().



      "SbColor4f & SbColor4f::setHSVValue (const float hsv[3], float a = 1.0f)"

      Set the color as a hue, saturation, value triplet. The hue component should be normalized to within [0, 1] before you call this method, where 0 is equal to 0? and 1 is equal to 360?.

      See also:
      getHSVValue().



      "void SbColor4f::getHSVValue (float & h, float & s, float & v) const"

      Return the color as a hue, saturation, value triplet. Alpha component is ignored.

      See also:
      setHSVValue().



      "void SbColor4f::getHSVValue (float hsv[3]) const"

      Return the color as a hue, saturation, value triplet. Alpha component is ignored.

      See also:
      setHSVValue().



      "SbColor4f & SbColor4f::setPackedValue (const uint32_t rgba)"

      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.

      See also:
      getPackedValue().



      "uint32_t SbColor4f::getPackedValue () const"

      Return color as a 32 bit packed integer in the form 0xRRGGBBAA.

      See also:
      setPackedValue().



      "float SbColor4f::operator[] (const int idx) const"

      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. "float & SbColor4f::operator[] (const int idx)"

      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. "SbColor4f & SbColor4f::operator *= (const float d)"

      Multiplies the RGB components by d. The alpha component is left unchanged. "SbColor4f & SbColor4f::operator/= (const float d)"

      Divides the RGB components by d. The alpha component is left unchanged. "SbColor4f & SbColor4f::operator+= (const SbColor4f & c)"

      Adds the RGB components. Alpha is ignored. "SbColor4f & SbColor4f::operator-= (const SbColor4f & c)"

      Subtracts the RGB components. Alpha is ignored.
  • Friends And Related Function Documentation


      "SbColor4f operator * (const SbColor4f & c, const float d) [friend]"

      Multiplies the RGB components by d. Alpha is left unchanged. "SbColor4f operator * (const float d, const SbColor4f & c) [friend]"

      Multiplies the RGB components by d. Alpha is left unchanged. "SbColor4f operator/ (const SbColor4f & c, const float d) [friend]"

      Divides the RGB components by d. Alpha is left unchanged. "SbColor4f operator+ (const SbColor4f & v1, const SbColor4f & v2) [friend]"

      Adds the RGB components of the two colors. Alpha is taken from the first color (v1). "SbColor4f operator- (const SbColor4f & v1, const SbColor4f & v2) [friend]"

      Subtracts the RGB components of the two colors. Alpha is taken from the first color (v1). "int operator== (const SbColor4f & v1, const SbColor4f & v2) [friend]"

      Check if two colors are equal. Returns 1 if equal, 0 if unequal. "int operator!= (const SbColor4f & v1, const SbColor4f & v2) [friend]"

      Check if two colors are unequal. Returns 0 if equal, 1 if unequal.
  • Author


      Generated automatically by Doxygen for Coin from the source code.
Current Users: 29 © 1999-2006 Linux.com.hk PenguinSoft
All trademarks and copyrights on this page are owned by their respective companies. Linux is a trademark of Linus Torvalds.