home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / datatypes / aksvg-datatype / docs / formatspecs < prev   
Text File  |  1997-01-03  |  4KB  |  76 lines

  1.   ================================
  2.   = The SVG Graphics File Format =  - Version 1, draft version: 03.01.1997
  3.   ================================
  4.  
  5.   File Format Information
  6.   ~~~~~~~~~~~~~~~~~~~~~~~
  7.   Pictures in the "SVG Graphics File Format" consist of two parts:
  8.   a header and an attached xpk-packed or unpacked data file.
  9.   Both parts are put into one single file.
  10.  
  11.   Construction (all fields in Motorola BYTE order):
  12.  
  13.   0x00  ID              UBYTE[18]       "SVG Graphics File" + 0-Byte
  14.   0x12  Version         UWORD           always 1 yet
  15.   0x14  GfxDataOffset   ULONG           header length (depends on version)
  16.   0x18  LeftEdge        ULONG           as with e.g. ILBM
  17.   0x1c  TopEdge         ULONG           ...
  18.   0x20  Width           ULONG           ...
  19.   0x24  Height          ULONG           ...
  20.   0x28  ColorDepth      ULONG           used colors as x of 2^x
  21.   0x3c  ViewMode32      ULONG           32 Bit Amiga ViewMode
  22.   0x40  PixelBits       UBYTE           1, 8, 24 (future: 16, 32)
  23.   0x41  PixelPlanes     UBYTE           # of planes with PixelBits
  24.   0x42  BytesPerLine    ULONG           bpl of a PixelPlane
  25.   0x46  ColorMap        UBYTE [256][3]  unused, if > 256 Colors (zero-ed)
  26.  
  27.   After that either follows XPK compressed data or uncompressed
  28.   data, which can be detected by the leading chars "XPK" or "PP20"
  29.   for packed data at GfxDataOffset (relative to beginning of the file).
  30.  
  31.   Please note, that with upto 256 colors (Colordepth <= 8) it has
  32.   to be checked, whether the graphics actually is EHB or HAM.
  33.   Use the Viewmode32 field for these assumptions when reading, and
  34.   maybe OR with HAM_KEY or EHB_KEY when saving.
  35.  
  36.   Note:
  37.   -----
  38.   "Pixelbits" and Planes do allow a lot of combinations.
  39.  
  40.   Actually used and supported by current software are only the
  41.   following:
  42.  
  43.      Bits   Planes  Depth  Content
  44.      ---------------------------------------------------------------------
  45.      1      1..8    1..8   (unaligned Bitmaps with 2..256 colors)
  46.      8      1       1..8   (chunky Bitmaps with 2..256 colors)
  47.      24     1       24     (24 Bit RGB Bitmaps with 8:8:8 RGB)
  48.  
  49.   So 24 Bit Data should not be saved planewise, but as 24 Bit RGB instead.
  50.  
  51.   If you ever should save any other data, please avoid any planar
  52.   configurations and respect the following rules for RGB data chunks:
  53.  
  54.      Bits   Planes  Depth  Content
  55.      ---------------------------------------------------------------------
  56.      16     1       15/16  (15/16 Bit Bitmap with 5:5:5:1 RGB0/A)
  57.      32     1       24/32  (24/32 Bit RGB Bitmaps with 8:8:8:8 RGB0/A)
  58.      48     1       48     (48    Bit RGB Bitmaps with 16:16:16 RGB)
  59.      64     1       48/64  (48/64 Bit RGB Bitmaps with 16:16:16:16 RGB0/A)
  60.      ... etc ...
  61.  
  62.  Note, that an alpha channel can only be correctly identified, when
  63.  "ColorDepth" is handled as an indicator, whether there actually is one,
  64.  or not. Programs not supporting alpha channels should simply ignore
  65.  the color depth and interpret "Bits=16 and Planes=1" as 5:5:5:0 RGB
  66.  and "Bits=32 and Planes=1" as 8:8:8:0 RGB and so on...
  67.  
  68.  Planar configuration actually only was thought for support of 2..256 color
  69.  Bitmap contents. We all new, that actually 24 or more bitplanes are
  70.  nearly unuseable and actually ugly to handle.
  71.  So please respect the "Planes" variable only being valid for values
  72.  between 1..8 and only, if "Bits=1" has been set, also note, that
  73.  with "Planes=1..8" you must set "ColorDepth=Planes", since other
  74.  than with 8 Bit chunky there is no support of unused planes.
  75.  
  76.