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
56#define GF_COLORSPACE_NAME_TOKENS \
57 ((CIEXYZ, "lin_ciexyzd65_scene")) \
60 ((Unknown, "unknown")) \
61 ((LinearAdobeRGB, "lin_adobergb_scene")) \
62 ((LinearAP0, "lin_ap0_scene")) \
63 ((LinearAP1, "lin_ap1_scene")) \
64 ((LinearDisplayP3, "lin_displayp3_scene")) \
65 ((LinearRec2020, "lin_rec2020_scene")) \
66 ((LinearRec709, "lin_rec709_scene")) \
67 ((G18Rec709, "g18_rec709_scene")) \
68 ((G22AdobeRGB, "g22_adobergb_scene")) \
69 ((G22AP1, "g22_ap1_scene")) \
70 ((G22Rec709, "g22_rec709_scene")) \
71 ((SRGBP3D65, "srgb_p3d65_scene")) \
72 ((SRGBRec709, "srgb_rec709_scene")) \
73 ((SRGBAP1, "srgb_ap1_scene"))
76 GF_COLORSPACE_NAME_TOKENS);
208 std::tuple<GfVec2f, GfVec2f, GfVec2f, GfVec2f>
213 std::shared_ptr<_Data> _data;
216PXR_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.
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.