48
edits
No edit summary |
|||
| Line 104: | Line 104: | ||
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 render_op (byte) Type of | 24 render_op (byte) Type of output buffer area disposal to be done after rendering 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 114: | Line 114: | ||
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. | ||
The `render_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 | The `render_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: | ||
bit | bit | ||
| Line 134: | Line 134: | ||
4 2 APNG_RENDER_OP_DISPOSE_PREVIOUS | 4 2 APNG_RENDER_OP_DISPOSE_PREVIOUS | ||
* `APNG_RENDER_OP_DISPOSE_NONE`: no disposal is done on this frame before rendering the next; its contents are left on the | * `APNG_RENDER_OP_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_RENDER_OP_DISPOSE_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_RENDER_OP_DISPOSE_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_RENDER_OP_DISPOSE_PREVIOUS`: the frame's region is to be reverted to the previous contents. | * `APNG_RENDER_OP_DISPOSE_PREVIOUS`: the frame's region is to be reverted to the previous contents. | ||
`APNG_RENDER_OP_BLEND_FLAG` 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 | `APNG_RENDER_OP_BLEND_FLAG` 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]. Note | ||
that Variation 2 of the sample code is applicable. | that Variation 2 of the sample code is applicable. | ||
edits