]> Imagic film/picture
  •  Back 
  •  %Main 
  •  Index 
  •  Cross references 
  •  Help page 
  •  Show info about hypertext 
  •  View a new file 
Topic       : ATARI ST Picture formats
Author      : David Baggett/Jan K⌐upka
Version     : atari_gf.hyp 0.01 (17/09/96)
Subject     : Documentation/File formats
Nodes       : 52
Index Size  : 1328
HCP-Version : 3
Compiled on : Atari
@charset    : atarist
@lang       : 
@default    : 
@help       : 
@options    : -i -s +y +z
@width      : 75Imagic Film/Picture             *.IC1 (low resolution)
                                *.IC2 (medium resolution)
                                *.IC3 (high resolution)

4 bytes         "IMDC"
1 wordword = 2 bytes
          resolution (0 = low res, 1 = medium res, 2 = high res)
16 words        palette
1 wordword = 2 bytes
          date (GEMDOS format)
1 wordword = 2 bytes
          time (GEMDOS format)
8 bytes         name of base picture file (for delta compression), or
                zeroes
1 wordword = 2 bytes
          length of data (?)
1 longlong = 4 bytes
          registration number
8 bytes         reserved
1 byte          compressed? (0 = no, 1 = yes)

If compressed {
1 byte          delta-compressed? (-1 = no, > -1 = yes)
1 byte          ?
1 byte          escape byte
}
65 bytes        total for header (68 bytes if compressed)

? bytes         data

   Compressed data may be either stand-alone or delta-compressed
(relative to the base picture named in the header).  Delta compression
involves 4storing only how the picture differs from the base picture
(i.e., only portions of the screen that have changed are stored).
This is used to to encode animated sequences efficiently.

Compressed data, stand-alone:

For each byte x in the data section:

        x = escape byte         Read one more byte, n.  (n is
        unsigned).

                                If n >= 2, use the next byte n times.
                                If n = 1, keep reading bytes until a
                                byte k not equal to 1 is encountered.
                                Then read the next byte d.
                                If the number of 1 bytes encountered
                                is o, use d (256 * o + k) times.

                                if (n == 1) {
                                        o = 0;
                                        while (n == 1) {
                                                o++;
                                                n = next byte;
                                        }

                                        k = n;
                                        d = next byte;

                                        Use d (256 * o + k) times.
                                }
                                else {
                                        d = next byte;
                                        Use d (n) times.
                                }

        x != escape byte        Use x literally.

Compressed data, delta compressed:

For each byte x in the data section:

        x = escape byte         Read one more byte, n.  (n is
        unsigned).

                                If n >= 3, use the next byte n times.
                                If n = 1, do the same as for n = 1 in
                                stand-alone compression (above).
                                If n = 2, then set n = next byte.
                                     If n = 0, end of picture.
                                     If n >= 2, take n bytes from base
                                     picture.
                                     If n = 1, do the same as for n = 1
                                     in stand-alone compression (above),
                                     but take (256 * o + k) bytes
                                     from base picture.

        x != escape byte        Use x literally.