| 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 size_t GetHash() const; | 155 size_t GetHash() 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 // Returns true if the decoded values can be outside of the 0.0-1.0 range. |
| 159 bool IsHDR() const; | 159 bool IsHDR() const; |
| 160 // Returns true if the encoded values can be outside of the 0.0-1.0 range. | 160 // Returns true if the encoded values can be outside of the 0.0-1.0 range. |
| 161 bool FullRangeEncodedValues() const; | 161 bool FullRangeEncodedValues() const; |
| 162 | 162 |
| 163 // Returns true if this color space can be represented parametrically. |
| 164 bool IsParametric() const; |
| 165 // Return a parametric approximation of this color space (if it is not already |
| 166 // parametric). |
| 167 gfx::ColorSpace GetParametricApproximation() const; |
| 168 |
| 163 // Return this color space with any range adjust or YUV to RGB conversion | 169 // Return this color space with any range adjust or YUV to RGB conversion |
| 164 // stripped off. | 170 // stripped off. |
| 165 gfx::ColorSpace GetAsFullRangeRGB() const; | 171 gfx::ColorSpace GetAsFullRangeRGB() const; |
| 166 | 172 |
| 167 // This will return nullptr for non-RGB spaces, spaces with non-FULL | 173 // This will return nullptr for non-RGB spaces, spaces with non-FULL |
| 168 // range, and unspecified spaces. | 174 // range, and unspecified spaces. |
| 169 sk_sp<SkColorSpace> ToSkColorSpace() const; | 175 sk_sp<SkColorSpace> ToSkColorSpace() const; |
| 170 | 176 |
| 171 // Populate |icc_profile| with an ICC profile that represents this color | 177 // Populate |icc_profile| with an ICC profile that represents this color |
| 172 // space. Returns false if this space is not representable. | 178 // space. Returns false if this space is not representable. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 FRIEND_TEST_ALL_PREFIXES(SimpleColorSpace, GetColorSpace); | 217 FRIEND_TEST_ALL_PREFIXES(SimpleColorSpace, GetColorSpace); |
| 212 }; | 218 }; |
| 213 | 219 |
| 214 // Stream operator so ColorSpace can be used in assertion statements. | 220 // Stream operator so ColorSpace can be used in assertion statements. |
| 215 COLOR_SPACE_EXPORT std::ostream& operator<<(std::ostream& out, | 221 COLOR_SPACE_EXPORT std::ostream& operator<<(std::ostream& out, |
| 216 const ColorSpace& color_space); | 222 const ColorSpace& color_space); |
| 217 | 223 |
| 218 } // namespace gfx | 224 } // namespace gfx |
| 219 | 225 |
| 220 #endif // UI_GFX_COLOR_SPACE_H_ | 226 #endif // UI_GFX_COLOR_SPACE_H_ |
| OLD | NEW |