|
Basic type: ColorSpace. More...
#include <colorSpace.h>
Public Member Functions | |
GF_API | GfColorSpace (const TfToken &name) |
Construct a GfColorSpace from a name token. | |
GF_API | GfColorSpace (const TfToken &name, const GfVec2f &redChroma, const GfVec2f &greenChroma, const GfVec2f &blueChroma, const GfVec2f &whitePoint, float gamma, float linearBias) |
Construct a custom color space from raw values. | |
GF_API | GfColorSpace (const TfToken &name, const GfMatrix3f &rgbToXYZ, float gamma, float linearBias) |
Construct a color space from a 3x3 matrix and linearization parameters. | |
GF_API TfToken | GetName () const |
Get the name of the color space. | |
GF_API bool | operator== (const GfColorSpace &rh) const |
Check if two color spaces are equal. | |
bool | operator!= (const GfColorSpace &rh) const |
Check if two color spaces are not equal. | |
GF_API void | ConvertRGBSpan (const GfColorSpace &srcColorSpace, TfSpan< float > rgb) const |
Convert in place a packed array of RGB values from one color space to "this" one. | |
GF_API void | ConvertRGBASpan (const GfColorSpace &srcColorSpace, TfSpan< float > rgba) const |
Convert in place a packed array of RGBA values from one color space to "this one. | |
GF_API GfColor | Convert (const GfColorSpace &srcColorSpace, const GfVec3f &rgb) const |
Convert a rgb triplet in a certain color space to "this" color space. | |
GF_API GfMatrix3f | GetRGBToXYZ () const |
Get the RGB to XYZ conversion matrix. | |
GF_API float | GetGamma () const |
Get the gamma value of the color space. | |
GF_API float | GetLinearBias () const |
Get the linear bias of the color space. | |
GF_API std::pair< float, float > | GetTransferFunctionParams () const |
Get the computed K0 and Phi values for use in the transfer function. | |
GF_API std::tuple< GfVec2f, GfVec2f, GfVec2f, GfVec2f > | GetPrimariesAndWhitePoint () const |
Get the chromaticity coordinates and white point if the color space was constructed from primaries. | |
Static Public Member Functions | |
static GF_API bool | IsValid (const TfToken &name) |
Check if a color space name is valid for constructing a GfColorSpace by 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 95 of file colorSpace.h.
|
explicit |
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 Convert | ( | const GfColorSpace & | srcColorSpace, |
const GfVec3f & | rgb | ||
) | const |
Convert a rgb triplet in a certain color space to "this" color space.
GF_API void 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 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. |
GF_API float GetGamma | ( | ) | const |
Get the gamma value of the color space.
GF_API float GetLinearBias | ( | ) | const |
Get the linear bias of the color space.
GF_API TfToken GetName | ( | ) | const |
Get the name of the color space.
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 GetRGBToXYZ | ( | ) | const |
Get the RGB to XYZ conversion matrix.
GF_API std::pair< float, float > GetTransferFunctionParams | ( | ) | const |
Get the computed K0 and Phi values for use in the transfer function.
|
static |
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 156 of file colorSpace.h.
GF_API bool operator== | ( | const GfColorSpace & | rh | ) | const |
Check if two color spaces are equal.
lh | The left-hand side color space. |
|
friend |
Definition at line 96 of file colorSpace.h.