home *** CD-ROM | disk | FTP | other *** search
/ Encyclopedia of Graphics File Formats Companion / GFF_CD.ISO / formats / tddd / spec / tdddr.txt < prev   
Text File  |  1994-06-17  |  3KB  |  79 lines

  1. ED. NOTE:  This is not a formal specification, but an informal
  2. description of the format.
  3.  
  4.  
  5.                     FORM RGBN and FORM RGB8
  6.                     -----------------------
  7.  
  8.     RGBN and RGB8 files are used in Impulse's Silver and Turbo Silver.
  9.     They are almost identical to FORM ILBM's except for the BODY chunk
  10.     and slight differences in the BMHD chunk.
  11.  
  12.     A CAMG chunk IS REQUIRED.
  13.  
  14.     The BMHD chunk specfies the number of bitplanes as 13, and the
  15.     compression type as ??.
  16.  
  17.     The FORM RGBN uses 12 bit RGB values, and the FORM RGB8 uses
  18.     24 bit RGB values.
  19.  
  20.     The BODY chunk contains RGB values, a "genlock" bit, and repeat
  21.     counts.  In Silver, when "genlock" bit is set, a "zero color" is
  22.     written into the bitplanes for genlock video to show through.
  23.     In Diamond (a "paint" program, also by Impulse), the genlock bit
  24.     is ignored if the file is loaded as a picture (and the RGB color
  25.     is used instead), and if the file is loaded as a brush the genlock
  26.     bit marks pixels that are not part of the brush.
  27.  
  28.     For both RGBN and RGB8 body chunks, each RGB value always has a
  29.     repeat count.  The values are written in different formats depending
  30.     on the magnitude of the repeat count.
  31.  
  32.     For the RGBN BODY chunk:
  33.  
  34.         For each RGB value, a WORD (16-bits) is written: with the
  35.         12 RGB bits in the MSB (most significant bit) positions;
  36.         the "genlock" bit next; and then a 3 bit repeat count.  
  37.         If the repeat count is greater than 7, the 3-bit count is
  38.         zero, and a BYTE repeat count follows.  If the repeat count
  39.         is greater than 255, the BYTE count is zero, and a WORD
  40.         repeat count follows.  Repeat counts greater than 65536 are
  41.         not supported.
  42.  
  43.     For the RGB8 body chunk:
  44.  
  45.         For each RGB value, a LONG-word (32 bits) is written:
  46.         with the 24 RGB bits in the MSB positions; the "genlock"
  47.         bit next, and then a 7 bit repeat count.  If the repeat
  48.         count is greater than 127, the same rules apply as in
  49.         the RGBN BODY.
  50.  
  51.     Sample BODY code:
  52.  
  53.             if(!count) {
  54.                 if (Rgb8) {
  55.                     fread (&w, 4, 1, RGBFile);
  56.                     lock = w & 0x00000080;
  57.                     rgb = w >> 8;
  58.                     count = w & 0x0000007f;
  59.                 } else {
  60.                     w = (UWORD) getw (RGBFile);
  61.                     lock = w & 8;
  62.                     rgb = w >> 4;
  63.                     count = w & 7;
  64.                 }
  65.                 if (!count)
  66.                     if (!(count = (UBYTE) getc (RGBFile)))
  67.                         count = (UWORD) getw (RGBFile);
  68.             }
  69.  
  70.     The pixels are scanned from left to right across horizontal
  71.     lines, processing from top to bottom.  The (12 or 24 bit) RGB
  72.     values are stored with the red bits as the MSB's, the green
  73.     bits next, and the blue bits as the LSB's.
  74.  
  75.     Special note:  As of this writing (Sep 88), Silver does NOT
  76.     support anything but black for color zero.
  77.  
  78.  
  79.