Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #ifndef MEDIA_BASE_VIDEO_COLOR_SPACE_H_ | 5 #ifndef MEDIA_BASE_VIDEO_COLOR_SPACE_H_ |
| 6 #define MEDIA_BASE_VIDEO_COLOR_SPACE_H_ | 6 #define MEDIA_BASE_VIDEO_COLOR_SPACE_H_ |
| 7 | 7 |
| 8 #include "media/base/media_export.h" | 8 #include "media/base/media_export.h" |
| 9 #include "ui/gfx/color_space.h" | 9 #include "ui/gfx/color_space.h" |
| 10 | 10 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 63 BT470BG = 5, | 63 BT470BG = 5, |
| 64 SMPTE170M = 6, | 64 SMPTE170M = 6, |
| 65 SMPTE240M = 7, | 65 SMPTE240M = 7, |
| 66 YCOCG = 8, | 66 YCOCG = 8, |
| 67 BT2020_NCL = 9, | 67 BT2020_NCL = 9, |
| 68 BT2020_CL = 10, | 68 BT2020_CL = 10, |
| 69 YDZDX = 11, | 69 YDZDX = 11, |
| 70 INVALID = 255, | 70 INVALID = 255, |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 union PrimaryIDUnion { | |
| 74 PrimaryID primaries; | |
| 75 uint8_t primary_id; | |
| 76 }; | |
| 77 | |
| 78 union TransferIDUnion { | |
| 79 TransferID transfer; | |
| 80 uint8_t transfer_id; | |
| 81 }; | |
| 82 | |
| 83 union MatrixIDUnion { | |
| 84 MatrixID matrix; | |
| 85 uint8_t matrix_id; | |
| 86 }; | |
| 87 | |
| 73 VideoColorSpace(); | 88 VideoColorSpace(); |
| 74 VideoColorSpace(int primaries, | 89 VideoColorSpace(int primaries, |
| 75 int transfer, | 90 int transfer, |
| 76 int matrix, | 91 int matrix, |
| 77 gfx::ColorSpace::RangeID range); | 92 gfx::ColorSpace::RangeID range); |
| 78 VideoColorSpace(PrimaryID primaries, | 93 VideoColorSpace(PrimaryID primaries, |
| 79 TransferID transfer, | 94 TransferID transfer, |
| 80 MatrixID matrix, | 95 MatrixID matrix, |
| 81 gfx::ColorSpace::RangeID range); | 96 gfx::ColorSpace::RangeID range); |
| 82 | 97 |
| 83 bool operator==(const VideoColorSpace& other) const; | 98 bool operator==(const VideoColorSpace& other) const; |
| 84 bool operator!=(const VideoColorSpace& other) const; | 99 bool operator!=(const VideoColorSpace& other) const; |
| 85 | 100 |
| 86 // These will return INVALID if the number you give it | 101 // These will return INVALID if the number you give it |
| 87 // is not a valid enum value. | 102 // is not a valid enum value. |
| 88 static PrimaryID GetPrimaryID(int primary); | 103 static PrimaryID GetPrimaryID(int primary); |
| 89 static TransferID GetTransferID(int transfer); | 104 static TransferID GetTransferID(int transfer); |
| 90 static MatrixID GetMatrixID(int matrix); | 105 static MatrixID GetMatrixID(int matrix); |
| 91 | 106 |
| 92 static VideoColorSpace REC709(); | 107 static VideoColorSpace REC709(); |
| 93 static VideoColorSpace REC601(); | 108 static VideoColorSpace REC601(); |
| 94 static VideoColorSpace JPEG(); | 109 static VideoColorSpace JPEG(); |
| 95 | 110 |
| 96 gfx::ColorSpace ToGfxColorSpace() const; | 111 gfx::ColorSpace ToGfxColorSpace() const; |
| 97 | 112 |
| 98 // Note, these are public variables. | 113 // Note, these are public variables. |
| 99 PrimaryID primaries = PrimaryID::INVALID; | 114 PrimaryID primaries = PrimaryID::INVALID; |
| 100 TransferID transfer = TransferID::INVALID; | 115 TransferID transfer = TransferID::INVALID; |
| 101 MatrixID matrix = MatrixID::INVALID; | 116 MatrixID matrix = MatrixID::INVALID; |
|
a.suchit2
2017/04/25 14:05:08
For the small usage of enum, we would not required
Uzair
2017/04/25 14:12:34
I am not sure about any other way without using un
a.suchit2
2017/04/25 14:45:51
Enum variables : lines 114,115,116
a.suchit2
2017/04/25 14:45:51
Enum variables : lines 114,115,116
| |
| 117 PrimaryIDUnion primaries_union; | |
| 118 TransferIDUnion transfer_union; | |
| 119 MatrixIDUnion matrix_union; | |
| 102 gfx::ColorSpace::RangeID range = gfx::ColorSpace::RangeID::INVALID; | 120 gfx::ColorSpace::RangeID range = gfx::ColorSpace::RangeID::INVALID; |
| 103 }; | 121 }; |
| 104 | 122 |
| 105 } // namespace media | 123 } // namespace media |
| 106 | 124 |
| 107 #endif | 125 #endif |
| OLD | NEW |