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

Unified Diff: src/core/SkColorSpace_XYZ.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_ICC.cpp ('k') | src/core/SkColorSpace_XYZ.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkColorSpace_XYZ.h
diff --git a/src/core/SkColorSpace_XYZ.h b/src/core/SkColorSpace_XYZ.h
new file mode 100644
index 0000000000000000000000000000000000000000..72ec3f1b67de5b5395328f3e872c3572ca428fe3
--- /dev/null
+++ b/src/core/SkColorSpace_XYZ.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2016 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkColorSpace_XYZ_DEFINED
+#define SkColorSpace_XYZ_DEFINED
+
+#include "SkColorSpace_Base.h"
+#include "SkData.h"
+#include "SkOnce.h"
+
+class SkColorSpace_XYZ : public SkColorSpace_Base {
+public:
+ const SkMatrix44* toXYZD50() const override { return &fToXYZD50; }
+
+ const SkMatrix44* fromXYZD50() const override;
+
+ bool onGammaCloseToSRGB() const override;
+
+ bool onGammaIsLinear() const override;
+
+ Type type() const override { return Type::kXYZ; }
+
+ sk_sp<SkColorSpace> makeLinearGamma();
+
+ SkGammaNamed gammaNamed() const { return fGammaNamed; }
+
+ const SkGammas* gammas() const { return fGammas.get(); }
+
+ void toDstGammaTables(const uint8_t* tables[3], sk_sp<SkData>* storage, int numTables) const;
+
+private:
+ SkColorSpace_XYZ(SkGammaNamed gammaNamed, const SkMatrix44& toXYZ);
+
+ SkColorSpace_XYZ(SkGammaNamed gammaNamed, sk_sp<SkGammas> gammas,
+ const SkMatrix44& toXYZ, sk_sp<SkData> profileData);
+
+ const SkGammaNamed fGammaNamed;
+ sk_sp<SkGammas> fGammas;
+ const SkMatrix44 fToXYZD50;
+
+ mutable SkMatrix44 fFromXYZD50;
+ mutable SkOnce fFromXYZOnce;
+
+ mutable sk_sp<SkData> fDstStorage;
+ mutable const uint8_t* fToDstGammaTables[3];
+ mutable SkOnce fToDstGammaOnce;
+
+ friend class SkColorSpace;
+ friend class SkColorSpace_Base;
+ friend class ColorSpaceXformTest;
+ typedef SkColorSpace_Base INHERITED;
+};
+
+#endif
« no previous file with comments | « src/core/SkColorSpace_ICC.cpp ('k') | src/core/SkColorSpace_XYZ.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698