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

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

Issue 1726823002: Set SkColorSpace object for PNGs and parse ICC profiles (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 4 years, 9 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 | « src/codec/SkPngCodec.cpp ('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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
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* NewICC(const void*, size_t);
57 57
58 SkFloat3 gamma() const { return fGamma; } 58 SkFloat3 gamma() const { return fGamma; }
59 SkFloat3x3 xyz() const { return fToXYZD50; }
59 Named named() const { return fNamed; } 60 Named named() const { return fNamed; }
60 uint32_t uniqueID() const { return fUniqueID; } 61 uint32_t uniqueID() const { return fUniqueID; }
61 62
62 enum Result { 63 enum Result {
63 kFailure_Result, 64 kFailure_Result,
64 kIdentity_Result, 65 kIdentity_Result,
65 kNormal_Result, 66 kNormal_Result,
66 }; 67 };
67 68
68 /** 69 /**
69 * Given a src and dst colorspace, return the 3x3 matrix that will convert src_linear_RGB 70 * Given a src and dst colorspace, return the 3x3 matrix that will convert src_linear_RGB
70 * values into dst_linear_RGB values. 71 * values into dst_linear_RGB values.
71 */ 72 */
72 static Result Concat(const SkColorSpace* src, const SkColorSpace* dst, SkFlo at3x3* result); 73 static Result Concat(const SkColorSpace* src, const SkColorSpace* dst, SkFlo at3x3* result);
73 74
74 static void Test(); 75 static void Test();
75 void dump() const; 76 void dump() const;
76 77
77 protected: 78 protected:
78 SkColorSpace(const SkFloat3x3& toXYZ, const SkFloat3& gamma, Named); 79 SkColorSpace(const SkFloat3x3& toXYZ, const SkFloat3& gamma, Named);
79 80
80 private: 81 private:
81 const SkFloat3x3 fToXYZD50; 82 const SkFloat3x3 fToXYZD50;
82 const SkFloat3 fGamma; 83 const SkFloat3 fGamma;
83 const uint32_t fUniqueID; 84 const uint32_t fUniqueID;
84 const Named fNamed; 85 const Named fNamed;
85 }; 86 };
86 87
87 #endif 88 #endif
OLDNEW
« no previous file with comments | « src/codec/SkPngCodec.cpp ('k') | src/core/SkColorSpace.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698