OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_GFX_COLOR_SPACE_H_ | 5 #ifndef UI_GFX_COLOR_SPACE_H_ |
6 #define UI_GFX_COLOR_SPACE_H_ | 6 #define UI_GFX_COLOR_SPACE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <ostream> | 9 #include <ostream> |
10 | 10 |
11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/pickle.h" |
13 #include "build/build_config.h" | 14 #include "build/build_config.h" |
14 #include "third_party/skia/include/core/SkColorSpace.h" | 15 #include "third_party/skia/include/core/SkColorSpace.h" |
15 #include "ui/gfx/gfx_export.h" | 16 #include "ui/gfx/gfx_export.h" |
16 | 17 |
17 namespace IPC { | 18 namespace IPC { |
18 template <class P> | 19 template <class P> |
19 struct ParamTraits; | 20 struct ParamTraits; |
20 } // namespace IPC | 21 } // namespace IPC |
21 | 22 |
22 namespace gfx { | 23 namespace gfx { |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 bool FullRangeEncodedValues() const; | 160 bool FullRangeEncodedValues() const; |
160 | 161 |
161 // Return this color space with any range adjust or YUV to RGB conversion | 162 // Return this color space with any range adjust or YUV to RGB conversion |
162 // stripped off. | 163 // stripped off. |
163 gfx::ColorSpace GetAsFullRangeRGB() const; | 164 gfx::ColorSpace GetAsFullRangeRGB() const; |
164 | 165 |
165 // This will return nullptr for non-RGB spaces, spaces with non-FULL | 166 // This will return nullptr for non-RGB spaces, spaces with non-FULL |
166 // range, and unspecified spaces. | 167 // range, and unspecified spaces. |
167 sk_sp<SkColorSpace> ToSkColorSpace() const; | 168 sk_sp<SkColorSpace> ToSkColorSpace() const; |
168 | 169 |
| 170 bool Serialize(base::Pickle* pickle) const; |
| 171 bool ReadFromPickle(base::PickleIterator* iter); |
| 172 |
169 // Populate |icc_profile| with an ICC profile that represents this color | 173 // Populate |icc_profile| with an ICC profile that represents this color |
170 // space. Returns false if this space is not representable. | 174 // space. Returns false if this space is not representable. |
171 bool GetICCProfile(ICCProfile* icc_profile) const; | 175 bool GetICCProfile(ICCProfile* icc_profile) const; |
172 | 176 |
173 void GetPrimaryMatrix(SkMatrix44* to_XYZD50) const; | 177 void GetPrimaryMatrix(SkMatrix44* to_XYZD50) const; |
174 bool GetTransferFunction(SkColorSpaceTransferFn* fn) const; | 178 bool GetTransferFunction(SkColorSpaceTransferFn* fn) const; |
175 bool GetInverseTransferFunction(SkColorSpaceTransferFn* fn) const; | 179 bool GetInverseTransferFunction(SkColorSpaceTransferFn* fn) const; |
176 | 180 |
177 // For most formats, this is the RGB to YUV matrix. | 181 // For most formats, this is the RGB to YUV matrix. |
178 void GetTransferMatrix(SkMatrix44* matrix) const; | 182 void GetTransferMatrix(SkMatrix44* matrix) const; |
(...skipping 30 matching lines...) Expand all Loading... |
209 FRIEND_TEST_ALL_PREFIXES(SimpleColorSpace, GetColorSpace); | 213 FRIEND_TEST_ALL_PREFIXES(SimpleColorSpace, GetColorSpace); |
210 }; | 214 }; |
211 | 215 |
212 // Stream operator so ColorSpace can be used in assertion statements. | 216 // Stream operator so ColorSpace can be used in assertion statements. |
213 GFX_EXPORT std::ostream& operator<<(std::ostream& out, | 217 GFX_EXPORT std::ostream& operator<<(std::ostream& out, |
214 const ColorSpace& color_space); | 218 const ColorSpace& color_space); |
215 | 219 |
216 } // namespace gfx | 220 } // namespace gfx |
217 | 221 |
218 #endif // UI_GFX_COLOR_SPACE_H_ | 222 #endif // UI_GFX_COLOR_SPACE_H_ |
OLD | NEW |