Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: include/core/SkColorSpace.h

Issue 2304753002: Add SkColorSpacePrimaries to help with making D50 matrices (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix compile bug Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/codec/SkPngCodec.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkColorSpace.h
diff --git a/include/core/SkColorSpace.h b/include/core/SkColorSpace.h
index a96f6220951a98e518eb8483b0f63cb0b539b948..9b990da966dcac73912ed36ae1cb23423524e85f 100644
--- a/include/core/SkColorSpace.h
+++ b/include/core/SkColorSpace.h
@@ -13,6 +13,22 @@
class SkData;
+/**
+ * Describes a color gamut with primaries and a white point.
+ */
+struct SK_API SkColorSpacePrimaries {
+ float fRX, fRY;
+ float fGX, fGY;
+ float fBX, fBY;
+ float fWX, fWY;
+
+ /**
+ * Convert primaries and a white point to a toXYZD50 matrix, the preferred color gamut
+ * representation of SkColorSpace.
+ */
+ bool toXYZD50(SkMatrix44* toXYZD50) const;
+};
+
class SK_API SkColorSpace : public SkRefCnt {
public:
@@ -50,7 +66,10 @@ public:
};
/**
- * Create an SkColorSpace from a transfer function and a color gamut transform to D50 XYZ.
+ * Create an SkColorSpace from a transfer function and a color gamut.
+ *
+ * Transfer function is specified as linear or sRGB.
+ * Gamut is specified using the matrix transformation to XYZ D50.
*/
static sk_sp<SkColorSpace> NewRGB(RenderTargetGamma gamma, const SkMatrix44& toXYZD50);
« no previous file with comments | « no previous file | src/codec/SkPngCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698