Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Side by Side Diff: ui/gfx/color_transform.cc

Issue 2333663003: Add color metadata info to VideoDecoderConfig. (Closed)
Patch Set: Remove resolution-based init for color_space_info_ Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 Kr, 1.0f - Kr - Kb, Kb, 0.0f, // 1 514 Kr, 1.0f - Kr - Kb, Kb, 0.0f, // 1
515 u_m * -Kr, u_m * -(1.0f - Kr - Kb), u_m * (1.0f - Kb), 0.5f, // 2 515 u_m * -Kr, u_m * -(1.0f - Kr - Kb), u_m * (1.0f - Kb), 0.5f, // 2
516 v_m * (1.0f - Kr), v_m * -(1.0f - Kr - Kb), v_m * -Kb, 0.5f, // 3 516 v_m * (1.0f - Kr), v_m * -(1.0f - Kr - Kb), v_m * -Kb, 0.5f, // 3
517 0.0f, 0.0f, 0.0f, 1.0f); // 4 517 0.0f, 0.0f, 0.0f, 1.0f); // 4
518 } 518 }
519 519
520 Transform GetRangeAdjustMatrix(ColorSpace::RangeID range, 520 Transform GetRangeAdjustMatrix(ColorSpace::RangeID range,
521 ColorSpace::MatrixID matrix) { 521 ColorSpace::MatrixID matrix) {
522 switch (range) { 522 switch (range) {
523 case ColorSpace::RangeID::FULL: 523 case ColorSpace::RangeID::FULL:
524 case ColorSpace::RangeID::UNSPECIFIED:
524 return Transform(); 525 return Transform();
525 526
527 case ColorSpace::RangeID::DERIVED:
526 case ColorSpace::RangeID::LIMITED: 528 case ColorSpace::RangeID::LIMITED:
527 break; 529 break;
528 } 530 }
529 switch (matrix) { 531 switch (matrix) {
530 case ColorSpace::MatrixID::RGB: 532 case ColorSpace::MatrixID::RGB:
531 case ColorSpace::MatrixID::YCOCG: 533 case ColorSpace::MatrixID::YCOCG:
532 return Transform(255.0f / 219.0f, 0.0f, 0.0f, -16.0f / 219.0f, // 1 534 return Transform(255.0f / 219.0f, 0.0f, 0.0f, -16.0f / 219.0f, // 1
533 0.0f, 255.0f / 219.0f, 0.0f, -16.0f / 219.0f, // 2 535 0.0f, 255.0f / 219.0f, 0.0f, -16.0f / 219.0f, // 2
534 0.0f, 0.0f, 255.0f / 219.0f, -16.0f / 219.0f, // 3 536 0.0f, 0.0f, 255.0f / 219.0f, -16.0f / 219.0f, // 3
535 0.0f, 0.0f, 0.0f, 1.0f); // 4 537 0.0f, 0.0f, 0.0f, 1.0f); // 4
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 std::unique_ptr<ColorTransform>( 730 std::unique_ptr<ColorTransform>(
729 new QCMSColorTransform(GetXYZD50Profile(), to_profile)))); 731 new QCMSColorTransform(GetXYZD50Profile(), to_profile))));
730 } else { 732 } else {
731 return std::unique_ptr<ColorTransform>( 733 return std::unique_ptr<ColorTransform>(
732 new ColorSpaceToColorSpaceTransform(from, to, intent)); 734 new ColorSpaceToColorSpaceTransform(from, to, intent));
733 } 735 }
734 } 736 }
735 } 737 }
736 738
737 } // namespace gfx 739 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698