|
2264 | 2264 | 5. Switch on |image|:
|
2265 | 2265 | - {{HTMLImageElement}}
|
2266 | 2266 | - {{SVGImageElement}}
|
2267 |
| - 1. If {{VideoFramePlaneInit/timestamp}} does not [=map/exist=] in |
| 2267 | + 1. If {{VideoFrameInit/timestamp}} does not [=map/exist=] in |
2268 | 2268 | |init|, throw a {{TypeError}}.
|
2269 |
| - 2. If image's media data has no [=natural dimensions=] |
| 2269 | + 2. If |image|'s media data has no [=natural dimensions=] |
2270 | 2270 | (e.g., it's a vector graphic with no specified content size), then
|
2271 | 2271 | throw an {{InvalidStateError}} {{DOMException}}.
|
2272 |
| - 3. Let |resource| be a new [=frame resource=] containing a copy of |
| 2272 | + 3. Let |resource| be a new [=media resource=] containing a copy of |
2273 | 2273 | |image|'s media data. If this is an animated image, |image|'s
|
2274 | 2274 | [=bitmap data=] must only be taken from the default image of the
|
2275 | 2275 | animation (the one that the format defines is to be used when
|
|
2286 | 2286 | {{InvalidStateError}} {{DOMException}}.
|
2287 | 2287 | 2. Let |currentPlaybackFrame| be the {{VideoFrame}} at the [=current
|
2288 | 2288 | playback position=].
|
2289 |
| - 3. Run the [=VideoFrame/Initialize Frame From Other Frame=] algoirhtm |
| 2289 | + 3. Run the [=VideoFrame/Initialize Frame From Other Frame=] algorithm |
2290 | 2290 | with |init|, |frame|, and |currentPlaybackFrame|.
|
2291 | 2291 |
|
2292 | 2292 | - {{HTMLCanvasElement}}
|
2293 | 2293 | - {{ImageBitmap}}
|
2294 | 2294 | - {{OffscreenCanvas}}
|
2295 |
| - 1. If {{VideoFramePlaneInit/timestamp}} does not [=map/exist=] in |
| 2295 | + 1. If {{VideoFrameInit/timestamp}} does not [=map/exist=] in |
2296 | 2296 | |init|, throw a {{TypeError}}.
|
2297 |
| - 2. Let |resource| be a new [=frame resource=] containing a copy of |
| 2297 | + 2. Let |resource| be a new [=media resource=] containing a copy of |
2298 | 2298 | |image|'s [=bitmap data=].
|
| 2299 | + |
| 2300 | + NOTE: Implementers are should avoid a deep copy by using reference |
| 2301 | + coutning where feasible. |
| 2302 | + |
2299 | 2303 | 3. Let |width| be `image.width` and |height| be `image.height`.
|
2300 | 2304 | 4. Run the [=VideoFrame/Initialize Frame With Resource and Size=]
|
2301 | 2305 | algorithm with |init|, |frame|, |resource|, |width|, and |height|.
|
|
2522 | 2526 |
|
2523 | 2527 | : <dfn for=VideoFrame>Initialize Frame From Other Frame</dfn> (with |init|,
|
2524 | 2528 | |frame|, and |otherFrame|)
|
2525 |
| -:: 1. Let |resource| be the [=frame resource=] referenced by |otherFrame|'s |
| 2529 | +:: 1. Let |resource| be the [=media resource=] referenced by |otherFrame|'s |
2526 | 2530 | {{VideoFrame/[[resource reference]]}}.
|
2527 | 2531 | 2. Assign a new reference for |resource| to |frame|'s
|
2528 | 2532 | {{VideoFrame/[[resource reference]]}}.
|
|
2557 | 2561 | 2. If |resource| uses a recognized {{PixelFormat}}:
|
2558 | 2562 | 1. Assign the {{PixelFormat}} of |resource| to {{VideoFrame/format}}.
|
2559 | 2563 | 2. Let |planes| be a list of {{Plane}}s describing the
|
2560 |
| - [=frame resource=] in accordance with the {{VideoFrame/format}}. |
| 2564 | + [=media resource=] in accordance with the {{VideoFrame/format}}. |
2561 | 2565 |
|
2562 | 2566 | ISSUE: The spec should define explicit rules for each
|
2563 | 2567 | {{PixelFormat}} and reference them in the step above. See
|
|
0 commit comments