APNG Specification: Difference between revisions

Jump to navigation Jump to search
m
editorial changes
m (out-of-order chunk error discussion is now redundant with error handling section)
m (editorial changes)
Line 24: Line 24:
The "canvas" is the area on the output device on which the frames are to be displayed.  The contents of the canvas are not necessarily available to the decoder. As per the PNG Specification, if a `bKGD` chunk exists it may be used to fill the canvas if there is no preferrable background.
The "canvas" is the area on the output device on which the frames are to be displayed.  The contents of the canvas are not necessarily available to the decoder. As per the PNG Specification, if a `bKGD` chunk exists it may be used to fill the canvas if there is no preferrable background.


The "output buffer" is a pixel array with dimensions specified by the width and height parameters of the PNG IHDR chunk.  Conceptually, each frame is constructed in the output buffer before being composited onto the canvas.  The contents of the output buffer are available to the decoder.  The corner pixels of the output buffer are mapped to the corners of the canvas.
The "output buffer" is a pixel array with dimensions specified by the width and height parameters of the PNG `IHDR` chunk.  Conceptually, each frame is constructed in the output buffer before being composited onto the canvas.  The contents of the output buffer are available to the decoder.  The corner pixels of the output buffer are mapped to the corners of the canvas.


"Fully transparent black" means red, green, blue and alpha components are all set to zero.
"Fully transparent black" means red, green, blue and alpha components are all set to zero.
Line 32: Line 32:
== Error Handling ==
== Error Handling ==


APNG is designed to allow incremental display of frames before the entire image has been read. This implies that some errors may not be detected until partway through the animation. It is strongly recommended that when an error is encountered decoders should discard all subsequent frames, stop the animation, and revert to displaying the placeholder image. An error may be displayed to the user if appropriate.
APNG is designed to allow incremental display of frames before the entire image has been read. This implies that some errors may not be detected until partway through the animation. It is strongly recommended that when any error is encountered decoders should discard all subsequent frames, stop the animation, and revert to displaying the placeholder image. A decoder which detects an error before the animation has started should display the placeholder image. An error message may be displayed to the user if appropriate.


= Structure =
= Structure =
Line 111: Line 111:
     25    blend_op              (byte)          Type of frame area rendering for this frame  
     25    blend_op              (byte)          Type of frame area rendering for this frame  


The frame must be rendered within the region defined by `x_offset`, `y_offset`, `width`, and `height`. The offsets must be non-negative, the dimensions must be positive, and the region may not fall outside of the placeholder image:
The frame must be rendered within the region defined by `x_offset`, `y_offset`, `width`, and `height`. The offsets must be non-negative, the dimensions must be positive, and the region may not fall outside of the placeholder image.
 
Constraints on frame regions:


     `x_offset` >= 0
     `x_offset` >= 0
Line 209: Line 211:
* Fixed dispose_op description (after, not before)
* Fixed dispose_op description (after, not before)


* Changed dipose_op to render_op; added disposal description; added BLEND flag
* Changed dispose_op to render_op; added disposal description; added BLEND flag


* Changed delay_time to a delay numerator and denominator, for specifying delays that don't into integer
* Changed delay_time to a delay numerator and denominator, for specifying delays that don't into integer
18

edits

Navigation menu