| Support Forum Library Source SourceForge Page G3D Web Page |
Do not subclass– this implementation makes assumptions about the memory layout. More...
Public Member Functions | |
| Color3 () | |
| Initializes to all zero. | |
| Color3 (const Any &any) | |
| Color3 (class BinaryInput &bi) | |
| Color3 (float r, float g, float b) | |
| Color3 (float v) | |
| Initializes all channels to v. | |
| Color3 (const class Vector3 &v) | |
| Color3 (const float value[3]) | |
| Color3 (const Color3 &other) | |
| Initialize from another color. | |
| Color3 (const class Color3unorm8 &other) | |
| float | average () const |
| Color3 | bgr () const |
| Color3 | cross (const Color3 &rkVector) const |
| void | deserialize (class BinaryInput &bi) |
| Color3 | direction () const |
| float | dot (const Color3 &rkVector) const |
| bool | fuzzyEq (const Color3 &other) const |
| bool | fuzzyNe (const Color3 &other) const |
| size_t | hashCode () const |
| bool | isFinite () const |
| bool | isOne () const |
| bool | isZero () const |
| float | length () const |
| Color3 | lerp (const Color3 &other, float a) const |
| Color3 | max (const Color3 &other) const |
| float | max () const |
| Largest element. | |
| Color3 | min (const Color3 &other) const |
| float | min () const |
| Smallest element. | |
| bool | nonZero () const |
| bool | operator!= (const Color3 &rkVector) const |
| Color3 | operator* (float s) const |
| Color3 | operator* (const Color3 &rkVector) const |
| Color3 & | operator*= (const Color3 &rkVector) |
| Color3 & | operator*= (float fScalar) |
| Color3 | operator+ (const Color3 &rkVector) const |
| Color3 & | operator+= (const Color3 &rkVector) |
| Color3 | operator- (const Color3 &rkVector) const |
| Color3 | operator- () const |
| Color3 & | operator-= (const Color3 &rkVector) |
| Color3 | operator/ (float fScalar) const |
| Color3 & | operator/= (float fScalar) |
| Color3 & | operator= (const Any &a) |
| Color3 & | operator= (const Color3 &rkVector) |
| bool | operator== (const Color3 &rkVector) const |
| const float & | operator[] (int i) const |
| float & | operator[] (int i) |
| Color3 | pow (const Color3 &other) const |
| Color3 | pow (float other) const |
| const Color3 & | rgb () const |
| Returns this color. | |
| void | serialize (class BinaryOutput &bo) const |
| float | squaredLength () const |
| float | sum () const |
| Any | toAny () const |
| Converts the Color3 to an Any. | |
| std::string | toString () const |
| Color3 | unitCross (const Color3 &rkVector) const |
| float | unitize (float fTolerance=1e-06) |
Static Public Member Functions | |
| static Color3 | ansiMap (uint32 i) |
| Generate colors according to the ANSI color set, mod 16. | |
| static const Color3 & | black () |
| static const Color3 & | blue () |
| static const Color3 & | brown () |
| static const Color3 & | cyan () |
| static Color3 | fromARGB (uint32) |
| Initialize from an HTML-style color (e.g. | |
| static Color3 | fromHSV (const Vector3 &_hsv) |
| Converts from HSV to RGB , note: toHSV(fromHSV(_hsv)) may not be _hsv, if it is at a grey point or black point. | |
| static const Color3 & | gray () |
| static const Color3 & | green () |
| static Color3 | jetColorMap (const float &val) |
| Duplicates the matlab jet colormap maps [0,1] –> (r,g,b) where blue is close to 0 and red is close to 1. | |
| static const Color3 & | one () |
| static const Color3 & | orange () |
| static Color3 | pastelMap (uint32 i) |
| Generate colors using a hash such that adjacent values are unlikely to have similar colors. | |
| static const Color3 & | purple () |
| static Color3 | rainbowColorMap (float hue) |
| Returns colors with maximum saturation and value. | |
| static Color3 | random () |
| Random unit vector. | |
| static const Color3 & | red () |
| static Vector3 | toHSV (const Color3 &_rgb) |
| static const Color3 & | wheelRandom () |
| Returns one of the color wheel colors (e.g. | |
| static const Color3 & | white () |
| static const Color3 & | yellow () |
| static const Color3 & | zero () |
Public Attributes | |
| float | b |
| float | g |
| float | r |
| Channel value. | |
Do not subclass– this implementation makes assumptions about the memory layout.
|
inline |
Initializes to all zero.
Referenced by bgr(), cross(), max(), min(), operator*(), operator+(), operator-(), and pow().
|
explicit |
| any | Must be in one of the following forms:
|
In the current implementation, G3D::Power3, G3D::Radiance3, and G3D::Irradiance3 are typedefs for Color3, so Color3 accepts "Power3" and "Radiance3" as a prefixes as well, e.g., Power3(1,0,0).
|
explicit |
|
inline |
|
inlineexplicit |
Initializes all channels to v.
|
explicit |
|
inlineexplicit |
|
inline |
Initialize from another color.
| G3D::Color3::Color3 | ( | const class Color3unorm8 & | other | ) |
Generate colors according to the ANSI color set, mod 16.
|
inline |
|
inline |
|
static |
|
static |
|
static |
|
static |
| void G3D::Color3::deserialize | ( | class BinaryInput & | bi | ) |
|
inline |
Referenced by unitCross().
|
inline |
Initialize from an HTML-style color (e.g.
0xFF0000 == RED)
Converts from HSV to RGB , note: toHSV(fromHSV(_hsv)) may not be _hsv, if it is at a grey point or black point.
The components of _hsv should lie in the unit interval.
|
inline |
|
inline |
|
static |
|
static |
| size_t G3D::Color3::hashCode | ( | ) | const |
Referenced by HashTrait< G3D::Color3 >::hashCode().
| bool G3D::Color3::isFinite | ( | ) | const |
|
inline |
|
inline |
|
static |
Duplicates the matlab jet colormap maps [0,1] –> (r,g,b) where blue is close to 0 and red is close to 1.
|
inline |
Referenced by G3D::lerp().
Referenced by G3D::max().
|
inline |
Largest element.
Referenced by G3D::min().
|
inline |
Smallest element.
|
inline |
Referenced by G3D::UniversalSurfel::nonZeroFiniteScattering().
|
static |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| Color3& G3D::Color3::operator/= | ( | float | fScalar | ) |
|
inline |
|
inline |
|
inline |
|
static |
Generate colors using a hash such that adjacent values are unlikely to have similar colors.
Useful for rendering with stable but arbitrary colors, e.g., when debugging a mesh algorithm.
|
inline |
|
static |
|
static |
Returns colors with maximum saturation and value.
| hue | [0, 1] |
|
static |
|
inline |
Returns this color.
| void G3D::Color3::serialize | ( | class BinaryOutput & | bo | ) | const |
|
inline |
Referenced by average().
| std::string G3D::Color3::toString | ( | ) | const |
| float G3D::Color3::unitize | ( | float | fTolerance = 1e-06 | ) |
|
static |
Returns one of the color wheel colors (e.g.
RED, GREEN, CYAN). Does not include white, black, or gray.
|
static |
|
static |
|
static |
Referenced by G3D::Surfel::emittedRadiance().
| float G3D::Color3::b |
Referenced by Color3(), G3D::Color4::Color4(), G3D::UniversalBSDF::computeF(), cross(), direction(), dot(), G3D::log(), max(), min(), operator!=(), operator*(), G3D::operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator=(), operator==(), pow(), Load3DS::read3DSColor(), squaredLength(), sum(), and unitCross().
| float G3D::Color3::g |
Referenced by Color3(), G3D::Color4::Color4(), G3D::UniversalBSDF::computeF(), cross(), dot(), G3D::log(), max(), min(), operator!=(), operator*(), G3D::operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator=(), operator==(), pow(), Load3DS::read3DSColor(), and unitCross().
| float G3D::Color3::r |
Channel value.
Referenced by Color3(), G3D::Color4::Color4(), G3D::UniversalBSDF::computeF(), cross(), dot(), G3D::log(), max(), min(), operator!=(), operator*(), G3D::operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator=(), operator==(), pow(), Load3DS::read3DSColor(), and unitCross().
1.8.2