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 #include "ui/gfx/color_space.h" | 5 #include "ui/gfx/color_space.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <sstream> | 8 #include <sstream> |
9 | 9 |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 return true; | 276 return true; |
277 } | 277 } |
278 | 278 |
279 bool ColorSpace::IsHDR() const { | 279 bool ColorSpace::IsHDR() const { |
280 return transfer_ == TransferID::SMPTEST2084 || | 280 return transfer_ == TransferID::SMPTEST2084 || |
281 transfer_ == TransferID::ARIB_STD_B67 || | 281 transfer_ == TransferID::ARIB_STD_B67 || |
282 transfer_ == TransferID::LINEAR_HDR || | 282 transfer_ == TransferID::LINEAR_HDR || |
283 transfer_ == TransferID::IEC61966_2_1_HDR; | 283 transfer_ == TransferID::IEC61966_2_1_HDR; |
284 } | 284 } |
285 | 285 |
| 286 bool ColorSpace::FullRangeEncodedValues() const { |
| 287 return transfer_ == TransferID::LINEAR_HDR || |
| 288 transfer_ == TransferID::IEC61966_2_1_HDR || |
| 289 transfer_ == TransferID::BT1361_ECG || |
| 290 transfer_ == TransferID::IEC61966_2_4; |
| 291 } |
| 292 |
286 bool ColorSpace::operator!=(const ColorSpace& other) const { | 293 bool ColorSpace::operator!=(const ColorSpace& other) const { |
287 return !(*this == other); | 294 return !(*this == other); |
288 } | 295 } |
289 | 296 |
290 bool ColorSpace::operator<(const ColorSpace& other) const { | 297 bool ColorSpace::operator<(const ColorSpace& other) const { |
291 if (primaries_ < other.primaries_) | 298 if (primaries_ < other.primaries_) |
292 return true; | 299 return true; |
293 if (primaries_ > other.primaries_) | 300 if (primaries_ > other.primaries_) |
294 return false; | 301 return false; |
295 if (transfer_ < other.transfer_) | 302 if (transfer_ < other.transfer_) |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
830 matrix->postTranslate(-16.0f/219.0f, -15.5f/224.0f, -15.5f/224.0f); | 837 matrix->postTranslate(-16.0f/219.0f, -15.5f/224.0f, -15.5f/224.0f); |
831 break; | 838 break; |
832 } | 839 } |
833 } | 840 } |
834 | 841 |
835 std::ostream& operator<<(std::ostream& out, const ColorSpace& color_space) { | 842 std::ostream& operator<<(std::ostream& out, const ColorSpace& color_space) { |
836 return out << color_space.ToString(); | 843 return out << color_space.ToString(); |
837 } | 844 } |
838 | 845 |
839 } // namespace gfx | 846 } // namespace gfx |
OLD | NEW |