Changes

Jump to: navigation, search

APNG Specification

376 bytes removed, 20:21, 22 March 2007
no edit summary
20 delay_num (unsigned short) Frame delay fraction numerator
22 delay_den (unsigned short) Frame delay fraction denominator
24 render_op dispose_op (byte) Type of output buffer frame area disposal to be done after rendering this frame 25 blend_op (byte) Type of frame area rendering for this frame
The frame must be rendered within the region defined by the `width`, `height`, `x_offset` and `y_offset` from the `fcTL`, and the width and height from the `IHDR` chunk.
The `delay_num` and `delay_den` parameters together specify a fraction indicating the delay after the current frame, in seconds. If the denominator is 0, it is to be treated as if it were 100 (that is, delay_num then specifies 1/100ths of a second). If the the value of the numerator is 0 the decoder should render the next frame as quickly as possible, though viewers may impose a reasonable lower bound on the delay.
The Valid values for `render_opdispose_op` parameter contains flags describing how the frame is to be disposed before rendering the next frame; it also specifies whether the frame is to be alpha blended into the current output buffer content, or whether it should completely replace its region in the output buffer. Valid render_op flags are:
bitvalue +-------------------------------+1 APNG_DISPOSE_OP_NONE | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | APNG_DISPOSE_OP_BACKGROUND +-----------------|---|---|---|-+ | +---+---+------ bits 0-2: dispose_op | +------------------ bit 3: APNG_RENDER_OP_BLEND_FLAG4 APNG_DISPOSE_OP_PREVIOUS
* APNG_DISPOSE_NONE: no disposal is done on this frame before rendering the next; its contents are left on the output buffer. This is the default.
* APNG_DISPOSE_OP_BACKGROUND: the frame's region is to be cleared to the background color. If no bKGD chunk is specified, the result is fully transparent black (r, g, b, and a all 0).
* APNG_DISPOSE_OP_PREVIOUS: the frame's region is to be reverted to the previous contents.
Bits 4 through 7 are reserved and must `blend_op` specifies whether the frame is to be 0alpha blended into the current output buffer content, or whether it should completely replace its region in the output buffer.Valid `blend_op` values are:
Valid values for `dispose_op` are: value 0 APNG_BLEND_OP_SOURCE 1 APNG_BLEND_OP_OVER
value bit If `blend_op` is APNG_BLEND_OP_SOURCE all color components of the frame, including alpha, overwrite the current contents of the frame's output buffer region. If `blend_op` is APNG_BLEND_OP_OVER the frame should be composited onto the output buffer based on its alpha, using a simple OVER operation as described in the "Alpha Channel Processing" section of the PNG specification [PNG-1 0 APNG_RENDER_OP_DISPOSE_NONE .2 1 APNG_RENDER_OP_DISPOSE_BACKGROUND 4 ]. Note that Variation 2 APNG_RENDER_OP_DISPOSE_PREVIOUSof the sample code is applicable.
* `APNG_RENDER_OP_DISPOSE_NONE`: no disposal APNG_BLEND_OP_OVER is done on this frame before rendering the next; its contents are left on the output buffernot valid for color types 0 (greyscale without alpha) or 2 (truecolor without alpha). This It is valid for type 3 (indexed) images; however, the default.* `APNG_RENDER_OP_DISPOSE_BACKGROUND`: the frame's region is to resulting pixel values may not be cleared to present in the background colorspecified palette. If no `bKGD` chunk is specified, the result It is fully transparent black always valid for type 4 (r, g, b, greyscale with alpha) and a all 0type 6 (truecolor with alpha).* `APNG_RENDER_OP_DISPOSE_PREVIOUS`: the frame's region is to be reverted to the previous contentsimages.
`APNG_RENDER_OP_BLEND_FLAGblend_op` may be added to any of the above disposal operations. If this flag is 0, all color components of the frame, including alpha, overwrite the current contents of the frame's output buffer region. If the APNG_RENDER_OP_BLEND_FLAG is not 0 the frame should be composited onto the output buffer based on its alpha, using a simple OVER operation as described in the "Alpha Channel Processing" section of the PNG specification [pngspec]. Notethat Variation 2 of the sample code is applicable. `APNG_RENDER_OP_BLEND_FLAG` is not valid for color types 0 (greyscale without alpha) or 2 (truecolor without alpha). It is valid for type 3 (indexed) images; however, the resulting pixel values may not be present in the specified palette. It is always valid for type 4 (greyscale with alpha) and type 6 (truecolor with alpha) images. APNG_RENDER_OP_BLEND_FLAG must be 0 APNG_BLEND_OP_SOURCE for frame 0.
== `fdAT`: The Frame Data Chunk ==
* The acTL fcTL and adAT are now not copy safe, renamed them to acTL, fcTL and adAT
 
* Split dispose_op into render_op and blend_op
= Test Encoder and Sample Images =
48
edits

Navigation menu