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

Side by Side Diff: src/core/SkColorSpace.h

Issue 1707033002: parse icc profiles Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « resources/Upper_Right.jpg ('k') | src/core/SkColorSpace.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkColorSpace_DEFINED 8 #ifndef SkColorSpace_DEFINED
9 #define SkColorSpace_DEFINED 9 #define SkColorSpace_DEFINED
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 kSRGB_Named, 46 kSRGB_Named,
47 }; 47 };
48 48
49 /** 49 /**
50 * Return a colorspace instance, given a 3x3 transform from linear_RGB to D 50_XYZ 50 * Return a colorspace instance, given a 3x3 transform from linear_RGB to D 50_XYZ
51 * and the src-gamma, return a ColorSpace 51 * and the src-gamma, return a ColorSpace
52 */ 52 */
53 static SkColorSpace* NewRGB(const SkFloat3x3& toXYZD50, const SkFloat3& gamm a); 53 static SkColorSpace* NewRGB(const SkFloat3x3& toXYZD50, const SkFloat3& gamm a);
54 54
55 static SkColorSpace* NewNamed(Named); 55 static SkColorSpace* NewNamed(Named);
56 static SkColorSpace* NewICC(const void*, size_t); 56 static SkColorSpace* NewICCProfile(const void*, size_t);
57 57
58 SkFloat3 gamma() const { return fGamma; } 58 SkFloat3 gamma() const { return fGamma; }
59 Named named() const { return fNamed; } 59 Named named() const { return fNamed; }
60 uint32_t uniqueID() const { return fUniqueID; } 60 uint32_t uniqueID() const { return fUniqueID; }
61 61
62 enum Result { 62 enum Result {
63 kFailure_Result, 63 kFailure_Result,
64 kIdentity_Result, 64 kIdentity_Result,
65 kNormal_Result, 65 kNormal_Result,
66 }; 66 };
67 67
68 /** 68 /**
69 * Given a src and dst colorspace, return the 3x3 matrix that will convert src_linear_RGB 69 * Given a src and dst colorspace, return the 3x3 matrix that will convert src_linear_RGB
70 * values into dst_linear_RGB values. 70 * values into dst_linear_RGB values.
71 */ 71 */
72 static Result Concat(const SkColorSpace* src, const SkColorSpace* dst, SkFlo at3x3* result); 72 static Result Concat(const SkColorSpace* src, const SkColorSpace* dst, SkFlo at3x3* result);
73 73
74 static void Test(); 74 static void Test();
75 void dump() const; 75 void dump() const;
76 76
77 protected: 77 protected:
78 SkColorSpace(const SkFloat3x3& toXYZ, const SkFloat3& gamma, Named); 78 SkColorSpace(const SkFloat3x3& toXYZ, const SkFloat3& gamma, Named);
79 79
80 private: 80 private:
81 static SkColorSpace* NewICCProfile32(const uint32_t*, size_t);
82
81 const SkFloat3x3 fToXYZD50; 83 const SkFloat3x3 fToXYZD50;
82 const SkFloat3 fGamma; 84 const SkFloat3 fGamma;
83 const uint32_t fUniqueID; 85 const uint32_t fUniqueID;
84 const Named fNamed; 86 const Named fNamed;
85 }; 87 };
86 88
87 #endif 89 #endif
OLDNEW
« no previous file with comments | « resources/Upper_Right.jpg ('k') | src/core/SkColorSpace.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698