mirror of
https://github.com/webmproject/libwebp.git
synced 2025-02-13 07:22:52 +01:00
webp-container-spec: clarify background clear on loop
at the beginning of the loop there's an implicit clear of the entire canvas to the background (or application defined) color. this avoids adding the final composited frame to the first. Change-Id: Ia3a52cf4482c6176334a5c9c99a0ddd07d1776e7
This commit is contained in:
parent
19f0ba0eb9
commit
560394798f
@ -378,6 +378,9 @@ color is also used when disposal method is `1`.
|
||||
* Viewer applications SHOULD treat the background color value as a hint, and
|
||||
are not required to use it.
|
||||
|
||||
* The canvas is cleared at the start of each loop. The background color MAY be
|
||||
used to achieve this.
|
||||
|
||||
Loop Count: 16 bits (_uint16_)
|
||||
|
||||
: The number of times to loop the animation. `0` means infinitely.
|
||||
@ -725,15 +728,19 @@ dispose_method ← ANIM.disposeMethod
|
||||
if loop_count == 0:
|
||||
loop_count = ∞
|
||||
frame_params ← nil
|
||||
for loop = 0, ..., loop_count - 1
|
||||
assert next chunk in image_data is ANMF
|
||||
for loop = 0..loop_count - 1
|
||||
clear canvas to ANIM.background_color or application defined color
|
||||
until eof or non-ANMF chunk
|
||||
frame_params.frameX = Frame X
|
||||
frame_params.frameY = Frame Y
|
||||
frame_params.frameWidth = Frame Width Minus One + 1
|
||||
frame_params.frameHeight = Frame Height Minus One + 1
|
||||
frame_params.frameDuration = Frame Duration
|
||||
assert VP8X.canvasWidth >= frame_params.frameX + frame_params.frameWidth
|
||||
assert VP8X.canvasHeight >= frame_params.frameY + frame_params.frameHeight
|
||||
frame_right = frame_params.frameX + frame_params.frameWidth
|
||||
frame_bottom = frame_params.frameY + frame_params.frameHeight
|
||||
assert VP8X.canvasWidth >= frame_right
|
||||
assert VP8X.canvasHeight >= frame_bottom
|
||||
for subchunk in 'Frame Data':
|
||||
if subchunk.tag == "ALPH":
|
||||
assert alpha subchunks not found in 'Frame Data' earlier
|
||||
@ -741,11 +748,11 @@ for loop = 0, ..., loop_count - 1
|
||||
else if subchunk.tag == "VP8 " OR subchunk.tag == "VP8L":
|
||||
assert bitstream subchunks not found in 'Frame Data' earlier
|
||||
frame_params.bitstream = bitstream_data
|
||||
render frame with frame_params.alpha and frame_params.bitstream on canvas
|
||||
with top-left corner in (frame_params.frameX, frame_params.frameY), using
|
||||
dispose method dispose_method.
|
||||
Show the contents of the image for frame_params.frameDuration * 1ms.
|
||||
canvas contains the decoded canvas.
|
||||
render frame with frame_params.alpha and frame_params.bitstream on
|
||||
canvas with top-left corner at (frame_params.frameX,
|
||||
frame_params.frameY), using dispose method dispose_method.
|
||||
canvas contains the decoded image.
|
||||
Show the contents of the canvas for frame_params.frameDuration * 1ms.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Example file layouts
|
||||
|
Loading…
x
Reference in New Issue
Block a user