'\"! tbl | mmdoc '\"macro stdmacro .ie n \{\ . ds Cr \fB . ds Cb \fB .\} .el \{\ . ds Cr \f7 . ds Cb \f8 .\} .TH SbColor(3IV) .SH NAME SbColor \(em color vector class .SH INHERITS FROM SbVec3f .SH SYNOPSIS .ps -1 \*(Cr#include .sp .in 1i \f1Methods from class SbColor: .in 0.5i .sp .ta 20m .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Cr .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbSbColor\*(Cr(const SbVec3f vec3f) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Cr .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbSbColor\*(Cr(const float rgb[3]) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Cr .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbSbColor\*(Cr(float r, float g, float b) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbColor & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetHSVValue\*(Cr(float h, float s, float v) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbColor & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetHSVValue\*(Cr(const float hsv[3]) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetHSVValue\*(Cr(float &h, float &s, float &v) const .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetHSVValue\*(Cr(float hsv[3]) const .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbColor & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetPackedValue\*(Cr(uint32_t rgba, float& transparency) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Cruint32_t .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetPackedValue\*(Cr(float transparency = 0.0) const .sp .in 1i \f1Methods from class SbVec3f: .in 0.5i .sp .ta 20m .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec3f .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbcross\*(Cr(const SbVec3f &v) const .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crfloat .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbdot\*(Cr(const SbVec3f &v) const .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbequals\*(Cr(const SbVec3f v, float tolerance) const .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec3f .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetClosestAxis\*(Cr() const .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crconst float * .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetValue\*(Cr() const .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetValue\*(Cr(float &x, float &y, float &z) const .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crfloat .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cblength\*(Cr() const .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbnegate\*(Cr() .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crfloat .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbnormalize\*(Cr() .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec3f & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetValue\*(Cr(const float v[3]) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec3f & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetValue\*(Cr(float x, float y, float z) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec3f & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetValue\*(Cr(const SbVec3f &barycentic, const SbVec3f &v0, const SbVec3f &v1, const SbVec3f &v2) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crfloat & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator [\|]\*(Cr(int i) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crconst float & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator [\|]\*(Cr(int i) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec3f & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator *=\*(Cr(float d) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec3f & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator /=\*(Cr(float d) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec3f & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator +=\*(Cr(const SbVec3f &u) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec3f & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator -=\*(Cr(const SbVec3f &u) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec3f .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator -\*(Cr() const .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec3f .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator *\*(Cr(const SbVec3f &v, float d) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec3f .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator *\*(Cr(float d, const SbVec3f &v) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec3f .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator /\*(Cr(const SbVec3f &v, float d) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec3f .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator +\*(Cr(const SbVec3f &v1, const SbVec3f &v2) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbVec3f .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator -\*(Cr(const SbVec3f &v1, const SbVec3f &v2) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crint .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator ==\*(Cr(const SbVec3f &v1, const SbVec3f &v2) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crint .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cboperator !=\*(Cr(const SbVec3f &v1, const SbVec3f &v2) .sp .SH DESCRIPTION This class is used to represent an RGB color. Each component of the vector is a floating-point number between 0.0 and 1.0. There are routines to convert back and forth between RGB and HSV. .SH METHODS .ta 20m .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Cr .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbSbColor\*(Cr(const SbVec3f vec3f) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Cr .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbSbColor\*(Cr(const float rgb[3]) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Cr .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbSbColor\*(Cr(float r, float g, float b) .br .in 1i \f1Constructors for color vector. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbColor & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetHSVValue\*(Cr(float h, float s, float v) .br .in 1i \f1Sets value of color vector from 3 HSV (Hue, Saturation, and Value) components. Value is the same as brightness of the color. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbColor & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetHSVValue\*(Cr(const float hsv[3]) .br .in 1i \f1Sets value of color vector from array of 3 HSV components .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetHSVValue\*(Cr(float &h, float &s, float &v) const .br .in 1i \f1Returns 3 individual HSV components .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetHSVValue\*(Cr(float hsv[3]) const .br .in 1i \f1Returns an array of 3 HSV components .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbColor & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetPackedValue\*(Cr(uint32_t rgba, float& transparency) .br .in 1i \f1Sets value of color vector from an RGBA packed color value. The packed color format expressed in hexadecimal is 0xrrggbbaa, where .nf .in 1.5i rr is the red value gg is the green value bb is the blue value aa is the alpha value .fi .in 1i RGBA component values range from 0 to 0xFF (255). The returned transparency \&value is a floating point value between 0.0 (opaque) and 1.0 (completely transparent). It is derived from the alpha component of the RGBA color. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Cruint32_t .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetPackedValue\*(Cr(float transparency = 0.0) const .br .in 1i \f1Returns an RGBA packed color value, derived from the color vector and the passed transparency value. The alpha component is set to (1.0 - transparency) * 255, resulting in a hex value between 0 and 0xFF. \&If transparency not specified, alpha is set to 0xFF (opaque). .sp .in 0.5i