Merge "webp-container-spec: clarify background clear on loop"

This commit is contained in:
pascal massimino 2015-02-05 14:44:27 -08:00 committed by Gerrit Code Review
commit 4b9fa5d0e2

View File

@ -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 * Viewer applications SHOULD treat the background color value as a hint, and
are not required to use it. 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_) Loop Count: 16 bits (_uint16_)
: The number of times to loop the animation. `0` means infinitely. : The number of times to loop the animation. `0` means infinitely.
@ -725,15 +728,19 @@ dispose_method ← ANIM.disposeMethod
if loop_count == 0: if loop_count == 0:
loop_count = ∞ loop_count = ∞
frame_params ← nil frame_params ← nil
for loop = 0, ..., loop_count - 1
assert next chunk in image_data is ANMF 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.frameX = Frame X
frame_params.frameY = Frame Y frame_params.frameY = Frame Y
frame_params.frameWidth = Frame Width Minus One + 1 frame_params.frameWidth = Frame Width Minus One + 1
frame_params.frameHeight = Frame Height Minus One + 1 frame_params.frameHeight = Frame Height Minus One + 1
frame_params.frameDuration = Frame Duration frame_params.frameDuration = Frame Duration
assert VP8X.canvasWidth >= frame_params.frameX + frame_params.frameWidth frame_right = frame_params.frameX + frame_params.frameWidth
assert VP8X.canvasHeight >= frame_params.frameY + frame_params.frameHeight frame_bottom = frame_params.frameY + frame_params.frameHeight
assert VP8X.canvasWidth >= frame_right
assert VP8X.canvasHeight >= frame_bottom
for subchunk in 'Frame Data': for subchunk in 'Frame Data':
if subchunk.tag == "ALPH": if subchunk.tag == "ALPH":
assert alpha subchunks not found in 'Frame Data' earlier 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": else if subchunk.tag == "VP8 " OR subchunk.tag == "VP8L":
assert bitstream subchunks not found in 'Frame Data' earlier assert bitstream subchunks not found in 'Frame Data' earlier
frame_params.bitstream = bitstream_data frame_params.bitstream = bitstream_data
render frame with frame_params.alpha and frame_params.bitstream on canvas render frame with frame_params.alpha and frame_params.bitstream on
with top-left corner in (frame_params.frameX, frame_params.frameY), using canvas with top-left corner at (frame_params.frameX,
dispose method dispose_method. frame_params.frameY), using dispose method dispose_method.
Show the contents of the image for frame_params.frameDuration * 1ms. canvas contains the decoded image.
canvas contains the decoded canvas. Show the contents of the canvas for frame_params.frameDuration * 1ms.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Example file layouts Example file layouts