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 #ifndef UI_GFX_COLOR_SPACE_H_ | 5 #ifndef UI_GFX_COLOR_SPACE_H_ |
6 #define UI_GFX_COLOR_SPACE_H_ | 6 #define UI_GFX_COLOR_SPACE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
63 LINEAR = 8, | 63 LINEAR = 8, |
64 LOG = 9, | 64 LOG = 9, |
65 LOG_SQRT = 10, | 65 LOG_SQRT = 10, |
66 IEC61966_2_4 = 11, | 66 IEC61966_2_4 = 11, |
67 BT1361_ECG = 12, | 67 BT1361_ECG = 12, |
68 IEC61966_2_1 = 13, | 68 IEC61966_2_1 = 13, |
69 BT2020_10 = 14, | 69 BT2020_10 = 14, |
70 BT2020_12 = 15, | 70 BT2020_12 = 15, |
71 SMPTEST2084 = 16, | 71 SMPTEST2084 = 16, |
72 SMPTEST428_1 = 17, | 72 SMPTEST428_1 = 17, |
73 ARIB_STD_B67 = 18, // AKA hybrid-log gamma, HLG | |
hubbe
2016/09/15 17:25:52
Also need to add this to ToLinear/FromLinear in co
servolk
2016/09/15 20:29:04
Done.
I've found some conversion formulas in Wikip
hubbe
2016/09/15 20:46:12
+1 for moving to a separate CL.
The 0-1 normalizat
| |
73 | 74 |
74 // Chrome-specific values start at 1000. | 75 // Chrome-specific values start at 1000. |
75 GAMMA24 = 1000, | 76 GAMMA24 = 1000, |
76 | 77 |
77 // This is an ad-hoc transfer function that decodes SMPTE 2084 content | 78 // This is an ad-hoc transfer function that decodes SMPTE 2084 content |
78 // into a 0-1 range more or less suitable for viewing on a non-hdr | 79 // into a 0-1 range more or less suitable for viewing on a non-hdr |
79 // display. | 80 // display. |
80 SMPTEST2084_NON_HDR, | 81 SMPTEST2084_NON_HDR, |
81 | 82 |
82 // TODO(hubbe): Need to store an approximation of the gamma function(s). | 83 // TODO(hubbe): Need to store an approximation of the gamma function(s). |
(...skipping 18 matching lines...) Expand all Loading... | |
101 | 102 |
102 // Chrome-specific values start at 1000 | 103 // Chrome-specific values start at 1000 |
103 LAST = YDZDX, | 104 LAST = YDZDX, |
104 }; | 105 }; |
105 | 106 |
106 // The h264 spec declares this as bool, so only the the first two values | 107 // The h264 spec declares this as bool, so only the the first two values |
107 // correspond to the h264 spec. Chrome-specific values can start at 2. | 108 // correspond to the h264 spec. Chrome-specific values can start at 2. |
108 // We use an enum instead of a bool becuase different bit depths may have | 109 // We use an enum instead of a bool becuase different bit depths may have |
109 // different definitions of what "limited" means. | 110 // different definitions of what "limited" means. |
110 enum class RangeID : int8_t { | 111 enum class RangeID : int8_t { |
111 FULL = 0, | 112 UNSPECIFIED = 0, |
112 LIMITED = 1, | 113 LIMITED = 1, |
114 FULL = 2, | |
113 | 115 |
114 LAST = LIMITED | 116 // Defined by TransferID/MatrixID |
117 DERIVED = 3, | |
118 | |
119 LAST = DERIVED | |
115 }; | 120 }; |
116 | 121 |
117 ColorSpace(); | 122 ColorSpace(); |
118 ColorSpace(PrimaryID primaries, | 123 ColorSpace(PrimaryID primaries, |
119 TransferID transfer, | 124 TransferID transfer, |
120 MatrixID matrix, | 125 MatrixID matrix, |
121 RangeID full_range); | 126 RangeID full_range); |
122 | 127 |
123 static ColorSpace CreateSRGB(); | 128 static ColorSpace CreateSRGB(); |
124 static ColorSpace CreateXYZD50(); | 129 static ColorSpace CreateXYZD50(); |
(...skipping 22 matching lines...) Expand all Loading... | |
147 | 152 |
148 friend class ICCProfile; | 153 friend class ICCProfile; |
149 friend class ColorSpaceToColorSpaceTransform; | 154 friend class ColorSpaceToColorSpaceTransform; |
150 friend struct IPC::ParamTraits<gfx::ColorSpace>; | 155 friend struct IPC::ParamTraits<gfx::ColorSpace>; |
151 FRIEND_TEST_ALL_PREFIXES(SimpleColorSpace, GetColorSpace); | 156 FRIEND_TEST_ALL_PREFIXES(SimpleColorSpace, GetColorSpace); |
152 }; | 157 }; |
153 | 158 |
154 } // namespace gfx | 159 } // namespace gfx |
155 | 160 |
156 #endif // UI_GFX_COLOR_SPACE_H_ | 161 #endif // UI_GFX_COLOR_SPACE_H_ |
OLD | NEW |