****************************
            * QuickTime 3 Image Format *
            ****************************

 - values use big endian (network) byte order
 - general terms: integer = signed value
 - general values: byte/char/octet = 8-bit value ; short/word = 16-bit value ;
                    long = 32-bit value
 - fixed point values: value made up of an integer for whole numbers
                        and an unsigned value for the decimal
 - binary values: base-2 long unsigned values (values from 0 and 1)
 - octal values: base-8 long unsigned values (values from 0 through to 7)
 - decimal values: base-10 long unsigned values (values from 0 through to 9)
 - hexadecimal (hex) values: base-16 long unsigned values
                              (values from 0 to 9 and A to F)
 - atom offsets: values relative to atoms only
                  and are used to skip to the next atom
 - long mac file version: byte hex version + byte hex revision
                           + byte hex revision stage + byte hex non-final number
 - mac version revision stages: development = 0x20 ; alpha = 0x40 ;
                                 beta = 0x60 ; release = 0x80

FILE INFO

Suffixes = ".qtif", ".qti" ;  Mac OS Type = "qtif" ;  Mac OS Creator = "ogle" ;
MIME="image/x-quicktime"

Standard single fork binary file that only uses a resource fork on HFS/HFS+ volumes
to store mac specific file info and image previews.

Unknown atoms can be safely skipped over, atoms can be in any order and all
lowercase long ASCII text strings used for atom names/types are reserved for
use by Apple.

All atoms are limited to a size of 2^32 bytes (< 4.3 GB).

FILE IMAGE DATA

* 8+ bytes image data atom
    = long unsigned offset + long ASCII text string 'idat'
  -> image data = hex dump
    - JPEG YUV scans are stored as standard JFIFs

OPTIONAL/UNOFFICIAL FILE PREVIEW DATA

Note: the image preview can be stored in the resource fork as type 'pnot'; ID any
on the Macintosh platform.  But could be stored in a single file fork.
The advantage of using another file fork is that the preview image data can be
updated more easily.

* 8+ bytes optional preview location, not image data atom
    = long unsigned offset + long ASCII text string 'pnot'
  -> 4 bytes mac modified file date
      = long unsigned value in seconds since beginning 1904 to 2040
  -> 2 bytes version = short integer value (none = 0)
  -> 4 bytes resource/atom type = long ASCII text string
    - types are separate preview = 'PICT' ; use image data = 'moov'
  -> 2 bytes resource/atom id = short integer value
    - IDs are separate preview = id value ; use image data = -1

* 8+ bytes optional preview data for single fork atom
    = long unsigned offset + long ASCII text string 'PICT'
  -> image data = quickdraw picture resource format hex dump

FILE IMAGE HEADER

Note: the header should be stored at the beginning of the file.
The following is the same layout as used in the QuickTime movie video sample description
and QuickDraw PICT format description for QuickTime encoded images, but is in an
image description atom container.

* 8+ bytes image description atom
    = long unsigned offset + long ASCII text string 'idsc'
  -> 4 bytes image description size = long unsigned length
  -> 4 bytes subtype/compressor name = long ASCII text string
      (eg. Photo - JPEG = 'jpeg')
  -> 8 bytes reserved = 64-bit null space
  -> 4 bytes version = long fixed point value (none = 0.0)
  -> 4 bytes manufacturer name = long ASCII text string
      (eg. Apple = 'appl')
  -> 4 bytes image temporal quality = long unsigned value
      (0 to 1024 ; generally = 0)
  -> 4 bytes image spatial quality = long unsigned value
      (0 to 1024)
    - some quality values are lossless = 1024 ; maximum = 1023 ; high = 768
    - some quality values are normal = 512 ; low = 256 ; minimum = 0
  -> 4 bytes image frame pixel size
      = short unsigned width + short unsigned height
  -> 8 bytes image resolution
      = long fixed point horizontal + long fixed point vertical
  -> 4 bytes image data size = long unsigned byte size (unknown = 0)
  -> 2 bytes image frame count = short unsigned total (default = 1)
  -> 1 byte image encoding name string length = byte unsigned length
  -> 31 bytes image encoder name text string
  -> NOTE: if image encoder name string < 31 chars then pad with zeros
  -> 2 bytes image pixel depth = short unsigned value
    - colors are 1 (Monochrome), 2 (4), 4 (16), 8 (256)
    - colors are 16 (1000s), 24 (Ms), 32 (Ms+A)
    - grays are 33 (B/W), 34 (4), 36 (16), 40(256)
  -> 2 bytes image color table id = short integer value (no table = -1)
  -> optional color table values if above set to 0
      (see movie color table atom for layout)
  -> optional atom-styled extended image description for QT decompressor

OPTIONAL FILE META INFO

* 8+ bytes optional image meta atom
    = long unsigned offset + long ASCII text string 'meta'
   * 8+ bytes optional annotation atoms
       = long unsigned offset + 0xA9 + 24-bit ASCII text string
    - atom types are full name = 'nam'; copyright = 'cpy'; disclaimer = 'dis'
    - atom types are image description = 'inf' or 'des'; comment = 'cmt'; warning = 'wrn'
    - atom types are content created date = 'day'; image edit dates = 'ed1' to 'ed9'
    - atom types are original format = 'fmt'; original source = 'src'; host computer = 'hst'
    - atom types are make = 'mak'; model = 'mod'; product = 'PRD'; software = 'swr'
    - atom types are viewer requirements = 'req'; director = 'dir'; producer = 'prd'
    - atom types are performers = 'prf';  writer = 'wrt'; author = 'aut'
    - atom types are artist = 'ART'; track = 'trk'; album = 'alb'; composer = 'com'
    - atom types are genre = 'gen'; original artist = 'ope'; net url = 'url'; encoder = 'enc'
     -> 2 bytes string length = short unsigned length
     -> 2 bytes mac language = short unsigned language value (english = 0)
     -> annotation string = ASCII text dump

    Source: geocities.com/xhelmboyx/quicktime/formats

               ( geocities.com/xhelmboyx/quicktime)                   ( geocities.com/xhelmboyx)