|
Represents a color in a specific color space. More...
#include <color.h>
Public Member Functions | |
GF_API | GfColor () |
The default constructor creates black, in the "lin_rec709" color space. | |
GF_API | GfColor (const GfColorSpace &colorSpace) |
Construct a black color in the given color space. | |
GF_API | GfColor (const GfVec3f &rgb, const GfColorSpace &colorSpace) |
Construct a color from an RGB tuple and color space. | |
GF_API | GfColor (const GfColor &color, const GfColorSpace &colorSpace) |
Construct a color by converting the source color into the specified color space. | |
GF_API void | SetFromPlanckianLocus (float kelvin, float luminance) |
Set the color from the Planckian locus (blackbody radiation) temperature in Kelvin, in the existing color space. | |
GfVec3f | GetRGB () const |
Get the RGB tuple. | |
GfColorSpace | GetColorSpace () const |
Get the color space. | |
bool | operator== (const GfColor &rh) const |
Equality operator. | |
bool | operator!= (const GfColor &rh) const |
Inequality operator. | |
Protected Member Functions | |
GF_API GfVec2f | _GetChromaticity () const |
GF_API void | _SetFromChromaticity (const GfVec2f &xy) |
Protected Attributes | |
GfColorSpace | _colorSpace |
The color space. | |
GfVec3f | _rgb |
The RGB tuple. | |
Represents a color in a specific color space.
Basic type: Color
The GfColor class represents a color in a specific color space. It provides various methods for constructing, manipulating, and retrieving color values.
The color values are stored as an RGB tuple and are associated with a color space. The color space determines the interpretation of the RGB values. The values are colorimetric, but not photometric as there is no normalizing constant (such as a luminance factor).
This class provides methods for setting and getting color values, converting between color spaces, normalizing luminance, and comparing colors.
GF_API GfColor | ( | ) |
The default constructor creates black, in the "lin_rec709" color space.
|
explicit |
Construct a black color in the given color space.
colorSpace | The color space. |
GF_API GfColor | ( | const GfVec3f & | rgb, |
const GfColorSpace & | colorSpace | ||
) |
Construct a color from an RGB tuple and color space.
rgb | The RGB tuple (red, green, blue), in the color space provided. |
colorSpace | The color space. |
GF_API GfColor | ( | const GfColor & | color, |
const GfColorSpace & | colorSpace | ||
) |
Construct a color by converting the source color into the specified color space.
color | The color to convert, in its color space. |
colorSpace | The desired color space. |
|
inline |
|
inline |
|
inline |
|
inline |
GF_API void SetFromPlanckianLocus | ( | float | kelvin, |
float | luminance | ||
) |
Set the color from the Planckian locus (blackbody radiation) temperature in Kelvin, in the existing color space.
Values are computed for temperatures between 1000K and 15000K. Note that temperatures below 1900K are out of gamut for Rec709.
kelvin | The temperature in Kelvin. |
luminance | The desired luminance. |
|
protected |