.TH "SbColor" 3 "Tue Dec 26 2023 17:59:22" "Version 4.0.2" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SbColor \- The \fBSbColor\fP class contains the red, green and blue components which make up a color value\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBSbVec3f\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBSbColor\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBSbColor\fP (\fBconst\fP \fBSbVec3f\fP &v)" .br .ti -1c .RI "\fBSbColor\fP (\fBconst\fP float *\fBconst\fP rgb)" .br .ti -1c .RI "\fBSbColor\fP (\fBconst\fP float r, \fBconst\fP float g, \fBconst\fP float b)" .br .ti -1c .RI "\fBSbColor\fP & \fBsetHSVValue\fP (float h, float s, float v)" .br .ti -1c .RI "\fBSbColor\fP & \fBsetHSVValue\fP (\fBconst\fP float \fBhsv\fP[3])" .br .ti -1c .RI "\fBvoid\fP \fBgetHSVValue\fP (float &h, float &s, float &v) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBgetHSVValue\fP (float \fBhsv\fP[3]) \fBconst\fP" .br .ti -1c .RI "\fBSbColor\fP & \fBsetPackedValue\fP (\fBconst\fP uint32_t rgba, float &transparency)" .br .ti -1c .RI "uint32_t \fBgetPackedValue\fP (\fBconst\fP float transparency=0\&.0f) \fBconst\fP" .br .in -1c Public Member Functions inherited from \fBSbVec3f\fP .in +1c .ti -1c .RI "\fBSbVec3f\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBSbVec3f\fP (\fBconst\fP float v[3])" .br .ti -1c .RI "\fBSbVec3f\fP (float x, float y, float z)" .br .ti -1c .RI "\fBSbVec3f\fP (\fBconst\fP \fBSbVec3d\fP &v)" .br .ti -1c .RI "\fBSbVec3f\fP (\fBconst\fP \fBSbVec3b\fP &v)" .br .ti -1c .RI "\fBSbVec3f\fP (\fBconst\fP \fBSbVec3s\fP &v)" .br .ti -1c .RI "\fBSbVec3f\fP (\fBconst\fP \fBSbVec3i32\fP &v)" .br .ti -1c .RI "\fBSbVec3f\fP (\fBconst\fP \fBSbPlane\fP &\fBp0\fP, \fBconst\fP \fBSbPlane\fP &\fBp1\fP, \fBconst\fP \fBSbPlane\fP &\fBp2\fP)" .br .ti -1c .RI "\fBSbVec3f\fP & \fBsetValue\fP (\fBconst\fP float v[3])" .br .ti -1c .RI "\fBSbVec3f\fP & \fBsetValue\fP (float x, float y, float z)" .br .ti -1c .RI "\fBSbVec3f\fP & \fBsetValue\fP (\fBconst\fP \fBSbVec3f\fP &\fBbarycentric\fP, \fBconst\fP \fBSbVec3f\fP &\fBv0\fP, \fBconst\fP \fBSbVec3f\fP &\fBv1\fP, \fBconst\fP \fBSbVec3f\fP &\fBv2\fP)" .br .ti -1c .RI "\fBSbVec3f\fP & \fBsetValue\fP (\fBconst\fP \fBSbVec3d\fP &v)" .br .ti -1c .RI "\fBSbVec3f\fP & \fBsetValue\fP (\fBconst\fP \fBSbVec3b\fP &v)" .br .ti -1c .RI "\fBSbVec3f\fP & \fBsetValue\fP (\fBconst\fP \fBSbVec3s\fP &v)" .br .ti -1c .RI "\fBSbVec3f\fP & \fBsetValue\fP (\fBconst\fP \fBSbVec3i32\fP &v)" .br .ti -1c .RI "\fBconst\fP float * \fBgetValue\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBgetValue\fP (float &x, float &y, float &z) \fBconst\fP" .br .ti -1c .RI "float & \fBoperator[]\fP (int \fBi\fP)" .br .ti -1c .RI "\fBconst\fP float & \fBoperator[]\fP (int \fBi\fP) \fBconst\fP" .br .ti -1c .RI "SbBool \fBequals\fP (\fBconst\fP \fBSbVec3f\fP &v, float tolerance) \fBconst\fP" .br .ti -1c .RI "\fBSbVec3f\fP \fBcross\fP (\fBconst\fP \fBSbVec3f\fP &v) \fBconst\fP" .br .ti -1c .RI "float \fBdot\fP (\fBconst\fP \fBSbVec3f\fP &v) \fBconst\fP" .br .ti -1c .RI "\fBSbVec3f\fP \fBgetClosestAxis\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "float \fBlength\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "float \fBsqrLength\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "float \fBnormalize\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvoid\fP \fBnegate\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBSbVec3f\fP & \fBoperator*=\fP (float d)" .br .ti -1c .RI "\fBSbVec3f\fP & \fBoperator/=\fP (float d)" .br .ti -1c .RI "\fBSbVec3f\fP & \fBoperator+=\fP (\fBconst\fP \fBSbVec3f\fP &v)" .br .ti -1c .RI "\fBSbVec3f\fP & \fBoperator\-=\fP (\fBconst\fP \fBSbVec3f\fP &v)" .br .ti -1c .RI "\fBSbVec3f\fP \fBoperator\-\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBSbString\fP \fBtoString\fP () \fBconst\fP" .br .ti -1c .RI "SbBool \fBfromString\fP (\fBconst\fP \fBSbString\fP &str)" .br .ti -1c .RI "\fBvoid\fP \fBprint\fP (\fBFILE\fP *fp) \fBconst\fP" .br .in -1c .SS "Additional Inherited Members" Protected Attributes inherited from \fBSbVec3f\fP .in +1c .ti -1c .RI "float \fBvec\fP [3]" .br .in -1c Related Symbols inherited from \fBSbVec3f\fP .in +1c .ti -1c .RI "\fBSbVec3f\fP \fBoperator*\fP (\fBconst\fP \fBSbVec3f\fP &v, float d)" .br .ti -1c .RI "\fBSbVec3f\fP \fBoperator*\fP (float d, \fBconst\fP \fBSbVec3f\fP &v)" .br .ti -1c .RI "\fBSbVec3f\fP \fBoperator/\fP (\fBconst\fP \fBSbVec3f\fP &v, float d)" .br .ti -1c .RI "\fBSbVec3f\fP \fBoperator+\fP (\fBconst\fP \fBSbVec3f\fP &\fBv1\fP, \fBconst\fP \fBSbVec3f\fP &\fBv2\fP)" .br .ti -1c .RI "\fBSbVec3f\fP \fBoperator\-\fP (\fBconst\fP \fBSbVec3f\fP &\fBv1\fP, \fBconst\fP \fBSbVec3f\fP &\fBv2\fP)" .br .ti -1c .RI "int \fBoperator==\fP (\fBconst\fP \fBSbVec3f\fP &\fBv1\fP, \fBconst\fP \fBSbVec3f\fP &\fBv2\fP)" .br .ti -1c .RI "int \fBoperator!=\fP (\fBconst\fP \fBSbVec3f\fP &\fBv1\fP, \fBconst\fP \fBSbVec3f\fP &\fBv2\fP)" .br .in -1c .SH "Detailed Description" .PP The \fBSbColor\fP class contains the red, green and blue components which make up a color value\&. This class is used within other classes in Coin\&. It inherits the \fBSbVec3f\fP class, interpreting the 3 component vector as a vector in the RGB cube where the red, green and blue components corresponds to x, y and z respectively\&. .PP \fBSbColor\fP also adds a few extra methods for convenient handling of setting and getting color values as 32 bit packed values or as HSV values\&. .PP \fBSee also\fP .RS 4 \fBSbVec3f\fP, \fBSbColor4f\fP .RE .PP .SH "Constructor & Destructor Documentation" .PP .SS "SbColor::SbColor (\fBvoid\fP)" Default constructor\&. The color value will be uninitialized\&. .SS "SbColor::SbColor (\fBconst\fP \fBSbVec3f\fP & v)" Construct and initialize an \fBSbColor\fP with the red, green and blue values given by the \fCv\fP vector\&. .SS "SbColor::SbColor (\fBconst\fP float *\fBconst\fP rgb)" Construct and initialize an \fBSbColor\fP with the red, green and blue taken from given \fCrgb\fP array\&. .SS "SbColor::SbColor (\fBconst\fP float r, \fBconst\fP float g, \fBconst\fP float b)" Construct and initialize an \fBSbColor\fP with the given red, green and blue values\&. .SH "Member Function Documentation" .PP .SS "\fBSbColor\fP & SbColor::setHSVValue (float hue, float saturation, float value)" Set the color as a \fChue\fP, \fCsaturation\fP, \fCvalue\fP triplet\&. The hue component should be normalized to within [0, 1] before you call this method, where a value of 0 corresponds to 0 degrees and a value of 1 corresponds to 360 degrees\&. .PP \fBSee also\fP .RS 4 \fBgetHSVValue()\fP\&. .RE .PP .SS "\fBSbColor\fP & SbColor::setHSVValue (\fBconst\fP float hsv[3])" Set the color as a \fChue\fP, \fCsaturation\fP, \fCvalue\fP triplet\&. The hue component should be normalized to within [0, 1] before you call this method, where a value of 0 corresponds to 0 degrees and a value of 1 corresponds to 360 degrees\&. .PP \fBSee also\fP .RS 4 \fBgetHSVValue()\fP\&. .RE .PP .SS "\fBvoid\fP SbColor::getHSVValue (float & h, float & s, float & v) const" Return the color as a \fChue\fP, \fCsaturation\fP, \fCvalue\fP triplet\&. .PP \fBSee also\fP .RS 4 \fBsetHSVValue()\fP\&. .RE .PP .SS "\fBvoid\fP SbColor::getHSVValue (float hsv[3]) const" Return the color as a \fChue\fP, \fCsaturation\fP, \fCvalue\fP triplet\&. .PP \fBSee also\fP .RS 4 \fBsetHSVValue()\fP\&. .RE .PP .SS "\fBSbColor\fP & SbColor::setPackedValue (\fBconst\fP 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\&. .PP The transparency value is not stored internally in \fBSbColor\fP, just converted to a transparency value in [0, 1] and returned in the \fCtransparency\fP field\&. A value of \fB1\&.0\fP means completely transparent and a value of \fB0\&.0\fP is completely opaque\&. .PP \fBSee also\fP .RS 4 \fBgetPackedValue()\fP\&. .RE .PP .SS "uint32_t SbColor::getPackedValue (\fBconst\fP float transparency = \fC0\&.0f\fP) 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 \fCtransparency\fP argument\&. .PP \fBSee also\fP .RS 4 \fBsetPackedValue()\fP\&. .RE .PP .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.