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

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

Issue 2381553002: Move toXYZD50() to SkColorSpace_Base (Closed)
Patch Set: Rebase 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 unified diff | Download patch
« no previous file with comments | « no previous file | 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 * Create an SkColorSpace from an ICC profile. 63 * Create an SkColorSpace from an ICC profile.
64 */ 64 */
65 static sk_sp<SkColorSpace> NewICC(const void*, size_t); 65 static sk_sp<SkColorSpace> NewICC(const void*, size_t);
66 66
67 /** 67 /**
68 * Create an SkColorSpace with the same gamut as this color space, but with linear gamma. 68 * Create an SkColorSpace with the same gamut as this color space, but with linear gamma.
69 */ 69 */
70 sk_sp<SkColorSpace> makeLinearGamma(); 70 sk_sp<SkColorSpace> makeLinearGamma();
71 71
72 /** 72 /**
73 * Returns the matrix used to transform src gamut to XYZ D50.
74 */
75 const SkMatrix44& toXYZD50() const { return fToXYZD50; }
76
77 /**
78 * Returns true if the color space gamma is near enough to be approximated as sRGB. 73 * Returns true if the color space gamma is near enough to be approximated as sRGB.
79 */ 74 */
80 bool gammaCloseToSRGB() const; 75 bool gammaCloseToSRGB() const;
81 76
82 /** 77 /**
83 * Returns true if the color space gamma is linear. 78 * Returns true if the color space gamma is linear.
84 */ 79 */
85 bool gammaIsLinear() const; 80 bool gammaIsLinear() const;
86 81
87 /** 82 /**
(...skipping 10 matching lines...) Expand all
98 93
99 static sk_sp<SkColorSpace> Deserialize(const void* data, size_t length); 94 static sk_sp<SkColorSpace> Deserialize(const void* data, size_t length);
100 95
101 /** 96 /**
102 * If both are null, we return true. If one is null and the other is not, we return false. 97 * If both are null, we return true. If one is null and the other is not, we return false.
103 * If both are non-null, we do a deeper compare. 98 * If both are non-null, we do a deeper compare.
104 */ 99 */
105 static bool Equals(const SkColorSpace* src, const SkColorSpace* dst); 100 static bool Equals(const SkColorSpace* src, const SkColorSpace* dst);
106 101
107 protected: 102 protected:
108 SkColorSpace(const SkMatrix44& toXYZD50); 103 SkColorSpace() {}
109
110 const SkMatrix44 fToXYZD50;
111 }; 104 };
112 105
113 #endif 106 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkColorSpace.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698