aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar Matt Sarett <msarett@google.com>2017-02-06 12:59:48 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-02-07 17:00:58 +0000
commitecaaf6f1c156e5690200322fc2636380c1f63dd8 (patch)
treea08ca843e15f8d9fd14b2d45f8a7916391052940 /include
parent041f7dfc577822f1e97721a865f86a9a02660cf9 (diff)
SkColorSpace: remove named API, add gamut API
BUG=skia: Change-Id: I01c5e1874c9a034febc64e25b3aaafb5050393a6 Reviewed-on: https://skia-review.googlesource.com/8021 Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
Diffstat (limited to 'include')
-rw-r--r--include/core/SkColorSpace.h39
1 files changed, 30 insertions, 9 deletions
diff --git a/include/core/SkColorSpace.h b/include/core/SkColorSpace.h
index 1bcb44fbc5..0399ca8c72 100644
--- a/include/core/SkColorSpace.h
+++ b/include/core/SkColorSpace.h
@@ -53,6 +53,7 @@ struct SK_API SkColorSpaceTransferFn {
class SK_API SkColorSpace : public SkRefCnt {
public:
+#ifdef SK_USE_LEGACY_NAMED_COLOR_SPACE
/**
* Common, named profiles that we can recognize.
*/
@@ -76,6 +77,23 @@ public:
kSRGBLinear_Named,
};
+ /**
+ * Create a common, named SkColorSpace.
+ */
+ static sk_sp<SkColorSpace> MakeNamed(Named);
+#endif
+
+ /**
+ * Create the sRGB color space.
+ */
+ static sk_sp<SkColorSpace> MakeSRGB();
+
+ /**
+ * Colorspace with the sRGB primaries, but a linear (1.0) gamma. Commonly used for
+ * half-float surfaces, and high precision individual colors (gradient stops, etc...)
+ */
+ static sk_sp<SkColorSpace> MakeSRGBLinear();
+
enum RenderTargetGamma : uint8_t {
kLinear_RenderTargetGamma,
@@ -86,21 +104,24 @@ public:
kSRGB_RenderTargetGamma,
};
+ enum Gamut {
+ kSRGB_Gamut,
+ kAdobeRGB_Gamut,
+ kDCIP3_D65_Gamut,
+ kRec2020_Gamut,
+ };
+
/**
* Create an SkColorSpace from a transfer function and a color gamut.
*
- * Transfer function can be specified as a render target, as the coefficients to an equation,
- * or as three exponents (R, G, B).
- * Gamut is specified using the matrix transformation to XYZ D50.
+ * Transfer function can be specified as an enum or as the coefficients to an equation.
+ * Gamut can be specified as an enum or as the matrix transformation to XYZ D50.
*/
+ static sk_sp<SkColorSpace> MakeRGB(RenderTargetGamma gamma, Gamut gamut);
static sk_sp<SkColorSpace> MakeRGB(RenderTargetGamma gamma, const SkMatrix44& toXYZD50);
+ static sk_sp<SkColorSpace> MakeRGB(const SkColorSpaceTransferFn& coeffs, Gamut gamut);
static sk_sp<SkColorSpace> MakeRGB(const SkColorSpaceTransferFn& coeffs,
- const SkMatrix44& toXYZD50);
-
- /**
- * Create a common, named SkColorSpace.
- */
- static sk_sp<SkColorSpace> MakeNamed(Named);
+ const SkMatrix44& toXYZD50);
/**
* Create an SkColorSpace from an ICC profile.