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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 // TODO: Remove these, and replace with more generic constructors. | 148 // TODO: Remove these, and replace with more generic constructors. |
149 static ColorSpace CreateJpeg(); | 149 static ColorSpace CreateJpeg(); |
150 static ColorSpace CreateREC601(); | 150 static ColorSpace CreateREC601(); |
151 static ColorSpace CreateREC709(); | 151 static ColorSpace CreateREC709(); |
152 | 152 |
153 bool operator==(const ColorSpace& other) const; | 153 bool operator==(const ColorSpace& other) const; |
154 bool operator!=(const ColorSpace& other) const; | 154 bool operator!=(const ColorSpace& other) const; |
155 bool operator<(const ColorSpace& other) const; | 155 bool operator<(const ColorSpace& other) const; |
156 std::string ToString() const; | 156 std::string ToString() const; |
157 | 157 |
| 158 // Returns true if the decoded values can be outside of the 0.0-1.0 range. |
158 bool IsHDR() const; | 159 bool IsHDR() const; |
| 160 // Returns true if the encoded values can be outside of the 0.0-1.0 range. |
| 161 bool FullRangeEncodedValues() const; |
159 | 162 |
160 // 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 |
161 // stripped off. | 164 // stripped off. |
162 gfx::ColorSpace GetAsFullRangeRGB() const; | 165 gfx::ColorSpace GetAsFullRangeRGB() const; |
163 | 166 |
164 // 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 |
165 // range, and unspecified spaces. | 168 // range, and unspecified spaces. |
166 sk_sp<SkColorSpace> ToSkColorSpace() const; | 169 sk_sp<SkColorSpace> ToSkColorSpace() const; |
167 | 170 |
168 // Return an SkColorSpace that represents this color space, with output-space | 171 // Return an SkColorSpace that represents this color space, with output-space |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 FRIEND_TEST_ALL_PREFIXES(SimpleColorSpace, GetColorSpace); | 216 FRIEND_TEST_ALL_PREFIXES(SimpleColorSpace, GetColorSpace); |
214 }; | 217 }; |
215 | 218 |
216 // Stream operator so ColorSpace can be used in assertion statements. | 219 // Stream operator so ColorSpace can be used in assertion statements. |
217 GFX_EXPORT std::ostream& operator<<(std::ostream& out, | 220 GFX_EXPORT std::ostream& operator<<(std::ostream& out, |
218 const ColorSpace& color_space); | 221 const ColorSpace& color_space); |
219 | 222 |
220 } // namespace gfx | 223 } // namespace gfx |
221 | 224 |
222 #endif // UI_GFX_COLOR_SPACE_H_ | 225 #endif // UI_GFX_COLOR_SPACE_H_ |
OLD | NEW |