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

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

Issue 1845283003: Gamma-correctness pushed into Skia, top-down. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 4 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 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 SkImageInfo_DEFINED 8 #ifndef SkImageInfo_DEFINED
9 #define SkImageInfo_DEFINED 9 #define SkImageInfo_DEFINED
10 10
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 311
312 SkImageInfo(int width, int height, SkColorType ct, SkAlphaType at, SkColorPr ofileType pt) 312 SkImageInfo(int width, int height, SkColorType ct, SkAlphaType at, SkColorPr ofileType pt)
313 : fWidth(width) 313 : fWidth(width)
314 , fHeight(height) 314 , fHeight(height)
315 , fColorType(ct) 315 , fColorType(ct)
316 , fAlphaType(at) 316 , fAlphaType(at)
317 , fProfileType(pt) 317 , fProfileType(pt)
318 {} 318 {}
319 }; 319 };
320 320
321 ///////////////////////////////////////////////////////////////////////////////
322
323 static inline bool SkColorAndProfileAreGammaCorrect(SkColorType ct, SkColorProfi leType pt) {
324 return kSRGB_SkColorProfileType == pt || kRGBA_F16_SkColorType == ct;
325 }
326
327 static inline bool SkImageInfoIsGammaCorrect(const SkImageInfo& info) {
328 return SkColorAndProfileAreGammaCorrect(info.colorType(), info.profileType() );
329 }
330
321 #endif 331 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698