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 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 Kr, 1.0f - Kr - Kb, Kb, 0.0f, // 1 | 548 Kr, 1.0f - Kr - Kb, Kb, 0.0f, // 1 |
549 u_m * -Kr, u_m * -(1.0f - Kr - Kb), u_m * (1.0f - Kb), 0.5f, // 2 | 549 u_m * -Kr, u_m * -(1.0f - Kr - Kb), u_m * (1.0f - Kb), 0.5f, // 2 |
550 v_m * (1.0f - Kr), v_m * -(1.0f - Kr - Kb), v_m * -Kb, 0.5f, // 3 | 550 v_m * (1.0f - Kr), v_m * -(1.0f - Kr - Kb), v_m * -Kb, 0.5f, // 3 |
551 0.0f, 0.0f, 0.0f, 1.0f); // 4 | 551 0.0f, 0.0f, 0.0f, 1.0f); // 4 |
552 } | 552 } |
553 | 553 |
554 Transform GetRangeAdjustMatrix(ColorSpace::RangeID range, | 554 Transform GetRangeAdjustMatrix(ColorSpace::RangeID range, |
555 ColorSpace::MatrixID matrix) { | 555 ColorSpace::MatrixID matrix) { |
556 switch (range) { | 556 switch (range) { |
557 case ColorSpace::RangeID::FULL: | 557 case ColorSpace::RangeID::FULL: |
| 558 case ColorSpace::RangeID::UNSPECIFIED: |
558 return Transform(); | 559 return Transform(); |
559 | 560 |
| 561 case ColorSpace::RangeID::DERIVED: |
560 case ColorSpace::RangeID::LIMITED: | 562 case ColorSpace::RangeID::LIMITED: |
561 break; | 563 break; |
562 } | 564 } |
563 switch (matrix) { | 565 switch (matrix) { |
564 case ColorSpace::MatrixID::RGB: | 566 case ColorSpace::MatrixID::RGB: |
565 case ColorSpace::MatrixID::YCOCG: | 567 case ColorSpace::MatrixID::YCOCG: |
566 return Transform(255.0f / 219.0f, 0.0f, 0.0f, -16.0f / 219.0f, // 1 | 568 return Transform(255.0f / 219.0f, 0.0f, 0.0f, -16.0f / 219.0f, // 1 |
567 0.0f, 255.0f / 219.0f, 0.0f, -16.0f / 219.0f, // 2 | 569 0.0f, 255.0f / 219.0f, 0.0f, -16.0f / 219.0f, // 2 |
568 0.0f, 0.0f, 255.0f / 219.0f, -16.0f / 219.0f, // 3 | 570 0.0f, 0.0f, 255.0f / 219.0f, -16.0f / 219.0f, // 3 |
569 0.0f, 0.0f, 0.0f, 1.0f); // 4 | 571 0.0f, 0.0f, 0.0f, 1.0f); // 4 |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 std::unique_ptr<ColorTransform>( | 772 std::unique_ptr<ColorTransform>( |
771 new QCMSColorTransform(GetXYZD50Profile(), to_profile)))); | 773 new QCMSColorTransform(GetXYZD50Profile(), to_profile)))); |
772 } else { | 774 } else { |
773 return std::unique_ptr<ColorTransform>( | 775 return std::unique_ptr<ColorTransform>( |
774 new ColorSpaceToColorSpaceTransform(from, to, intent)); | 776 new ColorSpaceToColorSpaceTransform(from, to, intent)); |
775 } | 777 } |
776 } | 778 } |
777 } | 779 } |
778 | 780 |
779 } // namespace gfx | 781 } // namespace gfx |
OLD | NEW |