*** mng-0.95a-19990527-pdg.txt Fri May 28 08:25:26 1999 --- mng-0.95b-19990527-pdg.txt Fri May 28 08:25:26 1999 *************** *** 3,22 **** ! MNG (Multiple-image Network Graphics) Format Version 0.95a For list of authors, see Credits (Chapter 18). Status of this Memo ! This document is a specification by the PNG development group. - It has been approved by a vote of the group, and future technical - changes will require formal approval by a vote of the group. It - is the intent of the group to maintain backward compatibility if - possible. We will, however, correct any technical deficiencies - discovered in the course of developing "beta" implementations. - Comments on this document can be sent to the PNG specification maintainers at one of the following addresses: --- 3,18 ---- ! MNG (Multiple-image Network Graphics) Format Version 0.95b For list of authors, see Credits (Chapter 18). Status of this Memo ! This is a DRAFT proposal for voting purposes. Depending on the ! outcome of voting, either this document or version 0.95a will ! become version 0.96. Comments on this document can be sent to the PNG specification maintainers at one of the following addresses: *************** *** 35,63 **** Changes from sixty-third MNG draft (mng-0.95-19990425) ! * Revised wording of paragraph 3.3 about using the reference ! count to decide whether to discard an object buffer, and to ! describe "viewable objects" as well as "viewable object ! buffers". ! ! * Clarified that an image is displayed immediately if it is the ! subject of a CLON chunk with do_not_show==0. ! ! * Revised Example 6 to demonstrate use of global and local PLTE ! and gAMA, and correct the CLON chunk. ! ! * Revised usage of CLON chunk in Examples 7 and 9. ! ! * Revised examples 13 and 14 to get TERM and BACK in the right ! order. ! ! * Started a Rationale section. ! ! * Started a Revision History section. ! * Changed "JDAT_sample_depth" to "image_sample_depth" and ! "IDAT_sample_depth" to "alpha_sample_depth", etc. This is only ! an editorial change, not a spec change. Abstract --- 31,103 ---- Changes from sixty-third MNG draft (mng-0.95-19990425) ! * Changes that require a vote: ! * In MNG-0.95, the status of objects between the DEFI chunk ! and the subsequent embedded image was unclear. It is ! advantageous to be able to manipulate the object ! attributes even before the object buffer exists. ! ! * An object now "comes into existence" when it is named in ! a DEFI chunk instead of later, when the corresponding ! embedded image is received. Object 0 always exists. ! This makes it possible to MOVE or CLIP objects whose ! object buffer does not yet exist, and to use MOVE and ! CLIP with object 0. ! ! * The special treatment of the object attributes set for ! object 0 has been eliminated. In MNG-0.95, the attribute ! set was lost immediately after the IEND chunk for the ! corresponding embedded object had been processed. Now ! the attributes set for object 0 persists in the same way ! as other objects, and object 0 can now be the subject of ! MOVE and CLIP chunks. ! ! * Any attempt to display a nonviewable object must be ! ignored and not treated as an error. The restriction ! that a nonviewable object must not be made potentially ! visible has been removed. ! ! * Any nonviewable object included in the list of objects to ! be processed by the SHOW chunk must be ignored and not ! treated as an error (in MNG-0.95 and earlier, the SHOW ! chunk would change its visibility but not display it). ! ! * If fields are omitted from the DEFI chunk, values are ! inherited from a previous DEFI chunk, if one was present. ! In MNG-0.95, such fields assumed specified default ! values. In this version, the default values are only ! used if no prior DEFI chunk with the same object_id was ! present or if the prior DEFI chunk has been discarded. ! ! * The termination_condition byte of the LOOP chunk has been ! extended to include a "cacheable" bit. ! ! * Changes that do not require a vote: ! ! * Revised wording of paragraph 3.3 about using the ! reference count to decide whether to discard an object ! buffer, and to describe "viewable objects" as well as ! "viewable object buffers". ! ! * Clarified that an image is displayed immediately if it is ! the subject of a CLON chunk with do_not_show==0. ! ! * Revised Example 6 to demonstrate use of global and local ! PLTE and gAMA, and correct the CLON chunk. ! ! * Revised usage of CLON chunk in Examples 7 and 9. ! ! * Revised examples 13 and 14 to get TERM and BACK in the ! right order. ! ! * Started a Rationale section. ! ! * Started a Revision History section. ! ! * Changed "JDAT_sample_depth" to "image_sample_depth" and ! "IDAT_sample_depth" to "alpha_sample_depth", etc. This ! is only an editorial change, not a spec change. Abstract *************** *** 197,204 **** 12.3. Uniform Resource Identifier (URI) 13. Rationale 14. Revision History ! 14.1. Version 0.95a ! 14.2. Version 0.95 15. References 16. Security Considerations 17. Appendix: Examples --- 237,245 ---- 12.3. Uniform Resource Identifier (URI) 13. Rationale 14. Revision History ! 14.1. Version 0.95b ! 14.2. Version 0.95a ! 14.3. Version 0.95 15. References 16. Security Considerations 17. Appendix: Examples *************** *** 651,660 **** Object exists. An object comes into existence when ! * an embedded object appears in the MNG datastream. * a CLON chunk creates it. Object does not exist. An object ceases to exist when it does not have the "frozen" attribute and --- 692,703 ---- Object exists. An object comes into existence when ! * a DEFI chunk creates it. * a CLON chunk creates it. + * (Object 0 always exists). + Object does not exist. An object ceases to exist when it does not have the "frozen" attribute and *************** *** 668,685 **** * the MEND chunk appears (or the IEND chunk appears in a simple PNG or JNG file). - * a DEFI chunk with the same object_id appears. - * a new embedded object with the same object_id replaces it without an intervening DEFI chunk. In this case, the new object inherits the object attribute set from the ! previous object with the same nonzero object_id. When ! object_id = 0, it receives the default DEFI attribute ! set. ! ! * it has object_id = 0 and its IEND chunk appears (in this ! case, the object attribute set can be immediately ! discarded). Pointer to an object buffer. Every object (except for object 0) has an object buffer. --- 711,720 ---- * the MEND chunk appears (or the IEND chunk appears in a simple PNG or JNG file). * a new embedded object with the same object_id replaces it without an intervening DEFI chunk. In this case, the new object inherits the object attribute set from the ! previous object with the same object_id. Pointer to an object buffer. Every object (except for object 0) has an object buffer. *************** *** 710,715 **** --- 745,752 ---- An object is viewable if it has a viewable object buffer. It is nonviewable if it has a nonviewable object buffer or if its object buffer has not yet been created or has been destroyed. + Any attempt to display a nonviewable object must be ignored and + not treated as an error. A nonviewable object becomes viewable immediately when the decoder receives a viewable object buffer or when an image *************** *** 747,755 **** datastream or be considered viewable after it has been processed. Object buffer is viewable. ! Any object that points to a viewable object buffer can be made ! potentially visible, but one that points to a nonviewable one ! cannot. Any attempt to do so must be ignored. * A PNG or JNG datastream always has the "viewable" attribute. --- 784,792 ---- datastream or be considered viewable after it has been processed. Object buffer is viewable. ! Any object that points to a viewable object buffer can be ! displayed, but one that points to a nonviewable one cannot. ! Any attempt to do so must be ignored. * A PNG or JNG datastream always has the "viewable" attribute. *************** *** 1070,1094 **** Termination condition: 1 byte (unsigned integer). Omit if termination_condition=0, ! which means Deterministic. ! 1: Decoder discretion. ! 2: User discretion. ! 3: External signal. Iteration min: 4 bytes(unsigned integer). Can be omitted if termination_condition ! != 3. If omitted, the default value is 1. Iteration max: 4 bytes (unsigned integer). Can be omitted if termination_condition ! != 3; must be omitted if iteration_min is omitted; if ! omitted, the default ! value is infinity. Signal number: 4 bytes (unsigned integer). Omit ! if termination_condition != 3. Additional ! signal number: 4 bytes. Omit if ! termination_condition != 3. Decoders must treat the chunks enclosed in a loop exactly as if they had been repeatedly spelled out. Therefore, during the --- 1107,1134 ---- Termination condition: 1 byte (unsigned integer). Omit if termination_condition=0, ! which means Deterministic, not cacheable. ! 1: Decoder discretion, not cacheable. ! 2: User discretion, not cacheable. ! 3: External signal, not cacheable. ! 4: Deterministic, cacheable. ! 5: Decoder discretion, cacheable. ! 6: User discretion, cacheable. ! 7: External signal, cacheable. Iteration min: 4 bytes(unsigned integer). Can be omitted if termination_condition ! is not 3 or 7. If omitted, the default value is 1. Iteration max: 4 bytes (unsigned integer). Can be omitted if termination_condition ! is not 3 or 7; must be omitted if iteration_min is omitted; if ! omitted, the default value is infinity. Signal number: 4 bytes (unsigned integer). Omit ! if termination_condition is not 3 or 7. Additional ! signal number: 4 bytes. Omit if termination_condition ! is not 3 or 7. Decoders must treat the chunks enclosed in a loop exactly as if they had been repeatedly spelled out. Therefore, during the *************** *** 1115,1124 **** Deterministic This is the default behavior, when the termination condition ! field is omitted. The loop terminates after exactly the ! number of iterations specified by the iteration count. This ! value must be used if altering the number of repetitions ! would mess up the MNG datastream, but can be used merely to preserve the author's intent. Decoder-discretion --- 1155,1165 ---- Deterministic This is the default behavior, when the termination condition ! field is omitted or has a value that is unrecognized by the ! decoder. The loop terminates after exactly the number of ! iterations specified by the iteration count. This value ! must be used if altering the number of repetitions would ! mess up the MNG datastream, but can be used merely to preserve the author's intent. Decoder-discretion *************** *** 1146,1151 **** --- 1187,1201 ---- determined by the arrival of a signal whose number matches one of the signal_number fields. + When the value of the termination condition flag is 4 or more, + the loop is guaranteed to be "cacheable", which means that + every iteration of the loop produces the same sequence of + frames, and that all objects and object buffers are left in the + same condition at the end of each iteration. Decoders can use + this information to select a different strategy for handling + the loop, such as storing the composited frames in a cache and + replaying them rather than decoding them repeatedly. + The iteration_min and iteration_max can be omitted. If the condition is the values are not used. Otherwise, defaults of 1 and are used. The *************** *** 1221,1229 **** visible. This field can be omitted if the concrete_flag, location, and clipping boundary fields are also ! omitted. When it is omitted, the ! image is potentially visible ! (do_not_show=0). Concrete flag: 1 byte (unsigned integer) 0: Make the objects "abstract" (image --- 1271,1277 ---- visible. This field can be omitted if the concrete_flag, location, and clipping boundary fields are also ! omitted. Concrete flag: 1 byte (unsigned integer) 0: Make the objects "abstract" (image *************** *** 1233,1249 **** can be the source for a Delta-PNG). This field can be omitted if the location and clipping boundary fields ! are also omitted. When it is omitted, ! the object is made "abstract" ! (concrete_flag=0). MNG-LC decoders can ignore this flag. X_location: 4 bytes (signed integer). The X_location and Y_location fields can be omitted if the clipping boundaries ! are also omitted. If so, decoders must ! assume default values {X_location=0, ! Y_location=0}. Y_location: 4 bytes (signed integer). --- 1281,1293 ---- can be the source for a Delta-PNG). This field can be omitted if the location and clipping boundary fields ! are also omitted. MNG-LC decoders can ignore this flag. X_location: 4 bytes (signed integer). The X_location and Y_location fields can be omitted if the clipping boundaries ! are also omitted. Y_location: 4 bytes (signed integer). *************** *** 1250,1258 **** Left_cb: 4 bytes (signed integer). Left clipping boundary. The left_cb, right_cb, top_cb, and bottom_cb fields can be ! omitted as a group. If so, decoders ! must assume default values ! {0, frame_width, 0, frame_height}. Right_cb: 4 bytes (signed integer). --- 1294,1300 ---- Left_cb: 4 bytes (signed integer). Left clipping boundary. The left_cb, right_cb, top_cb, and bottom_cb fields can be ! omitted as a group. Right_cb: 4 bytes (signed integer). *************** *** 1276,1288 **** a single DEFI chunk. When object_id is nonzero, the DEFI chunk values remain in effect until another DEFI chunk or a SEEK chunk appears, unless they are modified by SHOW, MOVE, or CLIP ! chunks. When object_id=0, the DEFI chunk values are discarded ! after the object's IEND chunk is processed. The object_id and ! concrete_flag can only be changed by using another DEFI chunk. ! If no DEFI chunk is in effect (either because there is none in ! the datastream, or because a DISC or SEEK chunk has caused it ! to be discarded), the decoder must use the following default ! values: Object_id = 0 Do_not_show = 0 --- 1318,1328 ---- a single DEFI chunk. When object_id is nonzero, the DEFI chunk values remain in effect until another DEFI chunk or a SEEK chunk appears, unless they are modified by SHOW, MOVE, or CLIP ! chunks. The object_id and concrete_flag can only be changed by ! using another DEFI chunk. If no DEFI chunk is in effect ! (either because there is none in the datastream, or because a ! DISC or SEEK chunk has caused it to be discarded), the decoder ! must use the following default values: Object_id = 0 Do_not_show = 0 *************** *** 1294,1299 **** --- 1334,1354 ---- Top_cb = 0 Bottom_cb = frame_height + These default values are also used to fill any fields that were + omitted from the DEFI chunk, when an object with the same + object_id has not been previously defined or a DISC or SEEK + chunk has caused it to be discarded. + + The object attributes for all unfrozen objects, including + object 0, become undefined when a SEEK chunk is encountered. + Encoders must ensure that the first DEFI chunk for every + object_id after any SEEK chunk does not omit any fields that + were set to values other than these defaults in the previous + DEFI chunk for that object_id, because simple decoders are + allowed to ignore the SEEK chunk. Decoders that jump or skip + to SEEK chunks must assume these defaults for any omitted + fields in the first DEFI chunk in a segment for each object_id. + If object_id is an identifier that already exists when a DEFI chunk appears, the object attribute set (except for the pointer to the object buffer) is immediately replaced, but the contents *************** *** 1510,1518 **** either 0 (abstract) or 1 (concrete), depending on whether the basis image is intended for subsequent use by a Delta-PNG datastream or not. When it is abstract it must also be ! viewable. When do_not_show=0 or viewable=1, the resulting ! image, after the pixel samples are filled in, must be a legal ! PNG image. If do_not_show=0, a viewer is expected to display it immediately, as if it were decoding a PNG datastream. If an object already exists with the same object_id, the --- 1565,1573 ---- either 0 (abstract) or 1 (concrete), depending on whether the basis image is intended for subsequent use by a Delta-PNG datastream or not. When it is abstract it must also be ! viewable. When viewable=1, the resulting image, after the ! pixel samples are filled in, must be a legal PNG image. If ! viewable=1 and do_not_show=0, a viewer is expected to display it immediately, as if it were decoding a PNG datastream. If an object already exists with the same object_id, the *************** *** 1638,1644 **** Only the location, potential visibility, and clipping boundaries can be changed independently for each partial clone. ! If do_not_show=0, the resulting image is displayed immediately. 4.2.7. DHDR, Delta-PNG chunks, IEND --- 1693,1700 ---- Only the location, potential visibility, and clipping boundaries can be changed independently for each partial clone. ! If viewable=1 and do_not_show=0, the resulting image is ! displayed immediately. 4.2.7. DHDR, Delta-PNG chunks, IEND *************** *** 2379,2387 **** The chunk's contents are: ! First object: 2 bytes (nonzero unsigned integer). ! Last object: 2 bytes (nonzero unsigned integer). Location delta type: 1 byte (unsigned integer). --- 2435,2443 ---- The chunk's contents are: ! First object: 2 bytes (unsigned integer). ! Last object: 2 bytes (unsigned integer). Location delta type: 1 byte (unsigned integer). *************** *** 2424,2432 **** of objects must be clipped for display. It contains the following 21 bytes: ! First object: 2 bytes (nonzero unsigned integer). ! Last object: 2 bytes (nonzero unsigned integer). Clip delta type: 1 byte (unsigned integer). 0: CLIP data gives boundary values --- 2480,2488 ---- of objects must be clipped for display. It contains the following 21 bytes: ! First object: 2 bytes (unsigned integer). ! Last object: 2 bytes (unsigned integer). Clip delta type: 1 byte (unsigned integer). 0: CLIP data gives boundary values *************** *** 2617,2629 **** Similarly, the CLON chunk need not be followed by a SHOW chunk, if do_not_show=0 in the CLON chunk. ! It is not an error for the SHOW chunk to name an object that ! has not previously been defined. In such cases, nothing is ! done to the nonexistent object. ! ! If a nonviewable object is named, its do_not_show flag is ! changed, but it is not displayed even if the SHOW chunk ! requests it. 4.3.6. TERM Termination action --- 2673,2681 ---- Similarly, the CLON chunk need not be followed by a SHOW chunk, if do_not_show=0 in the CLON chunk. ! It is not an error for the SHOW chunk to name a nonviewable ! object or an object that has not previously been defined. In ! such cases, nothing is done to the nonexistent object. 4.3.6. TERM Termination action *************** *** 2664,2671 **** number of times to repeat the animation. The loop created by processing a TERM must always be treated by ! the decoder as if it were a loop, with ! iteration_min=1. The TERM chunk, if present, must appear either immediately after the MHDR chunk or immediately prior to a SEEK chunk. The --- 2716,2723 ---- number of times to repeat the animation. The loop created by processing a TERM must always be treated by ! the decoder as if it were a cacheable loop, ! with iteration_min=1. The TERM chunk, if present, must appear either immediately after the MHDR chunk or immediately prior to a SEEK chunk. The *************** *** 5066,5072 **** 14. Revision History ! 14.1. Version 0.95a Released 27 May 1999. --- 5118,5156 ---- 14. Revision History ! 14.1. Version 0.95b ! ! Proposed 27 May 1999. ! ! * An object "comes into existence" when it is named in a DEFI ! chunk instead of later, when the corresponding embedded ! image is received. This makes it possible to MOVE or CLIP ! objects whose object buffer does not yet exist. ! ! * The special treatment of the object attributes set for ! object 0 was eliminated. ! ! * Any attempt to display a nonviewable object must be ignored ! and not treated as an error. The restriction that a ! nonviewable object must not be made potentially visible was ! removed. ! ! * Any nonviewable object included in the list of objects to be ! processed by the SHOW chunk must be ignored and not treated ! as an error (in MNG-0.95 and earlier, the SHOW chunk would ! change its visibility but not display it). ! ! * If fields are omitted from the DEFI chunk, values are ! inherited from a previous DEFI chunk, if one was present. ! In MNG-0.95, such fields assumed specified default values. ! In this version, the default values are only used if no ! prior DEFI chunk with the same object_id was present or if ! the prior DEFI chunk has been discarded. ! ! * The termination_condition byte of the LOOP chunk was ! extended to include a "cacheable" bit. ! ! 14.2. Version 0.95a Released 27 May 1999. *************** *** 5085,5091 **** * Started a Revision History section. ! 14.2. Version 0.95 Initial public release, approved by the PNG Development Group on 11 May 1999. --- 5169,5175 ---- * Started a Revision History section. ! 14.3. Version 0.95 Initial public release, approved by the PNG Development Group on 11 May 1999.