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

Side by Side Diff: src/core/SkColorSpace_Base.h

Issue 1996973002: Make SkColorSpace a public API (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove SkColorSpace.h from gyp 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 | « src/core/SkColorSpacePriv.h ('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 SkColorSpacePriv_DEFINED 8 #ifndef SkColorSpace_Base_DEFINED
9 #define SkColorSpacePriv_DEFINED 9 #define SkColorSpace_Base_DEFINED
10
11 #include "SkColorSpace.h"
10 12
11 struct SkGammaCurve { 13 struct SkGammaCurve {
12 bool isValue() const { 14 bool isValue() const {
13 bool result = (0.0f != fValue); 15 bool result = (0.0f != fValue);
14 SkASSERT(!result || (0 == fTableSize)); 16 SkASSERT(!result || (0 == fTableSize));
15 return result; 17 return result;
16 } 18 }
17 19
18 bool isTable() const { 20 bool isTable() const {
19 bool result = (0 != fTableSize); 21 bool result = (0 != fTableSize);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 uint8_t fInputChannels; 81 uint8_t fInputChannels;
80 uint8_t fOutputChannels; 82 uint8_t fOutputChannels;
81 uint8_t fGridPoints[kMaxChannels]; 83 uint8_t fGridPoints[kMaxChannels];
82 std::unique_ptr<float[]> fTable; 84 std::unique_ptr<float[]> fTable;
83 85
84 SkColorLookUpTable() { 86 SkColorLookUpTable() {
85 memset(this, 0, sizeof(struct SkColorLookUpTable)); 87 memset(this, 0, sizeof(struct SkColorLookUpTable));
86 } 88 }
87 }; 89 };
88 90
91 class SkColorSpace_Base : public SkColorSpace {
92 public:
93
94 SkGammas* gammas() const { return fGammas.get(); }
95
96 private:
97
98 SkColorSpace_Base(sk_sp<SkGammas> gammas, const SkMatrix44& toXYZ, Named);
99
100 SkColorSpace_Base(sk_sp<SkGammas> gammas, GammaNamed gammaNamed, const SkMat rix44& toXYZ,
101 Named);
102
103 SkColorSpace_Base(SkColorLookUpTable* colorLUT, sk_sp<SkGammas> gammas,
104 const SkMatrix44& toXYZ);
105
106 SkAutoTDelete<SkColorLookUpTable> fColorLUT;
107 sk_sp<SkGammas> fGammas;
108
109 friend class SkColorSpace;
110 typedef SkColorSpace INHERITED;
111 };
112
113 static inline SkColorSpace_Base* as_CSB(SkColorSpace* colorSpace) {
114 return static_cast<SkColorSpace_Base*>(colorSpace);
115 }
116
89 #endif 117 #endif
OLDNEW
« no previous file with comments | « src/core/SkColorSpacePriv.h ('k') | tests/ColorSpaceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698