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

Unified Diff: ui/gfx/color_space.cc

Issue 2841813002: Converting video color space enums to their corresponding gfx:color space eqvivalent. (Closed)
Patch Set: Fixed ==> "warning C4701: potentially uninitialized local variable 'primary_id' used" Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/color_space.h ('k') | ui/gfx/color_transform_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/color_space.cc
diff --git a/ui/gfx/color_space.cc b/ui/gfx/color_space.cc
index ef58e58039468528d7b56fd2683f8f2926a03bb7..2bb99827fad02667070cbce17df6d6dc1225e7a3 100644
--- a/ui/gfx/color_space.cc
+++ b/ui/gfx/color_space.cc
@@ -17,142 +17,6 @@
namespace gfx {
-// static
-ColorSpace ColorSpace::CreateVideo(int video_primary,
- int video_transfer,
- int video_matrix,
- RangeID range_id) {
- // TODO(hubbe): Use more context to decide how to handle UNSPECIFIED values.
- ColorSpace result;
- switch (video_primary) {
- default:
- case 0: // RESERVED0
- case 1: // BT709
- case 2: // UNSPECIFIED
- case 3: // RESERVED
- result.primaries_ = PrimaryID::BT709;
- break;
- case 4: // BT470M
- result.primaries_ = PrimaryID::BT470M;
- break;
- case 5: // BT470BG
- result.primaries_ = PrimaryID::BT470BG;
- break;
- case 6: // SMPTE170M
- result.primaries_ = PrimaryID::SMPTE170M;
- break;
- case 7: // SMPTE240M
- result.primaries_ = PrimaryID::SMPTE240M;
- break;
- case 8: // FILM
- result.primaries_ = PrimaryID::FILM;
- break;
- case 9: // BT2020
- result.primaries_ = PrimaryID::BT2020;
- break;
- case 10: // SMPTEST428_1
- result.primaries_ = PrimaryID::SMPTEST428_1;
- break;
- case 11: // SMPTEST431_2
- result.primaries_ = PrimaryID::SMPTEST431_2;
- break;
- case 12: // SMPTEST432_1
- result.primaries_ = PrimaryID::SMPTEST432_1;
- break;
- }
- switch (video_transfer) {
- default:
- case 0: // RESERVED0
- case 1: // BT709
- case 2: // UNSPECIFIED
- case 3: // RESERVED
- result.transfer_ = TransferID::BT709;
- break;
- case 4: // GAMMA22
- result.transfer_ = TransferID::GAMMA22;
- break;
- case 5: // GAMMA28
- result.transfer_ = TransferID::GAMMA28;
- break;
- case 6: // SMPTE170M
- result.transfer_ = TransferID::SMPTE170M;
- break;
- case 7: // SMPTE240M
- result.transfer_ = TransferID::SMPTE240M;
- break;
- case 8: // LINEAR
- result.transfer_ = TransferID::LINEAR;
- break;
- case 9: // LOG
- result.transfer_ = TransferID::LOG;
- break;
- case 10: // LOG_SQRT
- result.transfer_ = TransferID::LOG_SQRT;
- break;
- case 11: // IEC61966_2_4
- result.transfer_ = TransferID::IEC61966_2_4;
- break;
- case 12: // BT1361_ECG
- result.transfer_ = TransferID::BT1361_ECG;
- break;
- case 13: // IEC61966_2_1
- result.transfer_ = TransferID::IEC61966_2_1;
- break;
- case 14: // BT2020_10
- result.transfer_ = TransferID::BT2020_10;
- break;
- case 15: // BT2020_12
- result.transfer_ = TransferID::BT2020_12;
- break;
- case 16: // SMPTEST2084
- result.transfer_ = TransferID::SMPTEST2084;
- break;
- case 17: // SMPTEST428_1
- result.transfer_ = TransferID::SMPTEST428_1;
- break;
- case 18: // ARIB_STD_B67
- result.transfer_ = TransferID::ARIB_STD_B67;
- break;
- }
- switch (video_matrix) {
- case 0: // RGB
- result.matrix_ = MatrixID::RGB;
- break;
- default:
- case 1: // BT709
- case 2: // UNSPECIFIED
- case 3: // RESERVED
- result.matrix_ = MatrixID::BT709;
- break;
- case 4: // FCC
- result.matrix_ = MatrixID::FCC;
- break;
- case 5: // BT470BG
- result.matrix_ = MatrixID::BT470BG;
- break;
- case 6: // SMPTE170M
- result.matrix_ = MatrixID::SMPTE170M;
- break;
- case 7: // SMPTE240M
- result.matrix_ = MatrixID::SMPTE240M;
- break;
- case 8: // YCOCG
- result.matrix_ = MatrixID::YCOCG;
- break;
- case 9: // BT2020_NCL
- result.matrix_ = MatrixID::BT2020_NCL;
- break;
- case 10: // BT2020_CL
- result.matrix_ = MatrixID::BT2020_CL;
- break;
- case 11: // YDZDX
- result.matrix_ = MatrixID::YDZDX;
- break;
- }
- result.range_ = range_id;
- return result;
-}
-
ColorSpace::ColorSpace() {}
ColorSpace::ColorSpace(PrimaryID primaries,
« no previous file with comments | « ui/gfx/color_space.h ('k') | ui/gfx/color_transform_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698