|
155 | 155 | alpha channel is present. |
156 | 156 |
|
157 | 157 | : <dfn>sRGB Color Space</dfn> |
158 | | -:: A {{VideoColorSpaceInit}} containing «[ |
159 | | - "primaries" → {{VideoColorPrimaries/bt709}}, |
160 | | - "transfer" → {{VideoTransferCharacteristics/iec61966-2-1}}, |
161 | | - "matrix" → {{VideoMatrixCoefficients/rgb}}, |
162 | | - "fullRange" → `true`]». |
| 158 | +:: A {{VideoColorSpace}} object, initialized as follows: |
| 159 | + 1. {{VideoColorSpace/[[primaries]]}} is set to {{VideoColorPrimaries/bt709}}, |
| 160 | + 2. {{VideoColorSpace/[[transfer]]}} is set to {{VideoTransferCharacteristics/iec61966-2-1}}, |
| 161 | + 3. {{VideoColorSpace/[[matrix]]}} is set to {{VideoMatrixCoefficients/rgb}}, |
| 162 | + 4. {{VideoColorSpace/[[full range]]}} is set to `true` |
| 163 | + |
| 164 | +: <dfn>Display P3 Color Space</dfn> |
| 165 | +:: A {{VideoColorSpace}} object, initialized as follows: |
| 166 | + 1. {{VideoColorSpace/[[primaries]]}} is set to {{VideoColorPrimaries/smpte432}}, |
| 167 | + 2. {{VideoColorSpace/[[transfer]]}} is set to {{VideoTransferCharacteristics/iec61966-2-1}}, |
| 168 | + 3. {{VideoColorSpace/[[matrix]]}} is set to {{VideoMatrixCoefficients/rgb}}, |
| 169 | + 4. {{VideoColorSpace/[[full range]]}} is set to `true` |
163 | 170 |
|
164 | 171 | : <dfn>REC709 Color Space</dfn> |
165 | | -:: A {{VideoColorSpaceInit}} containing «[ |
166 | | - "primaries" → {{VideoColorPrimaries/bt709}}, |
167 | | - "transfer" → {{VideoTransferCharacteristics/bt709}}, |
168 | | - "matrix" → {{VideoMatrixCoefficients/bt709}}, |
169 | | - "fullRange" → `false`]». |
| 172 | +:: A {{VideoColorSpace}} object, initialized as follows: |
| 173 | + 1. {{VideoColorSpace/[[primaries]]}} is set to {{VideoColorPrimaries/bt709}}, |
| 174 | + 2. {{VideoColorSpace/[[transfer]]}} is set to {{VideoTransferCharacteristics/bt709}}, |
| 175 | + 3. {{VideoColorSpace/[[matrix]]}} is set to {{VideoMatrixCoefficients/bt709}}, |
| 176 | + 4. {{VideoColorSpace/[[full range]]}} is set to `false` |
170 | 177 |
|
171 | 178 | : <dfn lt="saturated">Codec Saturation</dfn> |
172 | 179 | :: The state of an underlying codec implementation where the number of active |
|
3696 | 3703 | :: The presentation timestamp, given in microseconds. For decode, |
3697 | 3704 | timestamp is copied from the {{EncodedVideoChunk}} corresponding |
3698 | 3705 | to this {{VideoFrame}}. For encode, timestamp is copied to the |
3699 | | - {{EncodedVideoChunk}}s corresponding to this {{VideoFrame}}. |
| 3706 | + {{EncodedVideoChunk}}s corresponding to this {{VideoFrame}}. |
3700 | 3707 |
|
3701 | 3708 | The {{VideoFrame/timestamp}} getter steps are to return |
3702 | 3709 | {{VideoFrame/[[timestamp]]}}. |
|
4205 | 4212 | [=combined buffer layout/allocationSize=]. |
4206 | 4213 | 9. Return |combinedLayout|. |
4207 | 4214 |
|
| 4215 | +: <dfn>Convert PredefinedColorSpace to VideoColorSpace</dfn> (with |colorSpace|) |
| 4216 | + :: 1. Assert: |colorSpace| is equal to one of {{srgb}} or {{display-p3}}. |
| 4217 | + 2. If |colorSpace| is equal to {{srgb}} return a new instance of the |
| 4218 | + [=sRGB Color Space=] |
| 4219 | + 3. If |colorSpace| is equal to {{display-p3}} return a new instance of the |
| 4220 | + [=Display P3 Color Space=] |
| 4221 | + |
4208 | 4222 | : <dfn for=VideoFrame>Convert to RGB frame</dfn> (with |frame|, |format| and |colorSpace|) |
4209 | 4223 | :: 1. This algorithm <em class="rfc2119">MUST</em> be called only if |format| |
4210 | 4224 | is equal to one of {{RGBA}}, {{RGBX}}, {{BGRA}}, {{BGRX}}. |
|
4221 | 4235 | 6. Assign |frame|'s {{VideoFrame/[[duration]]}} and |frame|'s |
4222 | 4236 | {{VideoFrame/[[timestamp]]}} to {{VideoFrame/[[duration]]}} and |
4223 | 4237 | {{VideoFrame/[[timestamp]]}} respectively. |
4224 | | - 7. Assign |colorSpace| to {{VideoFrame/[[color space]]}}. |
| 4238 | + 7. Assign the result of running the <a>Convert |
| 4239 | + PredefinedColorSpace to VideoColorSpace</a> algorithm with |
| 4240 | + |colorSpace| to {{VideoFrame/[[color space]]}}. |
4225 | 4241 | 8. Let |resource| be a new [=media resource=] containing the result of |
4226 | 4242 | conversion of [=media resource=] referenced by |frame|'s |
4227 | 4243 | {{VideoFrame/[[resource reference]]}} into a color space and pixel |
4228 | | - format specified by |colorSpace| and |format| respectively. |
| 4244 | + format specified by {{VideoFrame/[[color space]]}} and |
| 4245 | + {{VideoFrame/[[format]]}} respectively. |
4229 | 4246 | 9. Assign the reference to |resource| to {{VideoFrame/[[resource reference]]}} |
4230 | 4247 | 3. Return |convertedFrame|. |
4231 | 4248 |
|
|
0 commit comments