48
edits
(APNG 0.9) |
No edit summary |
||
| Line 98: | Line 98: | ||
20 delay_num (unsigned short) Frame delay fraction numerator | 20 delay_num (unsigned short) Frame delay fraction numerator | ||
22 delay_den (unsigned short) Frame delay fraction denominator | 22 delay_den (unsigned short) Frame delay fraction denominator | ||
24 | 24 dispose_op (byte) Type of 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 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. | ||
| Line 108: | Line 109: | ||
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 `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. | ||
Valid values for `dispose_op` are: | |||
value | |||
1 APNG_DISPOSE_OP_NONE | |||
2 APNG_DISPOSE_OP_BACKGROUND | |||
4 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. | |||
`blend_op` 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 `blend_op` values are: | |||
value | |||
0 APNG_BLEND_OP_SOURCE | |||
1 APNG_BLEND_OP_OVER | |||
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.2]. Note that Variation 2 of the sample code is applicable. | |||
APNG_BLEND_OP_OVER 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. | |||
` | `blend_op` must be APNG_BLEND_OP_SOURCE for frame 0. | ||
== `fdAT`: The Frame Data Chunk == | == `fdAT`: The Frame Data Chunk == | ||
| Line 243: | Line 236: | ||
* The acTL fcTL and adAT are now not copy safe, renamed them to acTL, fcTL and adAT | * 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 = | = Test Encoder and Sample Images = | ||
edits