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

Side by Side Diff: src/core/SkColorSpace_Base.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 | « src/core/SkColorSpace.cpp ('k') | tests/ColorSpaceTest.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_Base_DEFINED 8 #ifndef SkColorSpace_Base_DEFINED
9 #define SkColorSpace_Base_DEFINED 9 #define SkColorSpace_Base_DEFINED
10 10
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 162
163 // Objects of this type are created in a custom fashion using sk_malloc_thro w 163 // Objects of this type are created in a custom fashion using sk_malloc_thro w
164 // and therefore must be sk_freed. 164 // and therefore must be sk_freed.
165 void* operator new(size_t size) = delete; 165 void* operator new(size_t size) = delete;
166 void* operator new(size_t, void* p) { return p; } 166 void* operator new(size_t, void* p) { return p; }
167 void operator delete(void* p) { sk_free(p); } 167 void operator delete(void* p) { sk_free(p); }
168 }; 168 };
169 169
170 class SkColorSpace_Base : public SkColorSpace { 170 class SkColorSpace_Base : public SkColorSpace {
171 public: 171 public:
172
173 static sk_sp<SkColorSpace> NewRGB(const float gammas[3], const SkMatrix44& t oXYZD50);
174
175 SkGammaNamed gammaNamed() const { return fGammaNamed; } 172 SkGammaNamed gammaNamed() const { return fGammaNamed; }
176 const SkGammas* gammas() const { return fGammas.get(); } 173 const SkGammas* gammas() const { return fGammas.get(); }
177 174
178 const SkColorLookUpTable* colorLUT() const { return fColorLUT.get(); } 175 const SkColorLookUpTable* colorLUT() const { return fColorLUT.get(); }
179 176
180 const SkMatrix44& toXYZD50() const { return fToXYZD50; } 177 const SkMatrix44& toXYZD50() const { return fToXYZD50; }
181 const SkMatrix44& fromXYZD50() const; 178 const SkMatrix44& fromXYZD50() const;
182 179
183 /** 180 /**
184 * Create an SkColorSpace with the same gamut as this color space, but with linear gamma. 181 * Create an SkColorSpace with the same gamut as this color space, but with linear gamma.
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 221
225 static inline const SkColorSpace_Base* as_CSB(const SkColorSpace* colorSpace) { 222 static inline const SkColorSpace_Base* as_CSB(const SkColorSpace* colorSpace) {
226 return static_cast<const SkColorSpace_Base*>(colorSpace); 223 return static_cast<const SkColorSpace_Base*>(colorSpace);
227 } 224 }
228 225
229 static inline SkColorSpace_Base* as_CSB(const sk_sp<SkColorSpace>& colorSpace) { 226 static inline SkColorSpace_Base* as_CSB(const sk_sp<SkColorSpace>& colorSpace) {
230 return static_cast<SkColorSpace_Base*>(colorSpace.get()); 227 return static_cast<SkColorSpace_Base*>(colorSpace.get());
231 } 228 }
232 229
233 #endif 230 #endif
OLDNEW
« no previous file with comments | « src/core/SkColorSpace.cpp ('k') | tests/ColorSpaceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698