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

Unified Diff: src/core/SkColorSpace_Base.h

Issue 2389983002: Refactored SkColorSpace and added in a Lab PCS GM (Closed)
Patch Set: migrated call from SkColorSpace_Base::makeLinearGamma() to SkColorSpace_XYZ::makeLinearGamma() 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 | « src/core/SkColorSpace_A2B.cpp ('k') | src/core/SkColorSpace_ICC.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkColorSpace_Base.h
diff --git a/src/core/SkColorSpace_Base.h b/src/core/SkColorSpace_Base.h
index a188a11dd115255e07125dccb16b96c83d736175..d8470950c49f7b10f939113e4bb2705a27eb3951 100644
--- a/src/core/SkColorSpace_Base.h
+++ b/src/core/SkColorSpace_Base.h
@@ -169,20 +169,32 @@ struct SkColorLookUpTable : public SkRefCnt {
class SkColorSpace_Base : public SkColorSpace {
public:
- SkGammaNamed gammaNamed() const { return fGammaNamed; }
- const SkGammas* gammas() const { return fGammas.get(); }
- const SkColorLookUpTable* colorLUT() const { return fColorLUT.get(); }
-
- const SkMatrix44& toXYZD50() const { return fToXYZD50; }
- const SkMatrix44& fromXYZD50() const;
-
- void toDstGammaTables(const uint8_t* tables[3], sk_sp<SkData>* storage, int numTables) const;
+ /**
+ * Describes color space gamut as a transformation to XYZ D50.
+ * Returns nullptr if color gamut cannot be described in terms of XYZ D50.
+ */
+ virtual const SkMatrix44* toXYZD50() const = 0;
/**
- * Create an SkColorSpace with the same gamut as this color space, but with linear gamma.
+ * Describes color space gamut as a transformation from XYZ D50
+ * Returns nullptr if color gamut cannot be described in terms of XYZ D50.
*/
- sk_sp<SkColorSpace> makeLinearGamma();
+ virtual const SkMatrix44* fromXYZD50() const = 0;
+
+ virtual bool onGammaCloseToSRGB() const = 0;
+
+ virtual bool onGammaIsLinear() const = 0;
+
+ enum class Type : uint8_t {
+ kXYZ,
+ kA2B
+ };
+
+ virtual Type type() const = 0;
+
+protected:
+ SkColorSpace_Base(sk_sp<SkData> profileData);
private:
@@ -199,23 +211,10 @@ private:
SkColorSpace_Base(SkGammaNamed gammaNamed, const SkMatrix44& toXYZ);
- SkColorSpace_Base(sk_sp<SkColorLookUpTable> colorLUT, SkGammaNamed gammaNamed,
- sk_sp<SkGammas> gammas, const SkMatrix44& toXYZ, sk_sp<SkData> profileData);
-
- sk_sp<SkColorLookUpTable> fColorLUT;
- const SkGammaNamed fGammaNamed;
- sk_sp<SkGammas> fGammas;
- sk_sp<SkData> fProfileData;
-
- const SkMatrix44 fToXYZD50;
- mutable SkMatrix44 fFromXYZD50;
- mutable SkOnce fFromXYZOnce;
-
- mutable sk_sp<SkData> fDstStorage;
- mutable const uint8_t* fToDstGammaTables[3];
- mutable SkOnce fToDstGammaOnce;
+ sk_sp<SkData> fProfileData;
friend class SkColorSpace;
+ friend class SkColorSpace_XYZ;
friend class ColorSpaceXformTest;
friend class ColorSpaceTest;
typedef SkColorSpace INHERITED;
« no previous file with comments | « src/core/SkColorSpace_A2B.cpp ('k') | src/core/SkColorSpace_ICC.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698