7#ifndef PXR_BASE_GF_COLORSPACE_H
8#define PXR_BASE_GF_COLORSPACE_H
16#include "pxr/base/gf/api.h"
20PXR_NAMESPACE_OPEN_SCOPE
73#define GF_COLORSPACE_NAME_TOKENS \
74 ((LinearAP1, "lin_ap1_scene")) \
75 ((LinearAP0, "lin_ap0_scene")) \
76 ((LinearRec709, "lin_rec709_scene")) \
77 ((LinearP3D65, "lin_p3d65_scene")) \
78 ((LinearRec2020, "lin_rec2020_scene")) \
79 ((LinearAdobeRGB, "lin_adobergb_scene")) \
80 ((LinearCIEXYZD65, "lin_ciexyzd65_scene")) \
81 ((SRGBRec709, "srgb_rec709_scene")) \
82 ((G22Rec709, "g22_rec709_scene")) \
83 ((G18Rec709, "g18_rec709_scene")) \
84 ((SRGBAP1, "srgb_ap1_scene")) \
85 ((G22AP1, "g22_ap1_scene")) \
86 ((SRGBP3D65, "srgb_p3d65_scene")) \
87 ((G22AdobeRGB, "g22_adobergb_scene")) \
88 ((Identity, "identity")) \
91 ((Unknown, "unknown")) \
92 ((CIEXYZ, "lin_ciexyzd65_scene")) \
93 ((LinearDisplayP3, "lin_p3d65_scene"))
96 GF_COLORSPACE_NAME_TOKENS);
234 std::tuple<GfVec2f, GfVec2f, GfVec2f, GfVec2f>
239 std::shared_ptr<_Data> _data;
242PXR_NAMESPACE_CLOSE_SCOPE
Represents a color in a specific 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.
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.
GF_API TfToken GetName() const
Get the name of the color space.
GF_API GfMatrix3f GetRGBToRGB(const GfColorSpace &srcColorSpace) const
Get the RGB to RGB conversion matrix from srcColorSpace to "this" color space.
bool operator!=(const GfColorSpace &rh) const
Check if two color spaces are not equal.
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 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 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 bool operator==(const GfColorSpace &rh) const
Check if two color spaces are equal.
static GF_API bool IsValid(const TfToken &name)
Check if a color space name is valid for constructing a GfColorSpace by name.
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 GfColor Convert(const GfColorSpace &srcColorSpace, const GfVec3f &rgb) const
Convert a rgb triplet in a certain color space to "this" color space.
GF_API float GetLinearBias() const
Get the linear bias of the color space.
GF_API GfColorSpace(const TfToken &name)
Construct a GfColorSpace from a name token.
GF_API std::pair< float, float > GetTransferFunctionParams() const
Get the computed K0 and Phi values for use in the transfer function.
Stores a 3x3 matrix of float elements.
Basic type for a vector of 2 float components.
Basic type for a vector of 3 float components.
Represents a range of contiguous elements.
Token for efficient comparison, assignment, and hashing of known strings.
This file defines some macros that are useful for declaring and using static TfTokens.
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.