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

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

Issue 2408133009: Add NewRGB() with float gamma to SkColorSpace public API
Patch Set: 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/codec/SkPngCodec.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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 /** 82 /**
83 * Transfer function is the canonical sRGB curve, which has a short lin ear segment 83 * Transfer function is the canonical sRGB curve, which has a short lin ear segment
84 * followed by a 2.4f exponential. 84 * followed by a 2.4f exponential.
85 */ 85 */
86 kSRGB_RenderTargetGamma, 86 kSRGB_RenderTargetGamma,
87 }; 87 };
88 88
89 /** 89 /**
90 * Create an SkColorSpace from a transfer function and a color gamut. 90 * Create an SkColorSpace from a transfer function and a color gamut.
91 * 91 *
92 * Transfer function can be specified as a render target or as the coeffici ents to an equation. 92 * Transfer function can be specified as a render target, as the coefficien ts to an equation,
93 * or as three exponents (R, G, B).
93 * Gamut is specified using the matrix transformation to XYZ D50. 94 * Gamut is specified using the matrix transformation to XYZ D50.
94 */ 95 */
95 static sk_sp<SkColorSpace> NewRGB(RenderTargetGamma gamma, const SkMatrix44& toXYZD50); 96 static sk_sp<SkColorSpace> NewRGB(RenderTargetGamma gamma, const SkMatrix44& toXYZD50);
96 static sk_sp<SkColorSpace> NewRGB(const SkColorSpaceTransferFn& coeffs, 97 static sk_sp<SkColorSpace> NewRGB(const SkColorSpaceTransferFn& coeffs,
97 const SkMatrix44& toXYZD50); 98 const SkMatrix44& toXYZD50);
99 static sk_sp<SkColorSpace> NewRGB(const float exponents[3], const SkMatrix44 & toXYZD50);
98 100
99 /** 101 /**
100 * Create a common, named SkColorSpace. 102 * Create a common, named SkColorSpace.
101 */ 103 */
102 static sk_sp<SkColorSpace> NewNamed(Named); 104 static sk_sp<SkColorSpace> NewNamed(Named);
103 105
104 /** 106 /**
105 * Create an SkColorSpace from an ICC profile. 107 * Create an SkColorSpace from an ICC profile.
106 */ 108 */
107 static sk_sp<SkColorSpace> NewICC(const void*, size_t); 109 static sk_sp<SkColorSpace> NewICC(const void*, size_t);
(...skipping 26 matching lines...) Expand all
134 * If both are null, we return true. If one is null and the other is not, we return false. 136 * If both are null, we return true. If one is null and the other is not, we return false.
135 * If both are non-null, we do a deeper compare. 137 * If both are non-null, we do a deeper compare.
136 */ 138 */
137 static bool Equals(const SkColorSpace* src, const SkColorSpace* dst); 139 static bool Equals(const SkColorSpace* src, const SkColorSpace* dst);
138 140
139 protected: 141 protected:
140 SkColorSpace() {} 142 SkColorSpace() {}
141 }; 143 };
142 144
143 #endif 145 #endif
OLDNEW
« no previous file with comments | « no previous file | src/codec/SkPngCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698