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 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
725 | 725 |
726 ColorTransformInternal::ColorTransformInternal(const ColorSpace& src, | 726 ColorTransformInternal::ColorTransformInternal(const ColorSpace& src, |
727 const ColorSpace& dst, | 727 const ColorSpace& dst, |
728 Intent intent) | 728 Intent intent) |
729 : src_(src), dst_(dst) { | 729 : src_(src), dst_(dst) { |
730 // If no source color space is specified, do no transformation. | 730 // If no source color space is specified, do no transformation. |
731 // TODO(ccameron): We may want dst assume sRGB at some point in the future. | 731 // TODO(ccameron): We may want dst assume sRGB at some point in the future. |
732 if (!src_.IsValid()) | 732 if (!src_.IsValid()) |
733 return; | 733 return; |
734 | 734 |
735 ScopedQcmsProfile src_profile = GetQCMSProfileIfNecessary(src_); | 735 // If the dst profile is not set, then do only YUV to RGB conversion, so |
hubbe
2017/02/21 22:46:49
I'm afraid I don't get this.
When does this happen
ccameron
2017/02/22 00:08:29
This happens whenever media::kVideoColorManagement
hubbe
2017/02/22 00:10:05
Can we add some more meat to the comment to descri
ccameron
2017/02/22 00:30:48
Done.
| |
736 ScopedQcmsProfile dst_profile = GetQCMSProfileIfNecessary(dst_); | 736 // ignore any ICC profiles. |
737 ScopedQcmsProfile src_profile; | |
738 ScopedQcmsProfile dst_profile; | |
739 if (dst.IsValid()) { | |
740 src_profile = GetQCMSProfileIfNecessary(src_); | |
741 dst_profile = GetQCMSProfileIfNecessary(dst_); | |
742 } | |
737 bool has_src_profile = !!src_profile; | 743 bool has_src_profile = !!src_profile; |
738 bool has_dst_profile = !!dst_profile; | 744 bool has_dst_profile = !!dst_profile; |
739 | 745 |
740 if (src_profile) { | 746 if (src_profile) { |
741 steps_.push_back(base::MakeUnique<QCMSColorTransform>( | 747 steps_.push_back(base::MakeUnique<QCMSColorTransform>( |
742 std::move(src_profile), GetXYZD50Profile())); | 748 std::move(src_profile), GetXYZD50Profile())); |
743 } | 749 } |
744 | 750 |
745 AppendColorSpaceToColorSpaceTransform( | 751 AppendColorSpaceToColorSpaceTransform( |
746 has_src_profile ? ColorSpace::CreateXYZD50() : src_, | 752 has_src_profile ? ColorSpace::CreateXYZD50() : src_, |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
812 const ColorSpace& to, | 818 const ColorSpace& to, |
813 Intent intent) { | 819 Intent intent) { |
814 return std::unique_ptr<ColorTransform>( | 820 return std::unique_ptr<ColorTransform>( |
815 new ColorTransformInternal(from, to, intent)); | 821 new ColorTransformInternal(from, to, intent)); |
816 } | 822 } |
817 | 823 |
818 ColorTransform::ColorTransform() {} | 824 ColorTransform::ColorTransform() {} |
819 ColorTransform::~ColorTransform() {} | 825 ColorTransform::~ColorTransform() {} |
820 | 826 |
821 } // namespace gfx | 827 } // namespace gfx |
OLD | NEW |