| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_space.h" | 5 #include "ui/gfx/color_space.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <sstream> | 8 #include <sstream> |
| 9 | 9 |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 primaries.fRX = 0.630f; | 437 primaries.fRX = 0.630f; |
| 438 primaries.fRY = 0.340f; | 438 primaries.fRY = 0.340f; |
| 439 primaries.fGX = 0.310f; | 439 primaries.fGX = 0.310f; |
| 440 primaries.fGY = 0.595f; | 440 primaries.fGY = 0.595f; |
| 441 primaries.fBX = 0.155f; | 441 primaries.fBX = 0.155f; |
| 442 primaries.fBY = 0.070f; | 442 primaries.fBY = 0.070f; |
| 443 primaries.fWX = 0.3127f; | 443 primaries.fWX = 0.3127f; |
| 444 primaries.fWY = 0.3290f; | 444 primaries.fWY = 0.3290f; |
| 445 break; | 445 break; |
| 446 | 446 |
| 447 case ColorSpace::PrimaryID::APPLE_GENERIC_RGB: |
| 448 primaries.fRX = 0.63002f; |
| 449 primaries.fRY = 0.34000f; |
| 450 primaries.fGX = 0.29505f; |
| 451 primaries.fGY = 0.60498f; |
| 452 primaries.fBX = 0.15501f; |
| 453 primaries.fBY = 0.07701f; |
| 454 primaries.fWX = 0.3127f; |
| 455 primaries.fWY = 0.3290f; |
| 456 break; |
| 457 |
| 447 case ColorSpace::PrimaryID::FILM: | 458 case ColorSpace::PrimaryID::FILM: |
| 448 primaries.fRX = 0.681f; | 459 primaries.fRX = 0.681f; |
| 449 primaries.fRY = 0.319f; | 460 primaries.fRY = 0.319f; |
| 450 primaries.fGX = 0.243f; | 461 primaries.fGX = 0.243f; |
| 451 primaries.fGY = 0.692f; | 462 primaries.fGY = 0.692f; |
| 452 primaries.fBX = 0.145f; | 463 primaries.fBX = 0.145f; |
| 453 primaries.fBY = 0.049f; | 464 primaries.fBY = 0.049f; |
| 454 primaries.fWX = 0.310f; | 465 primaries.fWX = 0.310f; |
| 455 primaries.fWY = 0.136f; | 466 primaries.fWY = 0.136f; |
| 456 break; | 467 break; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 fn->fB = custom_transfer_params_[1]; | 551 fn->fB = custom_transfer_params_[1]; |
| 541 fn->fC = custom_transfer_params_[2]; | 552 fn->fC = custom_transfer_params_[2]; |
| 542 fn->fD = custom_transfer_params_[3]; | 553 fn->fD = custom_transfer_params_[3]; |
| 543 fn->fE = custom_transfer_params_[4]; | 554 fn->fE = custom_transfer_params_[4]; |
| 544 fn->fF = custom_transfer_params_[5]; | 555 fn->fF = custom_transfer_params_[5]; |
| 545 fn->fG = custom_transfer_params_[6]; | 556 fn->fG = custom_transfer_params_[6]; |
| 546 return true; | 557 return true; |
| 547 case ColorSpace::TransferID::LINEAR: | 558 case ColorSpace::TransferID::LINEAR: |
| 548 case ColorSpace::TransferID::LINEAR_HDR: | 559 case ColorSpace::TransferID::LINEAR_HDR: |
| 549 return true; | 560 return true; |
| 561 case ColorSpace::TransferID::GAMMA18: |
| 562 fn->fG = 1.801f; |
| 563 return true; |
| 550 case ColorSpace::TransferID::GAMMA22: | 564 case ColorSpace::TransferID::GAMMA22: |
| 551 fn->fG = 2.2f; | 565 fn->fG = 2.2f; |
| 552 return true; | 566 return true; |
| 553 case ColorSpace::TransferID::GAMMA24: | 567 case ColorSpace::TransferID::GAMMA24: |
| 554 fn->fG = 2.4f; | 568 fn->fG = 2.4f; |
| 555 return true; | 569 return true; |
| 556 case ColorSpace::TransferID::GAMMA28: | 570 case ColorSpace::TransferID::GAMMA28: |
| 557 fn->fG = 2.8f; | 571 fn->fG = 2.8f; |
| 558 return true; | 572 return true; |
| 559 case ColorSpace::TransferID::BT709: | 573 case ColorSpace::TransferID::BT709: |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 matrix->postTranslate(-16.0f/219.0f, -15.5f/224.0f, -15.5f/224.0f); | 747 matrix->postTranslate(-16.0f/219.0f, -15.5f/224.0f, -15.5f/224.0f); |
| 734 break; | 748 break; |
| 735 } | 749 } |
| 736 } | 750 } |
| 737 | 751 |
| 738 std::ostream& operator<<(std::ostream& out, const ColorSpace& color_space) { | 752 std::ostream& operator<<(std::ostream& out, const ColorSpace& color_space) { |
| 739 return out << color_space.ToString(); | 753 return out << color_space.ToString(); |
| 740 } | 754 } |
| 741 | 755 |
| 742 } // namespace gfx | 756 } // namespace gfx |
| OLD | NEW |