SbColor4f(3)

πŸ“¦ version 2.5.0, in fedora 43, fedora 44

SbColor4f(3) β€” Library Functions Manual, bestie. This is the whole page, every crumb of it, no cap. πŸ’–


🌸 NAME 🌸

SbColor4f β€” okay so the SbColor4f class contains the red, green, blue and alpha components which make up a color value. That's it, that's the whole vibe. ✨


πŸŽ€ SYNOPSIS πŸŽ€

#include <Inventor/SbColor4f.h>

πŸ’… Public Member Functions πŸ’…

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 🫢

SbColor4f operator* (const SbColor4f &c, const float d)
SbColor4f operator* (const float d, const SbColor4f &c)
SbColor4f operator/ (const SbColor4f &c, const float d)
SbColor4f operator+ (const SbColor4f &v1, const SbColor4f &v2)
SbColor4f operator- (const SbColor4f &v1, const SbColor4f &v2)
int operator== (const SbColor4f &v1, const SbColor4f &v2)
int operator!= (const SbColor4f &v1, const SbColor4f &v2)

πŸ¦‹ Detailed Description πŸ¦‹

The SbColor4f class contains the red, green, blue and alpha components which make up a color value. Periodt.

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. So it's giving "point in a cube but make it see-through." 🌈

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. Stay in your lane, numbers. πŸ‘‘

SbColor4f contains methods for convenient handling of setting and getting color values as 32 bit packed values or as HSV values. Versatile queen. πŸ’…

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. Fr fr, it's an API extension and using it will lowkey break Open Inventor compatibility.

See also

SbColor β€” go say hi to their cousin. πŸ’œ


✨ Constructor & Destructor Documentation ✨

SbColor4f::SbColor4f (void )

Default constructor. The color value will be uninitialized until explicitly set. Not me leaving it blank on purpose, bestie β€” you gotta set it yourself. πŸ™ˆ

Referenced by

operator!=, operator*, operator*, operator+, operator+=(), operator-, operator-=(), operator/, and operator==.

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. Borrowing the RGB from rgb and the transparency from alpha β€” collab. 🀝

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. All four, hand-delivered. 🎁


πŸ’– Member Function Documentation πŸ’–

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

Set a new color. Slay.

Referenced by

setPackedValue().

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. It's giving "here's the receipts, all four of them." 🧾

Referenced by

SoTextureCombine::doAction(), SoDirectionalLight::GLRender(), SoPointLight::GLRender(), SoSpotLight::GLRender(), SoVRMLDirectionalLight::GLRender(), SoVRMLPointLight::GLRender(), and SoVRMLSpotLight::GLRender().

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. Alpha said "not my business today" and stayed exactly as it was. πŸ’…

Referenced by

SoDirectionalLight::GLRender(), SoPointLight::GLRender(), SoSpotLight::GLRender(), SoVRMLDirectionalLight::GLRender(), SoVRMLPointLight::GLRender(), and SoVRMLSpotLight::GLRender().

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°. Normalize it before you call, bestie, I'm not doing it for you. 😭

See also

getHSVValue().

References

SoDebugError::postWarning(), and SbColor::setHSVValue().

Referenced by

SoMFColorRGBA::set1HSVValue(), setHSVValue(), and SoMFColorRGBA::setHSVValue().

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Β°. Same deal, same [0, 1], same degrees. πŸ”₯

See also

getHSVValue().

References

setHSVValue().

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

Return the color as a hue, saturation, value triplet. Alpha component is ignored. Alpha is in its "I'm not here" era. πŸ’€

See also

setHSVValue().

References

SbColor::getHSVValue().

Referenced by

getHSVValue().

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

Return the color as a hue, saturation, value triplet. Alpha component is ignored. Again: alpha, ignored, not invited to the function. πŸ™ˆ

See also

setHSVValue().

References

getHSVValue().

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. Red first, always, main character energy. πŸ‘‘

See also

getPackedValue().

References

setValue().

uint32_t SbColor4f::getPackedValue () const

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

See also

setPackedValue().

Referenced by

SoVRMLPointSet::GLRender().

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. Index the rainbow. 🌈

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. Same mapping, but this one hands you a reference so you can write to it. ✨

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. Yeah, alpha got left on read again. 😭

References

SbColor4f().

SbColor4f & SbColor4f::operator-= (const SbColor4f & c)

Subtracts the RGB components. Alpha is ignored.

References

SbColor4f().


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

Multiplies the RGB components by d. Alpha is left unchanged.

References

SbColor4f().

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

Multiplies the RGB components by d. Alpha is left unchanged.

References

SbColor4f().

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

Divides the RGB components by d. Alpha is left unchanged.

References

SbColor4f().

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). The first one wins, always. πŸ‘‘

References

SbColor4f().

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). First color's alpha, again, no discussion. πŸ’…

References

SbColor4f().

int operator== (const SbColor4f & v1, const SbColor4f & v2) [friend]

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

References

SbColor4f().

int operator!= (const SbColor4f & v1, const SbColor4f & v2) [friend]

Check if two colors are unequal. Returns 0 if equal, 1 if unequal. Note it's the exact opposite of ==, iconic behaviour honestly. 🌟

References

SbColor4f().


πŸ’œ Author πŸ’œ

Generated automatically by Doxygen for Coin from the source code. Not a human, just a very dedicated robot. πŸ€–


okay and that's the whole page!! this was Coin, Version 2.5.0, and the page you just read is SbColor4f(3) πŸ’–βœ¨πŸŽ€ stay colorful, bestie, and remember: set your alpha before you ship 🫢🌸

πŸ“¦ where this page comes from