HDK
|
#include <UT_Color.h>
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. More... | |
static const char * | getRampColorName (UT_ColorRamp ramp) |
Return the name of the ramp colour. More... | |
static UT_Ramp * | buildRamp (UT_ColorRamp ramp) |
Builds a UT_Ramp to correspond to the given internal ramp. More... | |
static UT_Ramp * | buildMonoRamp (UT_MonoRamp ramp) |
static void | getUniqueColor (int64 idx, float *r, float *g, float *b) |
static const UT_Color & | getConstantColor (int i) |
static UT_Color | getColorTemperature (fpreal temp) |
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 | convertToTMI () |
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 std::ostream & | operator<< (std::ostream &os, const UT_Color &color) |
Definition at line 85 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 | ||
) |
|
explicit |
UT_Color::~UT_Color | ( | ) |
|
staticprotected |
|
static |
|
static |
Builds a UT_Ramp to correspond to the given internal ramp.
void UT_Color::clampToLegal | ( | ) |
|
inline |
Definition at line 182 of file UT_Color.h.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Definition at line 113 of file UT_Color.h.
void UT_Color::getHSL | ( | float * | h, |
float * | s, | ||
float * | l | ||
) | const |
void UT_Color::getHSV | ( | float * | h, |
float * | s, | ||
float * | v | ||
) | const |
void UT_Color::getLAB | ( | float * | l, |
float * | a, | ||
float * | b | ||
) | const |
|
static |
Computes a ramp colour from the predefined ramp enums.
|
static |
Return the name of the ramp colour.
|
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.
|
inline |
Definition at line 101 of file UT_Color.h.
|
protected |
void UT_Color::getTMI | ( | float * | t, |
float * | m, | ||
float * | i | ||
) | const |
|
inline |
Definition at line 95 of file UT_Color.h.
A mapping from integers to colours that tries to ensure that the chosen colours are well separated and aesthetically pleasing.
|
inline |
Definition at line 97 of file UT_Color.h.
Definition at line 99 of file UT_Color.h.
void UT_Color::getXYZ | ( | float * | x, |
float * | y, | ||
float * | z | ||
) | const |
uint32 UT_Color::hash | ( | ) | const |
bool UT_Color::load | ( | UT_IStream & | is | ) |
bool UT_Color::load | ( | UT_JSONParser & | p | ) |
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.
|
inline |
Definition at line 149 of file UT_Color.h.
fpreal UT_Color::relativeLuminance | ( | ) | const |
relativeLuminance() returns relative luminance [0,1] assuming the color is in linear RGB.
UT_Vector3F UT_Color::rgb | ( | ) | const |
bool UT_Color::save | ( | UT_JSONWriter & | w | ) | const |
bool UT_Color::save | ( | UT_JSONValue & | v | ) | const |
void UT_Color::saveMinimalAsText | ( | std::ostream & | os | ) | const |
void UT_Color::setRGB | ( | UT_Vector3F | c | ) |
void UT_Color::setRGB | ( | UT_Vector3D | c | ) |
void UT_Color::setType | ( | UT_ColorType | t | ) |
Definition at line 129 of file UT_Color.h.
|
protected |
Definition at line 222 of file UT_Color.h.
|
protected |
Definition at line 223 of file UT_Color.h.
|
protected |
Definition at line 224 of file UT_Color.h.
|
protected |
Definition at line 225 of file UT_Color.h.