HDK
|
#include <colorSpace.h>
Public Member Functions | |
GF_API | GfColorSpace (const TfToken &name) |
GF_API | GfColorSpace (const TfToken &name, const GfVec2f &redChroma, const GfVec2f &greenChroma, const GfVec2f &blueChroma, const GfVec2f &whitePoint, float gamma, float linearBias) |
GF_API | GfColorSpace (const TfToken &name, const GfMatrix3f &rgbToXYZ, float gamma, float linearBias) |
GF_API TfToken | GetName () const |
GF_API bool | operator== (const GfColorSpace &rh) const |
bool | operator!= (const GfColorSpace &rh) const |
GF_API void | ConvertRGBSpan (const GfColorSpace &srcColorSpace, TfSpan< float > rgb) const |
GF_API void | ConvertRGBASpan (const GfColorSpace &srcColorSpace, TfSpan< float > rgba) const |
GF_API GfColor | Convert (const GfColorSpace &srcColorSpace, const GfVec3f &rgb) const |
Convert a rgb triplet in a certain color space to "this" color space. More... | |
GF_API GfMatrix3f | GetRGBToXYZ () const |
GF_API float | GetGamma () const |
GF_API float | GetLinearBias () const |
GF_API std::pair< float, float > | GetTransferFunctionParams () const |
GF_API std::tuple< GfVec2f, GfVec2f, GfVec2f, GfVec2f > | GetPrimariesAndWhitePoint () const |
Static Public Member Functions | |
static GF_API bool | IsValid (const TfToken &name) |
Friends | |
class | GfColor |
Basic type: ColorSpace
This class represents a colorspace. Color spaces may be created by name, parameterization, or by a 3x3 matrix and a gamma operator.
The parameters used to construct the color space are not available for introspection ~ the color space object is intended for color conversion operations on a GfColor.
The color spaces natively recognized by GfColorSpace are listed in GfColorSpaceNames.
Definition at line 115 of file colorSpace.h.
Construct a GfColorSpace from a name token.
name | The name token of the color space. |
|
explicit |
Construct a custom color space from raw values.
name | The name token of the color space. |
redChroma | The red chromaticity coordinates. |
greenChroma | The green chromaticity coordinates. |
blueChroma | The blue chromaticity coordinates. |
whitePoint | The white point chromaticity coordinates. |
gamma | The gamma value of the log section. |
linearBias | The linear bias of the log section. |
|
explicit |
Construct a color space from a 3x3 matrix and linearization parameters.
name | The name token of the color space. |
rgbToXYZ | The RGB to XYZ conversion matrix. |
gamma | The gamma value of the log section. |
linearBias | The linear bias of the log section. |
GF_API GfColor GfColorSpace::Convert | ( | const GfColorSpace & | srcColorSpace, |
const GfVec3f & | rgb | ||
) | const |
Convert a rgb triplet in a certain color space to "this" color space.
GF_API void GfColorSpace::ConvertRGBASpan | ( | const GfColorSpace & | srcColorSpace, |
TfSpan< float > | rgba | ||
) | const |
Convert in place a packed array of RGBA values from one color space to "this one.
to | The target color space. |
rgba | The packed array of RGBA values to convert. |
GF_API void GfColorSpace::ConvertRGBSpan | ( | const GfColorSpace & | srcColorSpace, |
TfSpan< float > | rgb | ||
) | const |
Convert in place a packed array of RGB values from one color space to "this" one.
to | The target color space. |
rgb | The packed array of RGB values to convert. |
Get the gamma value of the color space.
Get the linear bias of the color space.
Get the name of the color space.
GF_API std::tuple<GfVec2f, GfVec2f, GfVec2f, GfVec2f> GfColorSpace::GetPrimariesAndWhitePoint | ( | ) | const |
Get the chromaticity coordinates and white point if the color space was constructed from primaries. The primaries and white points will be in the order red, green, blue, white. The values will be valid if the color space was constructed from primaries or a well formed primary matrix.
GF_API GfMatrix3f GfColorSpace::GetRGBToXYZ | ( | ) | const |
Get the RGB to XYZ conversion matrix.
Get the computed K0 and Phi values for use in the transfer function.
Check if a color space name is valid for constructing a GfColorSpace by name.
|
inline |
Check if two color spaces are not equal.
rh | The rigt-hand side color space. |
Definition at line 176 of file colorSpace.h.
GF_API bool GfColorSpace::operator== | ( | const GfColorSpace & | rh | ) | const |
Check if two color spaces are equal.
lh | The left-hand side color space. |
Definition at line 116 of file colorSpace.h.