Chromium Code Reviews| Index: include/core/SkColorSpace.h |
| diff --git a/include/core/SkColorSpace.h b/include/core/SkColorSpace.h |
| index 58095775e4b75e2b9f7a12970f173d5d7886a4f7..c4b34e844f538f88db48b14bd06e08ad42a3d56d 100644 |
| --- a/include/core/SkColorSpace.h |
| +++ b/include/core/SkColorSpace.h |
| @@ -53,9 +53,42 @@ public: |
| }; |
| /** |
| - * Create an SkColorSpace from the src gamma and a transform from src gamut to D50 XYZ. |
| + * Contains the coefficients for a common transfer function equation. |
| + */ |
| + struct GammaCoefficients { |
| + // Y = (aX + b)^g + c for X >= d |
| + // Y = eX + f otherwise |
| + float fG; |
| + float fA; |
| + float fB; |
| + float fC; |
| + float fD; |
| + float fE; |
| + float fF; |
| + }; |
| + |
| + /** |
| + * Describes a color gamut with primaries and a white point. |
| + */ |
| + struct Primaries { |
| + float fRX, fRY; |
| + float fGX, fGY; |
| + float fBX, fBY; |
| + float fWX, fWY; |
| + }; |
| + |
| + /** |
| + * Create an SkColorSpace from a gamma transfer function and a gamut. |
| + * |
| + * Gamma can be specified using an enum or the coefficients to an equation. |
| + * Gamut can specified using the to D50 matrix transformation or using a set |
| + * of primaries and a white point. |
| + * |
| */ |
| static sk_sp<SkColorSpace> NewRGB(GammaNamed gammaNamed, const SkMatrix44& toXYZD50); |
| + static sk_sp<SkColorSpace> NewRGB(const GammaCoefficients& coeffs, const SkMatrix44& toXYZD50); |
| + static sk_sp<SkColorSpace> NewRGB(GammaNamed gammaNamed, const Primaries& primaries); |
|
Brian Osman
2016/09/02 15:37:52
I already mentioned this to Matt, but this set of
|
| + static sk_sp<SkColorSpace> NewRGB(const GammaCoefficients& coeffs, const Primaries& primaries); |
| /** |
| * Create a common, named SkColorSpace. |