Skip to content

Commit

Permalink
Editorial changes from Chris Needham
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Needham <[email protected]>
  • Loading branch information
Djuffin and chrisn authored Dec 14, 2023
1 parent 79feaba commit 4f99d19
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions index.src.html
Original file line number Diff line number Diff line change
Expand Up @@ -3750,7 +3750,7 @@
5. If `destination.byteLength` is less than |combinedLayout|'s [=combined
buffer layout/allocationSize=], return a promise rejected with a
{{TypeError}}.
6. If |options|.{{VideoFrameCopyToOptions/format}} does not equal to
6. If |options|.{{VideoFrameCopyToOptions/format}} does not equal
{{VideoFrame/[[format]]}} and |options|.{{VideoFrameCopyToOptions/format}}
is equal to one of {{RGBA}}, {{RGBX}}, {{BGRA}}, {{BGRX}} then:
1. Let |newOptions| be the result of running the <a>Clone Configuration</a>
Expand Down Expand Up @@ -4197,25 +4197,25 @@
2. Let |canvasSettings| be a new {{CanvasRenderingContext2DSettings}} with
{{CanvasRenderingContext2DSettings/colorSpace}} set to |colorSpace|.
3. Let |context| be the result of calling {{OffscreenCanvas/getContext()}}
on |canvas| with `"2d"` and |canvasSettings|
on |canvas| with `"2d"` and |canvasSettings|.
3. Call {{CanvasDrawImage/drawImage()}} on |context| with
`rect.x`, `rect.y`, `rect.width`, `rect.height`, `0`, `0`, `rect.width`,
`rect.height`.
4. Let |imageData| be the result of calling {{CanvasImageData/getImageData()}} with
`0`, `0`, |rect.width|, |rect.height|.
5. If |format| is equal to {{BGRA}} or {{BGRX}}:
1. Let |pixelIndex| be `0`
1. Let |pixelIndex| be `0`.
2. While |pixelIndex| is less than `rect.width` multiplied by `rect.height`:
1. Swap elements in |imageData|.{{ImageData/data}} at indexes `4 * pixelIndex`
and `4 * pixelIndex + 2`.
2. Increment |pixelIndex| by `1`
2. Increment |pixelIndex| by `1`.
6. Let |init| be a new {{VideoFrameBufferInit}} constructed with
{{VideoFrameBufferInit/format}} = |format|,
{{VideoFrameBufferInit/codedWidth}} = `rect.width`,
{{VideoFrameBufferInit/codedHeight}} = `rect.height`
{{VideoFrameBufferInit/codedHeight}} = `rect.height`.
7. Let |convertedFrame| be a new {{VideoFrame}} constructed with
|imageData|.{{ImageData/data}} and |init|
8. Return |convertedFrame|
|imageData|.{{ImageData/data}} and |init|.
8. Return |convertedFrame|.

: <dfn for=VideoFrame>Copy VideoFrame metadata</dfn> (with |metadata|)
:: 1. Let |metadataCopySerialized| be [$StructuredSerialize$](|metadata|).
Expand Down Expand Up @@ -4273,7 +4273,7 @@

VideoFrame CopyTo() Options {#videoframe-copyto-options}
------------------------------------------------------------
Options to specify a rectangle of pixels to copy, their format and the offset
Options to specify a rectangle of pixels to copy, their format, and the offset
and stride of planes in the destination buffer.

<xmp class='idl'>
Expand Down Expand Up @@ -4315,8 +4315,8 @@
{{RGBA}}, {{RGBX}}, {{BGRA}}, {{BGRX}} and values of {{VideoFrame/format}}.
If unspecified or `null`, the {{VideoFrame/format}} is used.
: <dfn dict-member for=VideoFrameCopyToOptions>colorSpace</dfn>
:: A {{PredefinedColorSpace}} that <em class="rfc2119">SHALL</em> be used to as
a target color space for for the pixel data in the destination
:: A {{PredefinedColorSpace}} that <em class="rfc2119">SHALL</em> be used as
a target color space for the pixel data in the destination
{{BufferSource}}, but only if {{VideoFrameCopyToOptions/format}} is one of
{{RGBA}}, {{RGBX}}, {{BGRA}}, {{BGRX}}, otherwise it is ignored.
If unspecified or `null`, {{srgb}} is used.
Expand Down

0 comments on commit 4f99d19

Please sign in to comment.