OLD | NEW |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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_transform.h" | 5 #include "ui/gfx/color_transform.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "ui/gfx/color_space.h" | 10 #include "ui/gfx/color_space.h" |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 // See SMPTE 1886 | 567 // See SMPTE 1886 |
568 from_.transfer_ = ColorSpace::TransferID::GAMMA24; | 568 from_.transfer_ = ColorSpace::TransferID::GAMMA24; |
569 break; | 569 break; |
570 | 570 |
571 case ColorSpace::TransferID::SMPTEST2084: | 571 case ColorSpace::TransferID::SMPTEST2084: |
572 // We don't have an HDR display, so replace SMPTE 2084 with something | 572 // We don't have an HDR display, so replace SMPTE 2084 with something |
573 // that returns ranges more or less suitable for a normal display. | 573 // that returns ranges more or less suitable for a normal display. |
574 from_.transfer_ = ColorSpace::TransferID::SMPTEST2084_NON_HDR; | 574 from_.transfer_ = ColorSpace::TransferID::SMPTEST2084_NON_HDR; |
575 break; | 575 break; |
576 | 576 |
| 577 case ColorSpace::TransferID::ARIB_STD_B67: |
| 578 // Interpreting HLG using a gamma 2.4 works reasonably well for SDR |
| 579 // displays. Once we have HDR output capabilies, we'll need to |
| 580 // change this. |
| 581 from_.transfer_ = ColorSpace::TransferID::GAMMA24; |
| 582 break; |
| 583 |
577 default: // Do nothing | 584 default: // Do nothing |
578 break; | 585 break; |
579 } | 586 } |
580 | 587 |
581 // TODO(hubbe): shrink gamuts here (never stretch gamuts) | 588 // TODO(hubbe): shrink gamuts here (never stretch gamuts) |
582 } | 589 } |
583 | 590 |
584 Transform* from_transfer_matrix = | 591 Transform* from_transfer_matrix = |
585 from_.matrix_ == ColorSpace::MatrixID::BT2020_CL ? &b_ : &a_; | 592 from_.matrix_ == ColorSpace::MatrixID::BT2020_CL ? &b_ : &a_; |
586 Transform* to_transfer_matrix = | 593 Transform* to_transfer_matrix = |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
728 std::unique_ptr<ColorTransform>( | 735 std::unique_ptr<ColorTransform>( |
729 new QCMSColorTransform(GetXYZD50Profile(), to_profile)))); | 736 new QCMSColorTransform(GetXYZD50Profile(), to_profile)))); |
730 } else { | 737 } else { |
731 return std::unique_ptr<ColorTransform>( | 738 return std::unique_ptr<ColorTransform>( |
732 new ColorSpaceToColorSpaceTransform(from, to, intent)); | 739 new ColorSpaceToColorSpaceTransform(from, to, intent)); |
733 } | 740 } |
734 } | 741 } |
735 } | 742 } |
736 | 743 |
737 } // namespace gfx | 744 } // namespace gfx |
OLD | NEW |