#include <UT_Color.h>
Public Member Functions | |
| UT_Color () | |
| UT_Color (UT_ColorType t) | |
| UT_Color (UT_ColorType t, fpreal x, fpreal y, fpreal z) | |
| UT_Color (const UT_Color &c) | |
| UT_Color (const char *colorname) | |
| virtual | ~UT_Color () |
| UT_ColorType | getType () const |
| void | getValue (float &x, float &y, float &z) const |
| void | getValue (fpreal64 &x, fpreal64 &y, fpreal64 &z) const |
| virtual void | getRGB (float *r, float *g, float *b) const |
| virtual void | getHSV (float *h, float *s, float *v) const |
| virtual void | getHSL (float *h, float *s, float *l) const |
| virtual void | getXYZ (float *x, float *y, float *z) const |
| virtual void | getLAB (float *l, float *a, float *b) const |
| void | getColor (UT_Color &c) const |
| fpreal | luminance () const |
| fpreal | relativeLuminance () const |
| void | setType (UT_ColorType t) |
| void | setValue (fpreal x, fpreal y, fpreal z) |
| virtual void | setRGB (fpreal r, fpreal g, fpreal b) |
| virtual void | setHSV (fpreal h, fpreal s, fpreal v) |
| virtual void | setHSL (fpreal h, fpreal s, fpreal l) |
| virtual void | setXYZ (fpreal x, fpreal y, fpreal z) |
| virtual void | setLAB (fpreal l, fpreal a, fpreal b) |
| virtual void | setLABluminance (fpreal l) |
| virtual void | setColorByName (const char *colorname) |
| void | clampToLegal () |
| void | ghost (fpreal gfactor=0.75f) |
| void | operator= (const UT_Color &c) |
| int | operator== (const UT_Color &color) const |
| uint32 | hash () const |
| void | brighten (fpreal amount) |
| void | tintRGB (const UT_Color &clr) |
| void | addHSV (const UT_Color &clr) |
| void | addRGB (const UT_Color &clr) |
| void | subRGB (const UT_Color &clr) |
| void | blendRGB (const UT_Color &clr, fpreal bias=0.5) |
| int | save (ostream &os, int binary) const |
| bool | load (UT_IStream &is) |
| const char * | className () const |
Static Public Member Functions | |
| static void | getRampColor (UT_ColorRamp ramp, fpreal val, float *r, float *g, float *b) |
| Computes a ramp colour from the predefined ramp enums. | |
| static void | getUniqueColor (int64 idx, float *r, float *g, float *b) |
| static const UT_Color & | getConstantColor (int i) |
| static void | getRandomContrastingColor (const UT_Vector3 *contrast_to, unsigned color_index, UT_Vector3 &color) |
Protected Member Functions | |
| void | convertToType (UT_ColorType type) |
| void | convertToHSL () |
| void | convertToHSV () |
| void | convertToRGB () |
| void | convertToXYZ () |
| void | convertToLAB () |
| void | getRGBConvert (float *r, float *g, float *b) const |
Static Protected Member Functions | |
| static void | assignRandomLuminance (UT_Vector3 &color) |
Protected Attributes | |
| UT_ColorType | type |
| float | u |
| float | v |
| float | w |
Friends | |
| UT_API ostream & | operator<< (ostream &os, const UT_Color &color) |
Definition at line 62 of file UT_Color.h.
| UT_Color::UT_Color | ( | ) |
| UT_Color::UT_Color | ( | UT_ColorType | t | ) |
| UT_Color::UT_Color | ( | UT_ColorType | t, | |
| fpreal | x, | |||
| fpreal | y, | |||
| fpreal | z | |||
| ) |
| UT_Color::UT_Color | ( | const UT_Color & | c | ) |
| UT_Color::UT_Color | ( | const char * | colorname | ) |
| virtual UT_Color::~UT_Color | ( | ) | [virtual] |
| void UT_Color::addHSV | ( | const UT_Color & | clr | ) |
| void UT_Color::addRGB | ( | const UT_Color & | clr | ) |
| static void UT_Color::assignRandomLuminance | ( | UT_Vector3 & | color | ) | [static, protected] |
| void UT_Color::brighten | ( | fpreal | amount | ) |
| void UT_Color::clampToLegal | ( | ) |
| const char* UT_Color::className | ( | ) | const |
| void UT_Color::convertToHSL | ( | ) | [protected] |
| void UT_Color::convertToHSV | ( | ) | [protected] |
| void UT_Color::convertToLAB | ( | ) | [protected] |
| void UT_Color::convertToRGB | ( | ) | [protected] |
| void UT_Color::convertToType | ( | UT_ColorType | type | ) | [protected] |
| void UT_Color::convertToXYZ | ( | ) | [protected] |
| void UT_Color::getColor | ( | UT_Color & | c | ) | const [inline] |
Definition at line 89 of file UT_Color.h.
| static const UT_Color& UT_Color::getConstantColor | ( | int | i | ) | [static] |
| virtual void UT_Color::getHSL | ( | float * | h, | |
| float * | s, | |||
| float * | l | |||
| ) | const [virtual] |
| virtual void UT_Color::getHSV | ( | float * | h, | |
| float * | s, | |||
| float * | v | |||
| ) | const [virtual] |
| virtual void UT_Color::getLAB | ( | float * | l, | |
| float * | a, | |||
| float * | b | |||
| ) | const [virtual] |
| static void UT_Color::getRampColor | ( | UT_ColorRamp | ramp, | |
| fpreal | val, | |||
| float * | r, | |||
| float * | g, | |||
| float * | b | |||
| ) | [static] |
Computes a ramp colour from the predefined ramp enums.
| static void UT_Color::getRandomContrastingColor | ( | const UT_Vector3 * | contrast_to, | |
| unsigned | color_index, | |||
| UT_Vector3 & | color | |||
| ) | [static] |
Obtain a random color that is contrasting to the specified other color. If null is passed for other color, a random color is returned.
| virtual void UT_Color::getRGB | ( | float * | r, | |
| float * | g, | |||
| float * | b | |||
| ) | const [inline, virtual] |
| void UT_Color::getRGBConvert | ( | float * | r, | |
| float * | g, | |||
| float * | b | |||
| ) | const [protected] |
| UT_ColorType UT_Color::getType | ( | void | ) | const [inline] |
Definition at line 72 of file UT_Color.h.
| static void UT_Color::getUniqueColor | ( | int64 | idx, | |
| float * | r, | |||
| float * | g, | |||
| float * | b | |||
| ) | [static] |
A mapping from integers to colours that tries to ensure that the chosen colours are well separated and aesthetically pleasing.
Definition at line 76 of file UT_Color.h.
| void UT_Color::getValue | ( | float & | x, | |
| float & | y, | |||
| float & | z | |||
| ) | const [inline] |
Definition at line 74 of file UT_Color.h.
| virtual void UT_Color::getXYZ | ( | float * | x, | |
| float * | y, | |||
| float * | z | |||
| ) | const [virtual] |
| void UT_Color::ghost | ( | fpreal | gfactor = 0.75f |
) |
| uint32 UT_Color::hash | ( | ) | const |
| bool UT_Color::load | ( | UT_IStream & | is | ) |
| fpreal UT_Color::luminance | ( | ) | const |
luminance() actually returns "luma", an approximation of luminance derived from the gamma corrected rgb values. So if you have linear rgb values and call this function, you will get the wrong result.
| void UT_Color::operator= | ( | const UT_Color & | c | ) |
| int UT_Color::operator== | ( | const UT_Color & | color | ) | const |
| fpreal UT_Color::relativeLuminance | ( | ) | const |
relativeLuminance() returns relative luminance [0,1] assuming the color is in linear RGB.
| int UT_Color::save | ( | ostream & | os, | |
| int | binary | |||
| ) | const |
| virtual void UT_Color::setColorByName | ( | const char * | colorname | ) | [virtual] |
| virtual void UT_Color::setLABluminance | ( | fpreal | l | ) | [virtual] |
| void UT_Color::setType | ( | UT_ColorType | t | ) |
Definition at line 101 of file UT_Color.h.
| void UT_Color::subRGB | ( | const UT_Color & | clr | ) |
| void UT_Color::tintRGB | ( | const UT_Color & | clr | ) |
| UT_API ostream& operator<< | ( | ostream & | os, | |
| const UT_Color & | color | |||
| ) | [friend] |
UT_ColorType UT_Color::type [protected] |
Definition at line 163 of file UT_Color.h.
float UT_Color::u [protected] |
Definition at line 164 of file UT_Color.h.
float UT_Color::v [protected] |
Definition at line 165 of file UT_Color.h.
float UT_Color::w [protected] |
Definition at line 166 of file UT_Color.h.
1.5.9