OLD | NEW |
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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 169 |
170 /////////////////////////////////////////////////////////////////////////////// | 170 /////////////////////////////////////////////////////////////////////////////// |
171 | 171 |
172 enum SkColorProfileType { | 172 enum SkColorProfileType { |
173 kLinear_SkColorProfileType, | 173 kLinear_SkColorProfileType, |
174 kSRGB_SkColorProfileType, | 174 kSRGB_SkColorProfileType, |
175 | 175 |
176 kLastEnum_SkColorProfileType = kSRGB_SkColorProfileType | 176 kLastEnum_SkColorProfileType = kSRGB_SkColorProfileType |
177 }; | 177 }; |
178 | 178 |
| 179 enum class SkSourceGammaTreatment { |
| 180 kRespect, |
| 181 kIgnore, |
| 182 }; |
| 183 |
179 /** | 184 /** |
180 * Describe an image's dimensions and pixel type. | 185 * Describe an image's dimensions and pixel type. |
181 * Used for both src images and render-targets (surfaces). | 186 * Used for both src images and render-targets (surfaces). |
182 */ | 187 */ |
183 struct SK_API SkImageInfo { | 188 struct SK_API SkImageInfo { |
184 public: | 189 public: |
185 SkImageInfo() | 190 SkImageInfo() |
186 : fColorSpace(nullptr) | 191 : fColorSpace(nullptr) |
187 , fWidth(0) | 192 , fWidth(0) |
188 , fHeight(0) | 193 , fHeight(0) |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 | 371 |
367 static inline bool SkColorAndProfileAreGammaCorrect(SkColorType ct, SkColorProfi
leType pt) { | 372 static inline bool SkColorAndProfileAreGammaCorrect(SkColorType ct, SkColorProfi
leType pt) { |
368 return kSRGB_SkColorProfileType == pt || kRGBA_F16_SkColorType == ct; | 373 return kSRGB_SkColorProfileType == pt || kRGBA_F16_SkColorType == ct; |
369 } | 374 } |
370 | 375 |
371 static inline bool SkImageInfoIsGammaCorrect(const SkImageInfo& info) { | 376 static inline bool SkImageInfoIsGammaCorrect(const SkImageInfo& info) { |
372 return SkColorAndProfileAreGammaCorrect(info.colorType(), info.profileType()
); | 377 return SkColorAndProfileAreGammaCorrect(info.colorType(), info.profileType()
); |
373 } | 378 } |
374 | 379 |
375 #endif | 380 #endif |
OLD | NEW |