Chromium Code Reviews| Index: ui/gfx/color_space.h |
| diff --git a/ui/gfx/color_space.h b/ui/gfx/color_space.h |
| index 6e351899e16fe3f4523a17f571c6e873d5eb6e26..81919bcccf49b5f87e1a48285ce6f5e29f57b5bb 100644 |
| --- a/ui/gfx/color_space.h |
| +++ b/ui/gfx/color_space.h |
| @@ -43,11 +43,13 @@ class GFX_EXPORT ColorSpace { |
| SMPTEST431_2 = 11, |
| SMPTEST432_1 = 12, |
| + LAST_STANDARD_VALUE = SMPTEST432_1, |
| + |
| // Chrome-specific values start at 1000. |
| - XYZ_D50 = 1000, |
| - // TODO(hubbe): We need to store the primaries. |
| - CUSTOM = 1001, |
| - LAST = CUSTOM |
| + UNKNOWN = 1000, |
| + XYZ_D50, |
| + CUSTOM, |
| + LAST = UNKNOWN |
|
ccameron
2016/09/16 23:09:48
Should this be CUSTOM?
hubbe
2016/09/16 23:25:35
Ooops, yes, I rearranged it so that UNKNOWN is alw
|
| }; |
| enum class TransferID : uint16_t { |
| @@ -71,8 +73,11 @@ class GFX_EXPORT ColorSpace { |
| SMPTEST2084 = 16, |
| SMPTEST428_1 = 17, |
| + LAST_STANDARD_VALUE = SMPTEST428_1, |
| + |
| // Chrome-specific values start at 1000. |
| - GAMMA24 = 1000, |
| + UNKNOWN = 1000, |
| + GAMMA24, |
| // This is an ad-hoc transfer function that decodes SMPTE 2084 content |
| // into a 0-1 range more or less suitable for viewing on a non-hdr |
| @@ -99,8 +104,11 @@ class GFX_EXPORT ColorSpace { |
| BT2020_CL = 10, |
| YDZDX = 11, |
| + LAST_STANDARD_VALUE = YDZDX, |
| + |
| // Chrome-specific values start at 1000 |
| - LAST = YDZDX, |
| + UNKNOWN = 1000, |
| + LAST = UNKNOWN, |
| }; |
| // The h264 spec declares this as bool, so only the the first two values |
| @@ -119,6 +127,11 @@ class GFX_EXPORT ColorSpace { |
| TransferID transfer, |
| MatrixID matrix, |
| RangeID full_range); |
| + ColorSpace(int primaries, int transfer, int matrix, RangeID full_range); |
| + |
| + static PrimaryID PrimaryIDFromInt(int primary_id); |
| + static TransferID TransferIDFromInt(int transfer_id); |
| + static MatrixID MatrixIDFromInt(int matrix_id); |
| static ColorSpace CreateSRGB(); |
| static ColorSpace CreateXYZD50(); |