Support Forum G3D Web Page |
Do not subclass– this implementation makes assumptions about the memory layout.
More...
Public Member Functions | |
Color3 () | |
Initializes to all zero. More... | |
Color3 (DoNotInitialize dni) | |
Color3 (const Any &any) | |
Color3 (class BinaryInput &bi) | |
Color3 (float r, float g, float b) | |
Color3 (float v) | |
Initializes all channels to v. More... | |
Color3 (const class Vector3 &v) | |
Color3 (const float value[3]) | |
Color3 (const Color3 &other) | |
Initialize from another color. More... | |
Color3 (const class Color3unorm8 &other) | |
float | average () const |
Color3 | bgr () const |
Color3 | clamp (float low, float high) 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. More... | |
Color3 | min (const Color3 &other) const |
float | min () const |
Smallest element. More... | |
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/ (const Color3 &rkVector) const |
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. More... | |
Color3 | RGBTosRGB () const |
Converts an RGB color to sRGB. More... | |
Color3 | scaleSaturation (float factor) const |
Scales "saturation". More... | |
void | serialize (class BinaryOutput &bo) const |
float | squaredLength () const |
Color3 | sRGBToRGB () const |
Converts a sRGB color to RGB. More... | |
float | sum () const |
Any | toAny () const |
Converts the Color3 to an Any. More... | |
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. More... | |
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. More... | |
static Color3 | fromASRGB (uint32) |
Initialize from an HTML-style color (e.g. More... | |
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. More... | |
static Color3 | fromWavelengthNanometers (float lambda) |
A radiance value that will look approximately like the stimulus based on the wavelength of light in nanometers. More... | |
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. More... | |
static const Color3 & | nan () |
static Color3 | neonGradient (float t) |
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. More... | |
static const Color3 & | purple () |
static Color3 | rainbowColorMap (float hue) |
Returns colors with maximum saturation and value. More... | |
static Color3 | random () |
Random unit vector. More... | |
static const Color3 & | red () |
static Vector3 | toHSV (const Color3 &_rgb) |
static const Color3 & | wheelRandom () |
Returns one of the color wheel colors (e.g. More... | |
static const Color3 & | white () |
static const Color3 & | yellow () |
static const Color3 & | zero () |
Public Attributes | |
float | b |
float | g |
float | r |
Channel value. More... | |
Do not subclass– this implementation makes assumptions about the memory layout.
|
inline |
Initializes to all zero.
Referenced by bgr(), clamp(), cross(), max(), min(), neonGradient(), operator*(), operator+(), operator-(), operator/(), and pow().
|
inline |
|
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 |
|
inline |
|
static |
void G3D::Color3::deserialize | ( | class BinaryInput & | bi | ) |
|
inline |
Referenced by unitCross().
|
inline |
Initialize from an HTML-style color (e.g.
0xFF0000 == RED)
Initialize from an HTML-style color (e.g.
0xFF0000 == RED) by converting from sRGB to RGB. The alpha channel is linear.
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.
|
static |
A radiance value that will look approximately like the stimulus based on the wavelength of light in nanometers.
Remember to convert to sRGB if displaying directly.
|
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.
|
static |
|
inlinestatic |
|
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.
Color3 G3D::Color3::RGBTosRGB | ( | ) | const |
Converts an RGB color to sRGB.
Color3 G3D::Color3::scaleSaturation | ( | float | factor | ) | const |
Scales "saturation".
Technically, this should be applied to only sRGB color space values.
void G3D::Color3::serialize | ( | class BinaryOutput & | bo | ) | const |
Color3 G3D::Color3::sRGBToRGB | ( | ) | const |
Converts a sRGB color to RGB.
|
inline |
Referenced by average().
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 bgr(), clamp(), Color3(), G3D::Color4::Color4(), cross(), direction(), dot(), isOne(), isZero(), length(), G3D::log(), max(), min(), nonZero(), operator!=(), operator*(), G3D::operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator=(), operator==(), pow(), G3D::UniversalBSDF::schlickFresnel(), squaredLength(), sum(), and unitCross().
float G3D::Color3::g |
Referenced by bgr(), clamp(), Color3(), G3D::Color4::Color4(), cross(), direction(), dot(), isOne(), isZero(), length(), G3D::log(), max(), min(), nonZero(), operator!=(), operator*(), G3D::operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator=(), operator==(), pow(), G3D::UniversalBSDF::schlickFresnel(), squaredLength(), sum(), and unitCross().
float G3D::Color3::r |
Channel value.
Referenced by bgr(), clamp(), Color3(), G3D::Color4::Color4(), cross(), direction(), dot(), isOne(), isZero(), length(), G3D::log(), max(), min(), nonZero(), operator!=(), operator*(), G3D::operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator=(), operator==(), pow(), G3D::UniversalBSDF::schlickFresnel(), squaredLength(), sum(), and unitCross().