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

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

Issue 2005263002: SkColorSpace tweaks (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 6 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
11 #include "SkMatrix44.h" 11 #include "SkMatrix44.h"
12 #include "SkRefCnt.h" 12 #include "SkRefCnt.h"
13 #include "../private/SkTemplates.h"
14 13
15 class SkColorSpace : public SkRefCnt { 14 class SkColorSpace : public SkRefCnt {
16 public: 15 public:
17 16
18 /** 17 /**
19 * Common, named profiles that we can recognize. 18 * Common, named profiles that we can recognize.
20 */ 19 */
21 enum Named { 20 enum Named {
22 kUnknown_Named, 21 kUnknown_Named,
23 kSRGB_Named, 22 kSRGB_Named,
24 kAdobeRGB_Named, 23 kAdobeRGB_Named,
25 }; 24 };
26 25
27 /** 26 /**
28 * Create an SkColorSpace from the src gamma and a transform from src gamut to D50 XYZ. 27 * Create an SkColorSpace from the src gamma and a transform from src gamut to D50 XYZ.
29 */ 28 */
30 static sk_sp<SkColorSpace> NewRGB(float gammas[3], const SkMatrix44& toXYZD5 0); 29 static sk_sp<SkColorSpace> NewRGB(const float gammas[3], const SkMatrix44& t oXYZD50);
31 30
32 /** 31 /**
33 * Create a common, named SkColorSpace. 32 * Create a common, named SkColorSpace.
34 */ 33 */
35 static sk_sp<SkColorSpace> NewNamed(Named); 34 static sk_sp<SkColorSpace> NewNamed(Named);
36 35
37 /** 36 /**
38 * Create an SkColorSpace from an ICC profile. 37 * Create an SkColorSpace from an ICC profile.
39 */ 38 */
40 static sk_sp<SkColorSpace> NewICC(const void*, size_t); 39 static sk_sp<SkColorSpace> NewICC(const void*, size_t);
(...skipping 13 matching lines...) Expand all
54 * applying the gamma. 53 * applying the gamma.
55 */ 54 */
56 kNonStandard_GammaNamed, 55 kNonStandard_GammaNamed,
57 }; 56 };
58 57
59 GammaNamed gammaNamed() const { return fGammaNamed; } 58 GammaNamed gammaNamed() const { return fGammaNamed; }
60 59
61 /** 60 /**
62 * Returns the matrix used to transform src gamut to XYZ D50. 61 * Returns the matrix used to transform src gamut to XYZ D50.
63 */ 62 */
64 SkMatrix44 xyz() const { return fToXYZD50; } 63 const SkMatrix44& xyz() const { return fToXYZD50; }
65 64
66 protected: 65 protected:
67 66
68 SkColorSpace(GammaNamed gammaNamed, const SkMatrix44& toXYZD50, Named named) ; 67 SkColorSpace(GammaNamed gammaNamed, const SkMatrix44& toXYZD50, Named named) ;
69 68
70 const GammaNamed fGammaNamed; 69 const GammaNamed fGammaNamed;
71 const SkMatrix44 fToXYZD50; 70 const SkMatrix44 fToXYZD50;
72 const Named fNamed; 71 const Named fNamed;
73 }; 72 };
74 73
75 #endif 74 #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