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

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

Issue 2188633003: Expose more gamma info for UMA statistics (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Track invalid gamma as well Created 4 years, 4 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 24 matching lines...) Expand all
35 kSRGB_GammaNamed, 35 kSRGB_GammaNamed,
36 36
37 /** 37 /**
38 * Gamma curve is a close match to the 2.2f exponential curve. This is 38 * Gamma curve is a close match to the 2.2f exponential curve. This is
39 * used by Adobe RGB profiles and is common on monitors as well. 39 * used by Adobe RGB profiles and is common on monitors as well.
40 */ 40 */
41 k2Dot2Curve_GammaNamed, 41 k2Dot2Curve_GammaNamed,
42 42
43 /** 43 /**
44 * Gamma is represented by a look-up table, a parametric curve, or an u ncommon 44 * Gamma is represented by a look-up table, a parametric curve, or an u ncommon
45 * exponential curve. Or there is an additional pre-processing step be fore the 45 * exponential curve. Or the R, G, and B gammas do not match.
46 * applying the gamma.
47 */ 46 */
48 kNonStandard_GammaNamed, 47 kNonStandard_GammaNamed,
48
49 /**
50 * To be used by UMA code only. ICC profiles lacks valid gamma represe ntation.
51 */
52 kInvalid_GammaNamed,
49 }; 53 };
50 54
51 /** 55 /**
52 * Create an SkColorSpace from the src gamma and a transform from src gamut to D50 XYZ. 56 * Create an SkColorSpace from the src gamma and a transform from src gamut to D50 XYZ.
53 */ 57 */
54 static sk_sp<SkColorSpace> NewRGB(GammaNamed gammaNamed, const SkMatrix44& t oXYZD50); 58 static sk_sp<SkColorSpace> NewRGB(GammaNamed gammaNamed, const SkMatrix44& t oXYZD50);
55 59
56 /** 60 /**
57 * Create a common, named SkColorSpace. 61 * Create a common, named SkColorSpace.
58 */ 62 */
(...skipping 12 matching lines...) Expand all
71 const SkMatrix44& xyz() const { return fToXYZD50; } 75 const SkMatrix44& xyz() const { return fToXYZD50; }
72 76
73 /** 77 /**
74 * Returns true if the color space gamma is near enough to be approximated as sRGB. 78 * Returns true if the color space gamma is near enough to be approximated as sRGB.
75 */ 79 */
76 bool gammaCloseToSRGB() const { 80 bool gammaCloseToSRGB() const {
77 return kSRGB_GammaNamed == fGammaNamed || k2Dot2Curve_GammaNamed == fGam maNamed; 81 return kSRGB_GammaNamed == fGammaNamed || k2Dot2Curve_GammaNamed == fGam maNamed;
78 } 82 }
79 83
80 /** 84 /**
85 * To be used only by UMA code.
86 */
87 bool gammasAreMatching() const;
88 bool gammasAreNamed() const;
89 bool gammasAreValues() const;
90 bool gammasAreTables() const;
91 bool gammasAreParams() const;
92
93 /**
81 * Returns nullptr on failure. Fails when we fallback to serializing ICC d ata and 94 * Returns nullptr on failure. Fails when we fallback to serializing ICC d ata and
82 * the data is too large to serialize. 95 * the data is too large to serialize.
83 */ 96 */
84 sk_sp<SkData> serialize() const; 97 sk_sp<SkData> serialize() const;
85 98
86 static sk_sp<SkColorSpace> Deserialize(const void* data, size_t length); 99 static sk_sp<SkColorSpace> Deserialize(const void* data, size_t length);
87 100
88 protected: 101 protected:
89 SkColorSpace(GammaNamed gammaNamed, const SkMatrix44& toXYZD50, Named named) ; 102 SkColorSpace(GammaNamed gammaNamed, const SkMatrix44& toXYZD50, Named named) ;
90 103
91 const GammaNamed fGammaNamed; 104 const GammaNamed fGammaNamed;
92 const SkMatrix44 fToXYZD50; 105 const SkMatrix44 fToXYZD50;
93 const Named fNamed; 106 const Named fNamed;
94 }; 107 };
95 108
96 #endif 109 #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