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

Unified Diff: src/core/SkColorSpace_Base.h

Issue 2001203003: Write ICC profiles from SkColorSpace object (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 4 years, 7 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
Index: src/core/SkColorSpace_Base.h
diff --git a/src/core/SkColorSpace_Base.h b/src/core/SkColorSpace_Base.h
index 535ec3b527e142de44850a557d4c58e5afaadeb9..b2d5818e84e31b5e4e58ffcfa8e170be23d07b4b 100644
--- a/src/core/SkColorSpace_Base.h
+++ b/src/core/SkColorSpace_Base.h
@@ -9,6 +9,7 @@
#define SkColorSpace_Base_DEFINED
#include "SkColorSpace.h"
+#include "SkData.h"
#include "SkTemplates.h"
struct SkGammaCurve {
@@ -116,18 +117,28 @@ public:
const sk_sp<SkGammas>& gammas() const { return fGammas; }
+ /**
+ * Writes this object as an ICC profile.
+ */
+ sk_sp<SkData> writeToICC() const;
+
private:
- SkColorSpace_Base(sk_sp<SkGammas> gammas, const SkMatrix44& toXYZ, Named);
+ static sk_sp<SkColorSpace> NewRGB(const float gammas[3], const SkMatrix44& toXYZD50,
+ sk_sp<SkData> profileData);
+
+ SkColorSpace_Base(sk_sp<SkGammas> gammas, const SkMatrix44& toXYZ, Named,
+ sk_sp<SkData> profileData);
SkColorSpace_Base(sk_sp<SkGammas> gammas, GammaNamed gammaNamed, const SkMatrix44& toXYZ,
- Named);
+ Named, sk_sp<SkData> profileData);
SkColorSpace_Base(SkColorLookUpTable* colorLUT, sk_sp<SkGammas> gammas,
- const SkMatrix44& toXYZ);
+ const SkMatrix44& toXYZ, sk_sp<SkData> profileData);
SkAutoTDelete<SkColorLookUpTable> fColorLUT;
sk_sp<SkGammas> fGammas;
+ sk_sp<SkData> fProfileData;
friend class SkColorSpace;
typedef SkColorSpace INHERITED;
@@ -137,6 +148,10 @@ static inline SkColorSpace_Base* as_CSB(SkColorSpace* colorSpace) {
return static_cast<SkColorSpace_Base*>(colorSpace);
}
+static inline const SkColorSpace_Base* as_CSB(const SkColorSpace* colorSpace) {
+ return static_cast<const SkColorSpace_Base*>(colorSpace);
+}
+
static inline SkColorSpace_Base* as_CSB(const sk_sp<SkColorSpace>& colorSpace) {
return static_cast<SkColorSpace_Base*>(colorSpace.get());
}
« no previous file with comments | « src/core/SkColorSpace.cpp ('k') | src/core/SkEndian.h » ('j') | tests/ColorSpaceTest.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698