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 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
485 Kr, 1.0f - Kr - Kb, Kb, 0.0f, // 1 | 485 Kr, 1.0f - Kr - Kb, Kb, 0.0f, // 1 |
486 u_m * -Kr, u_m * -(1.0f - Kr - Kb), u_m * (1.0f - Kb), 0.5f, // 2 | 486 u_m * -Kr, u_m * -(1.0f - Kr - Kb), u_m * (1.0f - Kb), 0.5f, // 2 |
487 v_m * (1.0f - Kr), v_m * -(1.0f - Kr - Kb), v_m * -Kb, 0.5f, // 3 | 487 v_m * (1.0f - Kr), v_m * -(1.0f - Kr - Kb), v_m * -Kb, 0.5f, // 3 |
488 0.0f, 0.0f, 0.0f, 1.0f); // 4 | 488 0.0f, 0.0f, 0.0f, 1.0f); // 4 |
489 } | 489 } |
490 | 490 |
491 Transform GetRangeAdjustMatrix(ColorSpace::RangeID range, | 491 Transform GetRangeAdjustMatrix(ColorSpace::RangeID range, |
492 ColorSpace::MatrixID matrix) { | 492 ColorSpace::MatrixID matrix) { |
493 switch (range) { | 493 switch (range) { |
494 case ColorSpace::RangeID::FULL: | 494 case ColorSpace::RangeID::FULL: |
495 case ColorSpace::RangeID::UNSPECIFIED: | |
495 return Transform(); | 496 return Transform(); |
496 | 497 |
498 case ColorSpace::RangeID::DERIVED: | |
hubbe
2016/09/15 17:25:52
Also update color_transform_unittests.cc
servolk
2016/09/15 20:29:04
Done.
| |
497 case ColorSpace::RangeID::LIMITED: | 499 case ColorSpace::RangeID::LIMITED: |
498 break; | 500 break; |
499 } | 501 } |
500 switch (matrix) { | 502 switch (matrix) { |
501 case ColorSpace::MatrixID::RGB: | 503 case ColorSpace::MatrixID::RGB: |
502 case ColorSpace::MatrixID::YCOCG: | 504 case ColorSpace::MatrixID::YCOCG: |
503 return Transform(255.0f / 219.0f, 0.0f, 0.0f, -16.0f / 219.0f, // 1 | 505 return Transform(255.0f / 219.0f, 0.0f, 0.0f, -16.0f / 219.0f, // 1 |
504 0.0f, 255.0f / 219.0f, 0.0f, -16.0f / 219.0f, // 2 | 506 0.0f, 255.0f / 219.0f, 0.0f, -16.0f / 219.0f, // 2 |
505 0.0f, 0.0f, 255.0f / 219.0f, -16.0f / 219.0f, // 3 | 507 0.0f, 0.0f, 255.0f / 219.0f, -16.0f / 219.0f, // 3 |
506 0.0f, 0.0f, 0.0f, 1.0f); // 4 | 508 0.0f, 0.0f, 0.0f, 1.0f); // 4 |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
699 std::unique_ptr<ColorTransform>( | 701 std::unique_ptr<ColorTransform>( |
700 new QCMSColorTransform(GetXYZD50Profile(), to_profile)))); | 702 new QCMSColorTransform(GetXYZD50Profile(), to_profile)))); |
701 } else { | 703 } else { |
702 return std::unique_ptr<ColorTransform>( | 704 return std::unique_ptr<ColorTransform>( |
703 new ColorSpaceToColorSpaceTransform(from, to, intent)); | 705 new ColorSpaceToColorSpaceTransform(from, to, intent)); |
704 } | 706 } |
705 } | 707 } |
706 } | 708 } |
707 | 709 |
708 } // namespace gfx | 710 } // namespace gfx |
OLD | NEW |