home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 403.lha / VediSrc / include / iff / readpict.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-08-06  |  2.2 KB  |  72 lines

  1. #ifndef READPICT_H
  2. #define READPICT_H
  3. /** ReadPict.h *******************************************************
  4.  *
  5.  * Read an ILBM raster image file into RAM.                23-Jan-86
  6.  *
  7.  * By Jerry Morrison, Steve Shaw, and Steve Hayes, Electronic Arts.
  8.  * This software is in the public domain.
  9.  *
  10.  * USE THIS AS AN EXAMPLE PROGRAM FOR AN IFF READER.
  11.  *
  12.  * The IFF reader portion is essentially a recursive-descent parser.
  13.  *
  14.  *********************************************************************
  15.  *
  16.  * Modified to accept a BEAM chunk in an ILBM FORM. Search for lines
  17.  *
  18.  * containing 'dp' to find the difference from the original EA files
  19.  *
  20.  * Date: 20-Feb-89       Registered Developer: ECI004 - Diego Perini
  21.  *
  22.  ********************************************************************/
  23.  
  24. /* ILBMFrame is our "client frame" for reading FORMs ILBM in an IFF file.
  25.  * We allocate one of these on the stack for every LIST or FORM encountered
  26.  * in the file and use it to hold BMHD & CMAP properties. We also allocate
  27.  * an initial one for the whole file. */
  28.  
  29. #define EXDepth 6
  30. #define maxCycles 6
  31. #define maxColorReg 32
  32.  
  33. typedef struct {
  34.    ClientFrame clientFrame;
  35.    UBYTE foundBMHD;
  36.    BitMapHeader bmHdr;
  37.    UBYTE nColorRegs;
  38.    Color4 colorMap[maxColorReg];
  39.  
  40.    /* If you want to read any other property chunks, e.g. GRAB or CAMG, add
  41.     * fields to this record to store them. */
  42.    UBYTE foundBEAM;        /* dp */
  43.    BeamChunk beamChunk;
  44.    UBYTE foundCAMG;        /* cs */
  45.    CamgChunk camgChunk;
  46.    UBYTE crngCount;        /* cs */
  47.    CrngChunk crngChunk[maxCycles];
  48.    UBYTE ccrtCount;        /* cs */
  49.    CcrtChunk ccrtChunk[maxCycles];
  50.    } ILBMFrame;
  51.  
  52. /** ReadPicture() ***********************************************************
  53.  *
  54.  * Read a picture from an IFF file, given a file handle open for reading.
  55.  * Allocates BitMap RAM by calling (*Allocator)(size).
  56.  *
  57.  ****************************************************************************/
  58.  
  59. #ifdef FDwAT
  60.    extern IFFP ReadPicture(LONG,   ILBMFrame *);
  61.                         /* file, iFrame,     */
  62.    /* iFrame is the top level "client frame". */
  63.    extern struct BitMap *getBitMap(ILBMFrame *);
  64.  
  65. #else /* not FDwAT */
  66.    extern IFFP ReadPicture();
  67.    extern struct BitMap *getBitMap();
  68. #endif
  69.  
  70. #endif READPICT_H
  71.  
  72.