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 <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <list> | 9 #include <list> |
10 #include <memory> | 10 #include <memory> |
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 private: | 535 private: |
536 bool null_ = false; | 536 bool null_ = false; |
537 }; | 537 }; |
538 | 538 |
539 void ColorTransformInternal::AppendColorSpaceToColorSpaceTransform( | 539 void ColorTransformInternal::AppendColorSpaceToColorSpaceTransform( |
540 ColorSpace from, | 540 ColorSpace from, |
541 const ColorSpace& to, | 541 const ColorSpace& to, |
542 ColorTransform::Intent intent) { | 542 ColorTransform::Intent intent) { |
543 if (intent == ColorTransform::Intent::INTENT_PERCEPTUAL) { | 543 if (intent == ColorTransform::Intent::INTENT_PERCEPTUAL) { |
544 switch (from.transfer_) { | 544 switch (from.transfer_) { |
545 case ColorSpace::TransferID::UNSPECIFIED: | |
546 case ColorSpace::TransferID::BT709: | 545 case ColorSpace::TransferID::BT709: |
547 case ColorSpace::TransferID::SMPTE170M: | 546 case ColorSpace::TransferID::SMPTE170M: |
548 // SMPTE 1886 suggests that we should be using gamma 2.4 for BT709 | 547 // SMPTE 1886 suggests that we should be using gamma 2.4 for BT709 |
549 // content. However, most displays actually use a gamma of 2.2, and | 548 // content. However, most displays actually use a gamma of 2.2, and |
550 // user studies shows that users don't really care. Using the same | 549 // user studies shows that users don't really care. Using the same |
551 // gamma as the display will let us optimize a lot more, so lets stick | 550 // gamma as the display will let us optimize a lot more, so lets stick |
552 // with using the SRGB transfer function. | 551 // with using the SRGB transfer function. |
553 from.transfer_ = ColorSpace::TransferID::IEC61966_2_1; | 552 from.transfer_ = ColorSpace::TransferID::IEC61966_2_1; |
554 break; | 553 break; |
555 | 554 |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
748 const ColorSpace& to, | 747 const ColorSpace& to, |
749 Intent intent) { | 748 Intent intent) { |
750 return std::unique_ptr<ColorTransform>( | 749 return std::unique_ptr<ColorTransform>( |
751 new ColorTransformInternal(from, to, intent)); | 750 new ColorTransformInternal(from, to, intent)); |
752 } | 751 } |
753 | 752 |
754 ColorTransform::ColorTransform() {} | 753 ColorTransform::ColorTransform() {} |
755 ColorTransform::~ColorTransform() {} | 754 ColorTransform::~ColorTransform() {} |
756 | 755 |
757 } // namespace gfx | 756 } // namespace gfx |
OLD | NEW |