File: mng-play-reco-proposal-20070909 It is proposed to register playlist and record MNG chunks: PlAY and ReC0. In this proposal, the new chunk names are shown in private form (second letter lowercase, PlAY). Until the proposal is approved, the private form must be used in any test implementations. It is proposed to document the PlAY and ReCO chunks in the MNG 1.0 Specification, Version 1.0.1, as follows: A. Change document version to 1.0.1. B. Add glossary entry, simplicity bit, and paragraphs 4.2.12 and 4.3.6. Add to glossary: tile A "tile" is a pixel array copied from an object and used to construct a layer. Simplicity profile in MHDR chunk: Add bit 10: 0: PlAY and ReCO chunks are not present. 1: PlAY or ReCO chunks may be present. 4.2.12. ReCO Record current frame The ReCO chunk is useful for accomplishing the equivalent of the GIF "restore-to-previous" disposal method. This chunk is currently not a registered MNG chunk. Registration is being pursued with the PNG Registration Authority. In the meantime, the private form of the chunk name (ReCO, with a lowercase "e"), must be used in any public datastreams. It has two fields Object_id (16-bit unsigned int): Existing object to be used for storing image of frame Mode (byte) 0: Initialize object to transparent and start recording offscreen copy of current frame (including any background layers). 1: Stop recording. 2: Restart recording with existing contents. The object_id must already have been the subject of a DEFI chunk and must still exist. The dimensions and location of the area to be recorded are specified in the DEFI chunk. Each layer that is defined while the ReCO chunk is in recording mode is composited over whatever is in the object. It is permitted to have more than one ReCO object open at the same time. The first ReCO chunk for each object in a segment must have mode 0, and the last ReCO chunk for each object in a segment must have mode 1. 4.3.6. PlAY Playlist The PlAY chunk contains a compressed "play list" that provides instructions to the decoder for constructing animation layers from pieces of previously defined objects. This chunk is currently not a registered MNG chunk. Registration is being pursued with the PNG Registration Authority. In the meantime, the private form of the chunk name (PlAY, with a lowercase "l"), must be used in any public datastreams. The PlAY chunk contains a 1-byte header followed by one or more 36-byte layer structures. The header gives the compression method: Compression_method (byte) 0: deflate. Layer_structure_array[n] (n > 0; n * 36 bytes (compressed): layer structures. Each layer is a tile combined with a transparent background to form a layer of size (frame_width, frame_height), from the MHDR chunk. Each layer is initialized to a transparent (RGBA(0,0,0,0)) rectangle The layer structure array is always compressed according to the specified compression method. A layer is described by a structure of 36 bytes: Object (unsigned int) Object ID of source image. Delta mode (unsigned byte) 0: location and boundaries are absolute. 1: location and boundaries are deltas from the DEFI values for the object. Update mode (unsigned byte) 0: Do not update DEFI values of location and boundaries. 1: Update DEFI values. Left (signed integer) Left of tile destination. Top (signed integer) Top of tile destination. Right (signed integer) Right of tile destination. Bottom (signed integer) Bottom of tile destination. X_location (signed integer) X location of object destination. Y_location (signed integer) Y location of object destination. Delay (unsigned integer) Interframe delay. Timeout (unsigned integer) Interframe timeout. If the object_id is non-zero, the tile is taken from the already existing object buffer as it exists when the PlAY chunk is encountered. If it is zero, the tile is taken from the next instance of object 0 following the PlAY chunk. If any layer of the playlist refers to object 0, all of the layers in the playlist must refer to object 0, and all of them are taken from the single immediately following instance of object 0. The stored values of the boundaries and location are taken from the DEFI chunk. These are used as the basis for computing current values to be used when delta_mode is 1, and the results, whether from a delta calculation or from supplied absolute values, are used to update the stored values when update_mode is 1. The layer data identifies a rectangle (left,right,top,bottom) in the object containing pixels of a tile. The boundaries are measured from the upper left corner of the frame, after the object has been relocated to the position (x_location,y_location). Any part of the tile outside the object must be treated as transparent. Any part of the tile which extends outside the layer must be ignored. The tile width or height may be zero, in which case the layer contains all transparent pixels. The location and clipping boundaries from the DEFI chunk for the object are used to initialize and store these values. These are used as the basis for computing current values to be used when delta_mode is 1, and the results, whether from a delta calculation or from supplied absolute values, are used to update the stored values in the object attributes when update_mode is 1. The delay is measured in ticks_per_second from the MHDR chunk. Even if a layer's tile is entirely outside the layer, the delay for the resulting empty layer must be handled in the same way as if it were inside the frame. The timeout field can be a number or . Infinity is represented by 0x7FFF FFFF. When the delay is nonzero and the timeout is greater than the interframe delay, the application can adjust the interframe delay, provided that it is not greater than the greater of the specified interframe delay and the timeout nor smaller than the smaller of the specified interframe delay and the timeout. If the decoder can interact with the user, it should wait for permission from the user (e.g., via a keypress) before proceeding, but must wait no less than the smaller of the timeout and the interframe delay nor no longer than the greater of the timeout and the interframe delay. A playlist containing references to both object 0 and a non- zero object, and two or more PlAY chunks referring to the same instance of object 0 are error conditions, and decoders must reject such PlAY chunks. C. Add to the Appendix: Revision History * 30 Oct 2007 (version 1.0.1): * Added the PlAY and ReCO animation chunks.