home *** CD-ROM | disk | FTP | other *** search
/ Encyclopedia of Graphics File Formats Companion / GFF_CD.ISO / formats / fli / spec / fli.txt
Text File  |  1994-06-01  |  39KB  |  1,101 lines

  1. Animator Pro File Formats
  2.  
  3.  
  4. This chapter details each of the file formats defined
  5. by Animator Pro.  Formats supported by Animator Pro but
  6. defined by another party, such as GIF and TIFF files,
  7. are not described in this document.
  8.  
  9. The files created by Autodesk Animator Pro are a
  10. superset of those created by the original Autodesk
  11. Animator.  In some cases the Animator Pro formats are
  12. identical with the older Animator format.  In other
  13. cases, new data fields or data compression techniques
  14. have been added to the file.  
  15.  
  16. All two-byte and four-byte data values in Animator Pro
  17. files are stored in Intel-style order, the same as they
  18. would appear in memory on an 80x86 machine.
  19.  
  20.  
  21. Common Hierarchial Chunked File Structure
  22.  
  23.  
  24. In general, Animator Pro files contain one or more
  25. chunks of information.  Conceptually, a chunk is a
  26. combination of control information and data.  The most
  27. common Animator Pro file format is a header structure
  28. followed by hierarchial data chunks.  
  29.  
  30. Every chunk begins with a header of at least 6 bytes.
  31. The first four bytes contain the length of the chunk
  32. (including the header itself, and also including the
  33. length of all subordinate chunks, if any).  The next two
  34. bytes are an identifier word which describes the type
  35. of data in the chunk.  Some chunks have headers longer
  36. than six bytes, but the size and identifier fields
  37. always occupy the first six bytes of the header.
  38.  
  39. The Animator Pro animation file is a good example of a
  40. hierarchial chunked file structure.  The data in an 
  41. animation file is arranged as follows:
  42.  
  43.       animation file:
  44.             optional prefix chunk: 
  45.                   settings chunk
  46.                   cel placement chunk
  47.             frame 1 chunk:
  48.                   postage stamp chunk:
  49.                         postage stamp data
  50.                   color palette chunk
  51.                   pixel data chunk
  52.             frame 2 chunk:
  53.                   pixel data chunk
  54.             frame 3 chunk:
  55.                   color palette chunk
  56.                   pixel data chunk
  57.             frame 4 chunk:  
  58.                   color palette chunk
  59.             ring frame chunk:
  60.                   color palette chunk
  61.                   pixel data chunk
  62.  
  63. It is possible that new types of chunks not described
  64. in this document will be added to animation files in the
  65. future.  We recommend that you quietly ignore unknown
  66. chunk types you encounter during animation playback. 
  67. The size fields in the chunk headers make it easy to
  68. skip an entire unrecognized chunk.
  69.  
  70.  
  71. FLC - Animator Pro Flic Files
  72.  
  73.  
  74. This is the main animation file format created by
  75. Animator Pro.  The file contains a 128-byte header,
  76. followed by an optional prefix chunk, followed by one
  77. or more frame chunks.  
  78.  
  79. The prefix chunk, if present, contains Animator Pro
  80. settings information, CEL placement information, and
  81. other auxiliary data.
  82.  
  83. A frame chunk exists for each frame in the animation. 
  84. In addition, a ring frame follows all the animation
  85. frames.  Each frame chunk contains color palette
  86. information and/or pixel data.
  87.  
  88. The ring frame contains delta-compressed information to
  89. loop from the last frame of the flic back to the first. 
  90. It can be helpful to think of the ring frame as a copy
  91. of the first frame, compressed in a different way.  All
  92. flic files will contain a ring frame, including a
  93. single-frame flic.
  94.  
  95.  
  96. The FLC file header
  97.  
  98.  
  99. A FLC file begins with a 128-byte header, described
  100. below.  All lengths and offsets are in bytes.  All 
  101. values stored in the header fields are unsigned.
  102.  
  103. Offset  Length  Name      Description
  104.  
  105.    0      4     size      The size of the entire
  106.                           animation file, including this
  107.                           file header.
  108.  
  109.    4      2     magic     File format identifier. 
  110.                           Always hex AF12.
  111.  
  112.    6      2     frames    Number of frames in the flic. 
  113.                           This count does not include
  114.                           the ring frame.  FLC files
  115.                           have a maximum length of 4000
  116.                           frames.
  117.  
  118.    8      2     width     Screen width in pixels.
  119.  
  120.   10      2     height    Screen height in pixels.
  121.  
  122.   12      2     depth     Bits per pixel (always 8).
  123.  
  124.   14      2     flags     Set to hex 0003 after ring
  125.                           frame is written and flic
  126.                           header is updated.  This
  127.                           indicates that the file was
  128.                           properly finished and closed.
  129.  
  130.   16      4     speed     Number of milliseconds to
  131.                           delay between each frame
  132.                           during playback.
  133.  
  134.   20      2     reserved  Unused word, set to 0.
  135.  
  136.   22      4     created   The MSDOS-formatted date and
  137.                           time of the file's creation.
  138.  
  139.   26      4     creator   The serial number of the
  140.                           Animator Pro program used to
  141.                           create the file.  If the file
  142.                           was created by some other
  143.                           program using the FlicLib
  144.                           development kit, this value
  145.                           is hex 464C4942 ("FLIB").
  146.  
  147.   30      4     updated   The MSDOS-formatted date and
  148.                           time of the file's most recent
  149.                           update.
  150.  
  151.   34      4     updater   Indicates who last updated
  152.                           the file.  See the description
  153.                           of creator.
  154.  
  155.   38      2     aspectx   The x-axis aspect ratio at
  156.                           which the file was created.
  157.  
  158.   40      2     aspecty   The y-axis aspect ratio at
  159.                           which the file was created. 
  160.                           Most often, the x:y aspect
  161.                           ratio will be 1:1.  A 320x200
  162.                           flic has a ratio of 6:5.
  163.  
  164.   42     38     reserved  Unused space, set to zeroes.
  165.  
  166.   80      4     oframe1   Offset from the beginning of
  167.                           the file to the first
  168.                           animation frame chunk.
  169.  
  170.   84      4     oframe2   Offset from the beginning of
  171.                           the file to the second
  172.                           animation frame chunk.  This
  173.                           value is used when looping
  174.                           from the ring frame back to
  175.                           the second frame during
  176.                           playback.
  177.  
  178.   88     40     reserved  Unused space, set to zeroes.
  179.  
  180.  
  181. The FLC prefix chunk
  182.  
  183.  
  184. An optional prefix chunk may immediately follow the
  185. animation file header.  This chunk is used to store
  186. auxiliary data which is not directly involved in the
  187. animation playback.  The prefix chunk starts with a
  188. 16-byte header (identical in structure to a frame
  189. header), as follows:
  190.  
  191. Offset  Length  Name      Description
  192.  
  193.    0      4     size      The size of the prefix chunk,
  194.                           including this header and all
  195.                           subordinate chunks that
  196.                           follow.
  197.  
  198.    4      2     type      Prefix chunk identifier. 
  199.                           Always hex F100.
  200.  
  201.    6      2     chunks    Number of subordinate chunks
  202.                           in the prefix chunk.
  203.  
  204.    8      8     reserved  Unused space, set to zeroes.
  205.  
  206. To determine whether a prefix chunk is present, read the
  207. 16-byte header following the file header.  If the type
  208. value is hex F100, it's a prefix chunk.  If the value
  209. is hex F1FA it's the first frame chunk, and no prefix
  210. chunk exists.
  211.  
  212. Note
  213.       Programs other than Animator Pro should
  214.       never need to create flic files that 
  215.       contain a prefix chunk.  Programs reading
  216.       a flic file should skip the prefix chunk by
  217.       using the size value in the prefix header
  218.       to read and discard the prefix, or by
  219.       seeking directly to the first frame using
  220.       the oframe1 field from the file header.
  221.  
  222.  
  223. The FLC frame chunks
  224.  
  225.  
  226. Frame chunks contain the pixel and color data for the
  227. animation.  A frame chunk may contain multiple
  228. subordinate chunks, each containing a different type of
  229. data for the current frame.  Each frame chunk starts
  230. with a 16-byte header that describes the contents of
  231. the frame:
  232.  
  233. Offset  Length  Name      Description
  234.  
  235.    0      4     size      The size of the frame chunk,
  236.                           including this header and all
  237.                           subordinate chunks that
  238.                           follow.
  239.  
  240.    4      2     type      Frame chunk identifier. 
  241.                           Always hex F1FA.
  242.  
  243.    6      2     chunks    Number of subordinate chunks
  244.                           in the frame chunk.
  245.  
  246.    8      8     reserved  Unused space, set to zeroes.
  247.  
  248. Immediately following the frame header are the frame's
  249. subordinate data chunks.  When the chunks count in the
  250. frame header is zero, it indicates that this frame is
  251. identical to the previous frame.  This implies that no
  252. change is made to the screen or color palette, but the
  253. appropriate delay is still inserted during playback.
  254.  
  255. Each data chunk within a frame chunk is formatted as
  256. follows:
  257.  
  258. Offset  Length  Name      Description
  259.  
  260.    0       4    size      The size of the chunk,
  261.                           including this header.
  262.  
  263.    4       2    type      Data type identifier.
  264.  
  265.    6   (size-6) data      The color or pixel data.
  266.  
  267.  
  268. The type values in the chunk headers indicate what type
  269. of graphics data the chunk contains and which
  270. compression method was used to encode the data.  The
  271. following values (and their associated mnemonic names)
  272. are currently found in frame data chunks:
  273.  
  274. Value  Name             Description
  275.  
  276.   4    FLI_COLOR256     256-level color palette info
  277.   7    FLI_SS2          Word-oriented delta compression
  278.  11    FLI_COLOR        64-level color palette info
  279.  12    FLI_LC           Byte-oriented delta compression
  280.  13    FLI_BLACK        Entire frame is color index 0
  281.  15    FLI_BRUN         Byte run length compression
  282.  16    FLI_COPY         No compression
  283.  18    FLI_PSTAMP       Postage stamp sized image
  284.  
  285. The following sections describe each of these data
  286. encoding methods in detail.
  287.  
  288.  
  289. Chunk Type  4 (FLI_COLOR256) - 256-Level Color
  290.  
  291.  
  292. The data in this chunk is organized in packets.  The
  293. first word following the chunk header is a count of the
  294. number of packets in the chunk.  Each packet consists
  295. of a one-byte color index skip count, a one-byte color
  296. count and three bytes of color information for each
  297. color defined.
  298.  
  299. At the start of the chunk, the color index is assumed
  300. to be zero.  Before processing any colors in a packet,
  301. the color index skip count is added to the current
  302. color index.  The number of colors defined in the
  303. packet is retrieved.  A zero in this byte indicates 256
  304. colors follow.  The three bytes for each color define
  305. the red, green, and blue components of the color in
  306. that order.  Each component can range from 0 (off) to
  307. 255 (full on).  
  308. The data to change colors 2,7,8, and 9 would appear as
  309. follows:
  310.  
  311.       2                       ; two packets 
  312.       2,1,r,g,b               ; skip 2, change 1 
  313.       4,3,r,g,b,r,g,b,r,g,b   ; skip 4, change 3
  314.  
  315.  
  316. Chunk Type 11 (FLI_COLOR) - 64-Level Color
  317.  
  318.  
  319. This chunk is identical to FLI_COLOR256 except that the
  320. values for the red, green and blue components are in
  321. the range of 0-63 instead of 0-255.
  322.  
  323.  
  324. Chunk Type 13 (FLI_BLACK) - No Data
  325.  
  326.  
  327. This chunk has no data following the header.  All
  328. pixels in the frame are set to color index 0.
  329.  
  330.  
  331. Chunk Type 16 (FLI_COPY) - No Compression
  332.  
  333.  
  334. This chunk contains an uncompressed image of the frame. 
  335. The number of pixels following the chunk header is
  336. exactly the width of the animation times the height of
  337. the animation.  The data starts in the upper left
  338. corner with pixels copied from left to right and then
  339. top to bottom.  This type of chunk is created when the
  340. preferred compression method (SS2 or BRUN) generates
  341. more data than the uncompressed frame image; a
  342. relatively rare situation.
  343.  
  344.  
  345. Chunk Type 15 (FLI_BRUN) - Byte Run Length Compression
  346.  
  347.  
  348. This chunk contains the entire image in a compressed
  349. format.  Usually this chunk is used in the first frame
  350. of an animation, or within a postage stamp image chunk.
  351.  
  352.  
  353. The data is organized in lines.  Each line contains
  354. packets of compressed pixels.  The first line is at the
  355. top of the animation, followed by subsequent lines
  356. moving downward.  The number of lines in this chunk is
  357. given by the height of the animation.
  358.  
  359. The first byte of each line is a count of packets in
  360. the line.  This value is ignored, it is a holdover from
  361. the original Animator.  It is possible to generate more
  362. than 255 packets on a line.  The width of the animation
  363. is now used to drive the decoding of packets on a line;
  364. continue reading and processing packets until width
  365. pixels have been processed, then proceed to the next
  366. line.
  367.  
  368. Each packet consist of a type/size byte, followed by
  369. one or more pixels.  If the packet type is negative it
  370. is a count of pixels to be copied from the packet to
  371. the animation image.  If the packet type is positive it
  372. contains a single pixel which is to be replicated; the
  373. absolute value of the packet type is the number of
  374. times the pixel is to be replicated.
  375.  
  376.  
  377. Chunk Type 12 (FLI_LC) - Byte Aligned Delta Compression
  378.  
  379.  
  380. This chunk contains the differences between the
  381. previous frame and this frame.  This compression method
  382. was used by the original Animator, but is not created
  383. by Animator Pro.  This type of chunk can appear in an
  384. Animator Pro file, however, if the file was originally
  385. created by Animator, then some (but not all) frames
  386. were modified using Animator Pro.  
  387.  
  388. The first 16-bit word following the chunk header
  389. contains the position of the first line in the chunk. 
  390. This is a count of lines (down from the top of the
  391. image) which are unchanged from the prior frame.  The
  392. second 16-bit word contains the number of lines in the
  393. chunk.  The data for the lines follows these two words.
  394.  
  395. Each line begins with two bytes.  The first byte
  396. contains the starting x position of the data on the
  397. line, and the second byte the number of packets for the
  398. line.  Unlike BRUN compression, the packet count is
  399. significant (because this compression method is only
  400. used on 320x200 flics).
  401.  
  402. Each packet consists of a single byte column skip,
  403. followed by a packet type/size byte.  If the packet
  404. type is positive it is a count of pixels to be copied
  405. from the packet to the animation image.  If the packet
  406. type is negative it contains a single pixel which is to
  407. be replicated; the absolute value of the packet type
  408. gives the number of times the pixel is to be
  409. replicated.
  410.  
  411.                          Note
  412.  
  413.       The negative/positive meaning of the packet
  414.       type bytes in LC compression is reversed
  415.       from that used in BRUN compression.  This
  416.       gives better performance during playback.
  417.  
  418.  
  419. Chunk Type  7 (FLI_SS2) - Word Aligned Delta Compression
  420.  
  421.  
  422. This format contains the differences between
  423. consecutive frames.  This is the format most often used
  424. by Animator Pro for frames other than the first frame
  425. of an animation.  It is similar to the line coded delta
  426. (LC) compression, but is word oriented instead of byte
  427. oriented.  The data is organized into lines and each
  428. line is organized into packets.
  429.  
  430. The first word in the data following the chunk header
  431. contains the number of lines in the chunk.  Each line
  432. can begin with some optional words that are used to
  433. skip lines and set the last byte in the line for
  434. animations with odd widths.  These optional words are
  435. followed by a count of the packets in the line.  The
  436. line count does not include skipped lines.
  437.  
  438. The high order two bits of the word is used to
  439. determine the contents of the word.
  440.  
  441.       Bit 15  Bit 14    Meaning
  442.  
  443.         0       0       The word contains the packet
  444.                         count.  The packets follow this
  445.                         word.  The packet count can be
  446.                         zero; this occurs when only the
  447.                         last pixel on a line changes.
  448.  
  449.         1       0       The low order byte is to be
  450.                         stored in the last byte of the
  451.                         current line.  The packet count
  452.                         always follows this word.
  453.  
  454.         1       1       The word contains a line skip
  455.                         count.  The number of lines
  456.                         skipped is given by the
  457.                         absolute value of the word. 
  458.                         This word can be followed by
  459.                         more skip counts, by a last
  460.                         byte word, or by the packet
  461.                         count.
  462.  
  463. The packets in each line are similar to the packets for
  464. the line coded chunk.  The first byte of each packet is
  465. a column skip count.  The second byte is a packet type. 
  466. If the packet type is positive, the packet type is a
  467. count of words to be copied from the packet to the
  468. animation image.  If the packet type is negative, the
  469. packet contains one more word which is to be
  470. replicated.  The absolute value of the packet type
  471. gives the number of times the word is to be replicated. 
  472. The high and low order byte in the replicated word do
  473. not necessarily have the same value.
  474.  
  475.  
  476. Chunk Type 18 (FLI_PSTAMP) - Postage Stamp Image
  477.  
  478.  
  479. This chunk type holds a postage stamp -- a reduced-
  480. size image -- of the frame.  It generally appears only
  481. in the first frame chunk within a flic file.  
  482.  
  483. When creating a postage stamp, Animator Pro considers
  484. the ideal size to be 100x63 pixels.  The actual size
  485. will vary as needed to maintain the same aspect ratio
  486. as the original.
  487.  
  488. The pixels in a postage stamp image are mapped into a
  489. six-cube color space, regardless of the color palette
  490. settings for the full frame image.  A six-cube color
  491. space is formed as follows:
  492.  
  493.       start at palette entry 0
  494.       for red = 0 thru 5
  495.             for green = 0 thru 5
  496.                   for blue = 0 thru 5
  497.                         palette_red   = (red   * 256)/6
  498.  
  499.                         palette_green = (green * 256)/6
  500.                         palette_blue  = (blue  * 256)/6
  501.                         move to next palette entry
  502.                   end for blue
  503.             end for green
  504.       end for red
  505.  
  506. Any arbitrary rgb value (where each component is in the
  507. range of 0-255) can be mapped into the six-cube space
  508. using the formula:
  509.  
  510.   ((6*red)/256)*36 + ((6*green)/256)*6 + ((6*blue)/256)
  511.  
  512. When a frame data chunk has been identified as a
  513. postage stamp, the header for the chunk contains more
  514. fields than just size and type.  The full postage stamp
  515. chunk header is defined as follows:
  516.  
  517. Offset  Length  Name      Description
  518.  
  519.    0      4     size      The size of the postage stamp
  520.                           chunk, including this header.
  521.  
  522.    4      2     type      Postage stamp identifier;
  523.                           always 18.
  524.  
  525.    6      2     height    Height of the postage stamp
  526.                           image, in pixels.
  527.  
  528.    8      2     width     Width of the postage stamp
  529.                           image, in pixels.
  530.  
  531.   10      2     xlate     Color translation type; 
  532.                           always 1, indicating six-
  533.                           cube color space.
  534.  
  535. Immediately following this header is the postage stamp
  536. data.  The data is formatted as a chunk with standard
  537. size/type header.  The type will be one of:
  538.  
  539. Value  Name             Description
  540.  
  541.  15    FPS_BRUN         Byte run length compression
  542.  16    FPS_COPY         No compression
  543.  18    FPS_XLAT256      Six-cube color xlate table
  544.  
  545. The FPS_BRUN and FPS_COPY types are identical to the
  546. FLI_BRUN and FLI_COPY encoding methods described above.
  547.  
  548. The FPS_XLAT256 type indicates that the chunk contains
  549. a 256-byte color translation table instead of pixel
  550. data.  To process this type of postage stamp, read the
  551. pixel data for the full-sized frame image, and
  552. translate its pixels into six-cube space using a lookup
  553. in the 256-byte color translation table.  This type of
  554. postage stamp appears when the size of the animation
  555. frames is smaller than the standard 100x63 postage
  556. stamp size.
  557.  
  558.  
  559. FLI - Original Animator Flic Files
  560.  
  561.  
  562. This animation file format is limited to 320x200
  563. resolution.  It is the main animation file format of
  564. the original Animator, and is still used by Animator
  565. Pro for creating 320x200 animations.  The file
  566. structure is very similar to that of a FLC file.  A FLI
  567. file does not contain a prefix chunk, and does not use
  568. FLI_PSTAMP or FLI_SS2 data encoding in the frame
  569. chunks.
  570.  
  571.  
  572. The FLI file header
  573.  
  574.  
  575. The file header for a FLI file is a subset of the FLC
  576. file header.  It is defined as follows:
  577.  
  578. Offset  Length  Name      Description
  579.  
  580.    0      4     size      The size of the entire
  581.                           animation file, including
  582.                           this file header.
  583.  
  584.    4      2     magic     File format identifier. 
  585.                           Always hex AF11.
  586.  
  587.    6      2     frames    Number of frames in the flic. 
  588.                           This count does not include
  589.                           the ring frame.  FLI files
  590.                           have a maximum length of 4000
  591.                           frames.
  592.  
  593.    8      2     width     Screen width in pixels. This
  594.                           is always 320 in a FLI file.
  595.  
  596.   10      2     height    Screen height in pixels. This
  597.                           is always 200 in a FLI file.
  598.  
  599.   12      2     depth     Bits per pixel (always 8).
  600.  
  601.   14      2     flags     Always zero in a FLI file.
  602.  
  603.   16      2     speed     Number of jiffies to delay
  604.                           between each frame during
  605.                           playback.  A jiffy is 1/70 of
  606.                           a second.
  607.  
  608.   18    110     reserved  Unused space, set to zeroes.
  609.  
  610.  
  611. The FLI frame chunks
  612.  
  613.  
  614. One or more frame chunks immediately follow the FLI
  615. file header.  The frame chunks in a FLI file are
  616. identical to those in a FLC file, except that postage
  617. stamp image (FLI_PSTAMP) and word-runlength-compression
  618. (FLI_SS2) data chunks never appear in FLI files.
  619.  
  620.  
  621. CEL - Animation Cel Files
  622.  
  623.  
  624. CEL files contain one or more frames of image data. 
  625. Both Animator Pro and the original Animator produce CEL
  626. files, but each uses a different file format.
  627.  
  628. To process a CEL file for input, read the first 2 bytes
  629. of the file.  If they are hex 9119, the file is an
  630. original Animator CEL file.  If the first two bytes are
  631. not 9119, it is an Animator Pro CEL file.
  632.  
  633.  
  634. Animator Pro CEL Files
  635.  
  636.  
  637. An Animator Pro CEL file is identical to a FLC file in
  638. all respects.  A CEL file should have a Celdata chunk
  639. in the file prefix chunk which describes the x,y
  640. placement of the CEL.  If the Celdata placement chunk
  641. is not present, assume a placement of 0,0.
  642.  
  643.  
  644. Original Animator CEL Files
  645.  
  646.  
  647. The original Animator also produced CEL files.  These
  648. were still-picture files, not the multi-frame files
  649. Animator Pro now uses.  A CEL file from the original
  650. Animator is identical to a PIC file from the original
  651. Animator in all respects.
  652.  
  653.  
  654. PIC - Picture Files
  655.  
  656.  
  657. PIC files contain still images in an uncompressed
  658. format.  Both the original Animator and Animator Pro
  659. produce PIC files.  The file formats are different;
  660. Animator Pro produces a hierarchial chunked file, while
  661. the original Animator file is a simpler fixed format. 
  662. These formats are detailed in the following sections.
  663.  
  664. To process a PIC file for input, read the first 2 bytes
  665. of the file.  If they are hex 9119, the file is an
  666. original Animator PIC format file.  If the first two
  667. bytes are not 9119, it is an Animator Pro PIC file.
  668.  
  669.  
  670. Animator Pro PIC Files
  671.  
  672.  
  673. Animator Pro uses this format to store a single-frame
  674. picture image or bitmap.  This format description
  675. applies to both PIC and MSK files.  The file begins
  676. with a 64-byte header defined as follows:
  677.  
  678. Offset  Length  Name      Description
  679.  
  680.    0       4    size      The size of the file,
  681.                           including this header.
  682.  
  683.    4       2    magic     File format identifier. 
  684.                           Always hex 9500.
  685.  
  686.    6       2    width     The width of the image, in
  687.                           pixels.
  688.  
  689.    8       2    height    The height of the image, in
  690.                           pixels.
  691.  
  692.   10       2    xcoord    The X coordinate; typically
  693.                           zero.  (See note below).
  694.  
  695.   12       2    ycoord    The Y coordinate; typically
  696.                           zero.  (See note below).
  697.  
  698.   14       4    userid    An arbitrary 4-byte value;
  699.                           generally zero.  Do not count
  700.                           on any particular value in
  701.                           this field.  Set this field
  702.                           to zero when creating a file.
  703.  
  704.   18       1    depth     The number of bits per pixel. 
  705.                           This is 8 for PIC files and
  706.                           1 for MSK files.
  707.  
  708.   19      45    reserved  Unused space; set to zeroes.
  709.  
  710.  
  711.                          Note
  712.  
  713.       The xcoord and ycoord values in a PIC file header
  714.       will typically be zero.  Non-zero values indicate
  715.       that the file contains a rectangle from within a
  716.       larger picture.  In this case, the xcoord and
  717.       ycoord values represent the relation of the saved
  718.       rectangle to the full image.  These values can be
  719.       safely ignored for most purposes.
  720.  
  721. Following the file header are the data chunks for the
  722. image.  Each data chunk within a PIC or MSK file is
  723. formatted as follows:
  724.  
  725. Offset  Length  Name      Description
  726.  
  727.    0       4    size      The size of the chunk,
  728.                           including this header.
  729.  
  730.    4       2    type      Data type identifier.
  731.  
  732.    6   (size-6) data      The color or pixel data.
  733.  
  734. The type values in the chunk headers indicate what type
  735. of graphics data the chunk contains.  The following
  736. values (and their associated mnemonic names) are
  737. currently found in PIC/MSK data chunks:
  738.  
  739. Value  Name             Description
  740.  
  741.   0    PIC_CMAP         Color palette info
  742.   1    PIC_BYTEPIXELS   Byte-per-pixel image data
  743.   2    PIC_BITPIXELS    Bit-per-pixel mask data
  744.  
  745. In a PIC_CMAP chunk, the first 2-byte word is a version
  746. code; currently this is set to zero.  Following the
  747. version word are all 256 palette entries in rgbrgb...
  748. order.  Each of the r, g, and b components is a single
  749. byte in the range of 0-255.  This type of chunk appears
  750. in PIC files; there will generally be no color map
  751. chunk in a MSK file.
  752.  
  753. In a PIC_BYTEPIXELS chunk, the image data appears
  754. immediately following the 6-byte chunk header.  The
  755. data is stored as one byte per pixel, in left-to-right,
  756. top-to-bottom sequence.  This type of chunk appears in
  757. PIC files.
  758.  
  759. In a PIC_BITPIXELS chunk, the bitmap data appears
  760. immediately following the 6-byte chunk header.  The
  761. data is stored as bits packed into bytes such that the
  762. leftmost bits appear in the high-order positions of
  763. each byte.  The bits are stored in left-to-right, top-
  764. to-bottom sequence.  When the width of the bitmap is
  765. not a multiple of 8, there will be unused bits in the
  766. low-order positions of the last byte on each line.  The
  767. number of bytes per line is ((width+7)/8).  This type
  768. of chunk appears in MSK files.  
  769.  
  770.  
  771. Original Animator PIC Files
  772.  
  773.  
  774. The original Animator uses this format to store a
  775. single-frame picture image.  This format description
  776. applies to both PIC and CEL files.  The file begins
  777. with a 32 byte header, as follows:
  778.  
  779. Offset  Length  Name      Description
  780.  
  781.    0       2    type      File type identifier.  Always
  782.                           hex 9119.
  783.  
  784.    2       2    width     Width of image.  Always 320
  785.                           in a PIC file; may be any
  786.                           value in a CEL file.
  787.  
  788.    4       2    height    Height of image.  Always 200
  789.                           in a PIC file; may be any
  790.                           value in a CEL file.
  791.  
  792.    6       2    xcoord    X coordinate for upper left
  793.                           corner of the image.  Always
  794.                           zero in a PIC file; may be
  795.                           non-zero in a CEL file.
  796.  
  797.    8       2    ycoord    Y coordinate for upper left
  798.                           corner of the image.  Always
  799.                           zero in a PIC file; may be
  800.                           non-zero in a CEL file.
  801.  
  802.   10       1    depth     Number of bits per pixel;
  803.                           always 8.
  804.  
  805.   11       1    compress  Compression flag; always
  806.                           zero.
  807.  
  808.   12       4    datasize  Size of the image data in
  809.                           bytes.
  810.  
  811.   16      16    reserved  Unused space; set to zeroes.
  812.  
  813. Immediately following the header is the color map.  It
  814. contains all 256 palette entries in rgbrgb... order. 
  815. Each of the r, g, and b components is a single byte in
  816. the range of 0-63.  Following the color palette is the
  817. image data, one byte per pixel.  The image data is
  818. stored in left-to-right, top-to-bottom sequence.
  819.  
  820.  
  821. MSK - Mask Data Files
  822.  
  823.  
  824. MSK files contain a bitmap image.  Both Animator Pro
  825. and the original Animator produce MSK files, but the
  826. formats are different.
  827.  
  828. To process a MSK file for input, check the file size. 
  829. If it is exactly 8000 bytes, the file is an original
  830. Animator MSK file.  If the file is any other size, it
  831. is an Animator Pro MSK file.
  832.  
  833.  
  834. Animator Pro MSK Files
  835.  
  836.  
  837. An Animator Pro MSK file is identical to an Animator
  838. Pro PIC file.  It will have a pixel depth of 1.
  839.  
  840.  
  841. Original Animator MSK Files
  842.  
  843.  
  844. A MSK file created by the original Animator is exactly
  845. 8000 bytes long.  There is no file header or other
  846. control information in the file.  It contains the image
  847. bit map, 1 bit per pixel, with the leftmost pixels
  848. packed into the high order bits of each byte.  The size
  849. of the image is fixed at 320x200.  The image is stored
  850. left-to-right, top-to-bottom.
  851.  
  852.  
  853. COL - Color Map Files
  854.  
  855.  
  856. A COL file stores the rgb values for entries in the
  857. color palette.  Both Animator Pro and the original
  858. Animator produce COL files, but the formats are
  859. different.
  860.  
  861. To process a COL file for input, check the file size. 
  862. If it is exactly 768 bytes, the file is an original
  863. Animator COL file.  If the file is any other size, it
  864. is an Animator Pro COL file.
  865.  
  866.  
  867. Animator Pro COL Files
  868.  
  869.  
  870. An Animator Pro COL file stores color palette
  871. information.  The file begins with an 8-byte header
  872. defined as follows:
  873.  
  874. Offset  Length  Name      Description
  875.  
  876.    0       4    size      The size of the file,
  877.                           including this header.
  878.  
  879.    4       2    magic     File format identifier. 
  880.                           Always hex B123.
  881.  
  882.    6       2    version   The version of color storage
  883.                           format.  Currently set to
  884.                           zero, indicating 256-level
  885.                           color data in each r,g,b
  886.                           component.
  887.  
  888. Following the file header are palette entries in
  889. rgbrgb... order.  Each of the r, g, and b components is
  890. a single byte in the range of 0-255.  Generally, there
  891. will be data for 256 palette entries, but this cannot
  892. be assumed.  The actual number of palette entries is
  893. ((size-8)/3); if this value is not an even multiple of
  894. three, the file is corrupted.
  895.  
  896.  
  897. Original Animator COL Files2
  898.  
  899.  
  900.  
  901. A COL file created by the original Animator is exactly
  902. 768 bytes long.  There is no file header or other
  903. control information in the file.  The rgb values for
  904. all 256 palette entries is stored in rgbrgb...
  905. sequence.  Each of the r, g, and b values is in the
  906. range of 0-63.
  907.  
  908.  
  909. PLY - Polygon Files
  910.  
  911.  
  912. A PLY file holds a set of points that describe a
  913. polygon.  Both Animator Pro and the original Animator
  914. create PLY files.  The file format is the same for
  915. both.
  916.  
  917. A PLY file starts with an 8-byte header, as follows:
  918.  
  919. Offset  Length  Name      Description
  920.  
  921.    0       2    points    Count of points in the file.
  922.  
  923.    2       4    reserved  Unused space; set to zero.
  924.  
  925.    6       1    closed    Closed-shape flag.  If 1,
  926.                           there is an implied
  927.                           connection between the last
  928.                           point and the first.  If
  929.                           zero, the shape is not
  930.                           closed.
  931.  
  932.    7       1    magic     File format identifier. 
  933.                           Always hex 99.
  934.  
  935. The points data follows the file header.  Each point is
  936. described with three 16-bit integers, representing the
  937. x, y, and z coordinates of each point.  The z
  938. coordinates are always zero.
  939.  
  940.  
  941. TWE - Tween Data Files
  942.  
  943. A TWE file holds information about a tweening operation
  944. set up via the Tween menus.  The information includes
  945. the starting and ending shapes, and the optional user-
  946. specified links between the shapes.  Animator Pro
  947. creates tween files.
  948.  
  949. A TWE file begins with an 8-byte header defined as
  950. follows:
  951.  
  952. Offset  Length  Name        Description
  953.  
  954.    0       2    magic       File format identifier. 
  955.                             Always hex 1995.
  956.  
  957.    2       2    version     The file format version;
  958.                             always zero.
  959.  
  960.    4       4    tcount      The number of tween shapes
  961.                             in the file; always 2.
  962.  
  963.    8       8    reserved    Unused space; set to
  964.                             zeroes.
  965.  
  966.   16       4    linkcount   The number of link entries
  967.                             in the file.
  968.  
  969. Immediately following the file header are the link
  970. entries.  If the linkcount value is zero there are no
  971. links.  Each link entry is a pair of 32-bit integers. 
  972. The first value in each pair is the index of the point
  973. in the first shape, and the second value is the index
  974. of the point in the ending shape.  (IE, a link value of
  975. 2,7 says to link the second starting-shape point to the
  976. seventh ending-shape point.)
  977.  
  978. Following the link entries is the data block that
  979. describes the starting shape, then the data block that
  980. describes the ending shape.  The format of these blocks
  981. is identical to that of the polygon (PLY) file,
  982. including file header data.  In other words, they
  983. appear as if a pair of polygon files are embedded in
  984. the tween file at this point.
  985.  
  986.  
  987. OPT - Optics Menu Settings Files
  988.  
  989.  
  990. An OPT file holds information about an optics operation
  991. set up via the Optics menus.  Both Animator Pro and the
  992. original Animator create OPT files.  The file format is
  993. the same for both.
  994.  
  995. An OPT file starts with a 4-byte header, as follows:
  996.  
  997. Offset  Length  Name      Description
  998.  
  999.    0       2    magic     File type identifier.  Always
  1000.                           hex 1A3F.
  1001.  
  1002.    2       2    count     Number of records in the
  1003. file.
  1004.  
  1005. Following the file header are optics records of 50
  1006. bytes each.  A record is generated for each click on
  1007. CONTINUE MOVE in the OPTICS menu.  The move records are
  1008. formatted as follows:
  1009.  
  1010. Offset  Length  Name          Description
  1011.  
  1012.    0       4    link          In the file, this field
  1013.                               is always zero.  In
  1014.                               memory, it's a pointer to
  1015.                               the next move record.
  1016.  
  1017.    4       6    spincenter    The x,y,z coordinates of
  1018.                               the spin center point;
  1019.                               three 16-bit values.
  1020.  
  1021.   10       6    spinaxis      The x,y,z coordinates of
  1022.                               the spin axis; three
  1023.                               16-bit values.
  1024.  
  1025.   16       6    spinturns     The x,y,z coordinates of
  1026.                               the spin turns; three 16-
  1027.                               bit values.
  1028.  
  1029.   22       4    spininter     Intermediate turns.  Two
  1030.                               16-bit values. These are
  1031.                               values for a conjugation
  1032.                               matrix that corresponds
  1033.                               to spin axis.
  1034.  
  1035.   26       6    sizecenter    The x,y,z coordinates of
  1036.                               the size center point;
  1037.                               three 16-bit values.
  1038.  
  1039.   32       2    xmultiplier   Determines (along with
  1040.                               xdivisor) how to scale
  1041.                               along x dimension.
  1042.  
  1043.   34       2    xdivisor      Determines (along with
  1044.                               xmultiplier) how to scale
  1045.                               along x dimension.
  1046.  
  1047.   36       2    ymultiplier   Determines (along with
  1048.                               ydivisor) how to scale
  1049.                               along y dimension.
  1050.  
  1051.   38       2    ydivisor      Determines (along with
  1052.                               ymultiplier) how to scale
  1053.                               along y dimension.
  1054.  
  1055.   40       2    bothmult      Like xmultiplier, but
  1056.                               applied to both
  1057.                               dimensions.
  1058.  
  1059.   42       2    bothdiv       Like xdivisor, but
  1060.                               applied to both
  1061.                               dimensions.
  1062.  
  1063.   44       6    linearmove    The x,y,z offset for a
  1064.                               linear move; three 16-bit
  1065.                               values.
  1066.  
  1067.  
  1068. Internal Usage Files (REC, SET, CFG, GLV, MU)
  1069.  
  1070.  
  1071. Each of these file types is created by Animator Pro to
  1072. store internal data between sessions.  These files must
  1073. not be touched by other applications.
  1074.  
  1075. REC files store macros.  Animator Pro REC files are not
  1076. the same as the REC files documented with the original
  1077. Animator.
  1078.  
  1079. SET files store internal settings information; they are
  1080. created by the Quit|Save menu, and by the Save Default
  1081. Settings menu.
  1082.  
  1083. CFG files store internal configuration information,
  1084. such as the video driver and mode.
  1085.  
  1086. GLV files store Poco Global Variables.  The data is
  1087. stored as a series of nullterminated strings, and must
  1088. not be modified using a normal text editor.
  1089.  
  1090. MU files store menu text, prompts, error messages, etc,
  1091. customized to the proper native language.  The data is
  1092. stored as normal ASCII text, and must not be modified
  1093. in any way.
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.