SbColor(3)
π SbColor π
okay bestie, welcome to the manual page for SbColor β that's the Library Functions Manual one, yes, we're doing this π
πΈ NAME πΈ
SbColor β the SbColor class contains the red, green and blue components which make up a color value.
like. it IS the color. that's the whole gig. π¨
β¨ SYNOPSIS β¨
#include <Inventor/SbColor.h>
Inherits SbVec3f.
π«Ά Public Member Functions
SbColor (void)
SbColor (const SbVec3f &v)
SbColor (const float *const rgb)
SbColor (const float r, const float g, const float b)
SbColor & setHSVValue (float h, float s, float v)
SbColor & setHSVValue (const float hsv[3])
void getHSVValue (float &h, float &s, float &v) const
void getHSVValue (float hsv[3]) const
SbColor & setPackedValue (const uint32_t rgba, float &transparency)
uint32_t getPackedValue (const float transparency=0.0f) const
π¦ Public Member Functions inherited from SbVec3f
no bc she's literally her mother's daughter, look at everything she picked up:
SbVec3f (void)
SbVec3f (const float v[3])
SbVec3f (const float x, const float y, const float z)
SbVec3f (const SbPlane &p0, const SbPlane &p1, const SbPlane &p2)
SbVec3f (const SbVec3d &v)
SbVec3f (const SbVec3b &v)
SbVec3f (const SbVec3s &v)
SbVec3f (const SbVec3i32 &v)
SbVec3f & setValue (const float v[3])
SbVec3f & setValue (const float x, const float y, const float z)
SbVec3f & setValue (const SbVec3f &barycentric, const SbVec3f &v0, const
SbVec3f &v1, const SbVec3f &v2)
SbVec3f & setValue (const SbVec3d &v)
SbVec3f & setValue (const SbVec3b &v)
SbVec3f & setValue (const SbVec3s &v)
SbVec3f & setValue (const SbVec3i32 &v)
SbVec3f cross (const SbVec3f &v) const
float dot (const SbVec3f &v) const
SbBool equals (const SbVec3f &v, const float tolerance) const
SbVec3f getClosestAxis (void) const
const float * getValue (void) const
void getValue (float &x, float &y, float &z) const
float length (void) const
float sqrLength () const
void negate (void)
float normalize (void)
float & operator[] (const int i)
const float & operator[] (const int i) const
SbVec3f & operator*= (const float d)
SbVec3f & operator/= (const float d)
SbVec3f & operator+= (const SbVec3f &u)
SbVec3f & operator-= (const SbVec3f &u)
SbVec3f operator- (void) const
void print (FILE *fp) const
π Detailed Description π
The SbColor class contains the red, green and blue components which make up a color value.
okay so the way this class works is that it's used inside other classes in Coin, periodt. It inherits the SbVec3f class, and it reads that 3 component vector as a vector in the RGB cube π§ β where the red, green and blue components correspond to x, y and z respectively. three floats, three channels, one cube, it's giving geometry but make it πaestheticπ.
SbColor also adds a few extra methods for convenient handling of setting and getting color values as 32 bit packed values or as HSV values. obsessed, honestly. π
See also
SbVec3f,SbColor4f
π Constructor & Destructor Documentation π
π SbColor::SbColor (void )
Default constructor. The color value will be uninitialized.
bestie. it's uninitialized. do NOT assume it's black, do NOT assume it's anything. it is β¨vibesβ¨ until you set it. π
References SbVec3f::SbVec3f().
π SbColor::SbColor (const SbVec3f & v)
Construct and initialize an SbColor with the red, green and blue values given by the v vector.
References SbVec3f::SbVec3f().
π SbColor::SbColor (const float *const rgb)
Construct and initialize an SbColor with the red, green and blue taken from given rgb array.
References SbVec3f::SbVec3f().
π SbColor::SbColor (const float r, const float g, const float b)
Construct and initialize an SbColor with the given red, green and blue values.
References SbVec3f::SbVec3f().
π₯ Member Function Documentation π₯
π SbColor & SbColor::setHSVValue (float hue, float saturation, float value)
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Β°.
normalize that hue first, bestie, or the math will simply not math. π
See also
getHSVValue().
References SoDebugError::postWarning(), and SbVec3f::setValue().
Referenced by SoMFColor::set1HSVValue(), SbColor4f::setHSVValue(), setHSVValue(), and SoMFColor::setHSVValue().
π SbColor & SbColor::setHSVValue (const float hsv[3])
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Β°.
same deal as above, just handing her an array this time π
See also
getHSVValue().
References setHSVValue().
π void SbColor::getHSVValue (float & h, float & s, float & v) const
Return the color as a hue, saturation, value triplet.
See also
setHSVValue().
Referenced by SbColor4f::getHSVValue(), and getHSVValue().
π void SbColor::getHSVValue (float hsv[3]) const
Return the color as a hue, saturation, value triplet.
See also
setHSVValue().
References getHSVValue().
π SbColor & SbColor::setPackedValue (const uint32_t rgba, float & transparency)
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.
The transparency value is not stored internally in SbColor, just converted to a transparency value in [0, 1] and returned in the transparency field. A value of 1.0 means completely transparent and a value of 0.0 is completely opaque.
so like, SbColor is not holding your alpha for you, she's just doing the conversion and handing it back. don't @ her. π
See also
getPackedValue().
References SbVec3f::setValue().
π uint32_t SbColor::getPackedValue (const float transparency = 0.0f) const
Return color as a 32 bit packed integer in the form 0xRRGGBBAA. The transparency part of the return value is taken from the supplied transparency argument.
See also
setPackedValue().
Referenced by SoVRMLIndexedLineSet::GLRender().
π Author π
Generated automatically by Doxygen for Coin from the source code.
and that's the whole page, bestie, you ate it up π«Άβ¨ this was SbColor(3) from Coin, Version 2.5.0 β go forth and color things, mwah π
ππ
π¦ where this page comes from
- fedora 43: Coin2-devel 2.5.0-52.fc43 Β· GPL-2.0-only
- fedora 43: Coin2-devel 2.5.0-52.fc43 Β· GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.fc44 Β· GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.fc44 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms