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 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 bool FullRangeEncodedValues() const; | 161 bool FullRangeEncodedValues() const; |
162 | 162 |
163 // Return this color space with any range adjust or YUV to RGB conversion | 163 // Return this color space with any range adjust or YUV to RGB conversion |
164 // stripped off. | 164 // stripped off. |
165 gfx::ColorSpace GetAsFullRangeRGB() const; | 165 gfx::ColorSpace GetAsFullRangeRGB() const; |
166 | 166 |
167 // This will return nullptr for non-RGB spaces, spaces with non-FULL | 167 // This will return nullptr for non-RGB spaces, spaces with non-FULL |
168 // range, and unspecified spaces. | 168 // range, and unspecified spaces. |
169 sk_sp<SkColorSpace> ToSkColorSpace() const; | 169 sk_sp<SkColorSpace> ToSkColorSpace() const; |
170 | 170 |
171 // Return an SkColorSpace that represents this color space, with output-space | |
172 // blending (which is only linear for color spaces with a linear tranasfer | |
173 // function). | |
174 sk_sp<SkColorSpace> ToNonlinearBlendedSkColorSpace() const; | |
175 | |
176 // Populate |icc_profile| with an ICC profile that represents this color | 171 // Populate |icc_profile| with an ICC profile that represents this color |
177 // space. Returns false if this space is not representable. | 172 // space. Returns false if this space is not representable. |
178 bool GetICCProfile(ICCProfile* icc_profile) const; | 173 bool GetICCProfile(ICCProfile* icc_profile) const; |
179 | 174 |
180 void GetPrimaryMatrix(SkMatrix44* to_XYZD50) const; | 175 void GetPrimaryMatrix(SkMatrix44* to_XYZD50) const; |
181 bool GetTransferFunction(SkColorSpaceTransferFn* fn) const; | 176 bool GetTransferFunction(SkColorSpaceTransferFn* fn) const; |
182 bool GetInverseTransferFunction(SkColorSpaceTransferFn* fn) const; | 177 bool GetInverseTransferFunction(SkColorSpaceTransferFn* fn) const; |
183 | 178 |
184 // For most formats, this is the RGB to YUV matrix. | 179 // For most formats, this is the RGB to YUV matrix. |
185 void GetTransferMatrix(SkMatrix44* matrix) const; | 180 void GetTransferMatrix(SkMatrix44* matrix) const; |
(...skipping 30 matching lines...) Expand all Loading... |
216 FRIEND_TEST_ALL_PREFIXES(SimpleColorSpace, GetColorSpace); | 211 FRIEND_TEST_ALL_PREFIXES(SimpleColorSpace, GetColorSpace); |
217 }; | 212 }; |
218 | 213 |
219 // Stream operator so ColorSpace can be used in assertion statements. | 214 // Stream operator so ColorSpace can be used in assertion statements. |
220 GFX_EXPORT std::ostream& operator<<(std::ostream& out, | 215 GFX_EXPORT std::ostream& operator<<(std::ostream& out, |
221 const ColorSpace& color_space); | 216 const ColorSpace& color_space); |
222 | 217 |
223 } // namespace gfx | 218 } // namespace gfx |
224 | 219 |
225 #endif // UI_GFX_COLOR_SPACE_H_ | 220 #endif // UI_GFX_COLOR_SPACE_H_ |
OLD | NEW |