#ifndef READPICT_H
#define READPICT_H
/** ReadPict.h *******************************************************
 *
 * Read an ILBM raster image file into RAM.                23-Jan-86
 *
 * By Jerry Morrison, Steve Shaw, and Steve Hayes, Electronic Arts.
 * This software is in the public domain.
 *
 * USE THIS AS AN EXAMPLE PROGRAM FOR AN IFF READER.
 *
 * The IFF reader portion is essentially a recursive-descent parser.
 *
 *********************************************************************
 *
 * Modified to accept a BEAM chunk in an ILBM FORM. Search for lines
 *
 * containing 'dp' to find the difference from the original EA files
 *
 * Date: 20-Feb-89       Registered Developer: ECI004 - Diego Perini
 *
 ********************************************************************/

/* ILBMFrame is our "client frame" for reading FORMs ILBM in an IFF file.
 * We allocate one of these on the stack for every LIST or FORM encountered
 * in the file and use it to hold BMHD & CMAP properties. We also allocate
 * an initial one for the whole file. */

#define EXDepth 6
#define maxCycles 6
#define maxColorReg 32

typedef struct {
   ClientFrame clientFrame;
   UBYTE foundBMHD;
   BitMapHeader bmHdr;
   UBYTE nColorRegs;
   Color4 colorMap[maxColorReg];

   /* If you want to read any other property chunks, e.g. GRAB or CAMG, add
    * fields to this record to store them. */
   UBYTE foundBEAM;        /* dp */
   BeamChunk beamChunk;
   UBYTE foundCAMG;        /* cs */
   CamgChunk camgChunk;
   UBYTE crngCount;        /* cs */
   CrngChunk crngChunk[maxCycles];
   UBYTE ccrtCount;        /* cs */
   CcrtChunk ccrtChunk[maxCycles];
   } ILBMFrame;

/** ReadPicture() ***********************************************************
 *
 * Read a picture from an IFF file, given a file handle open for reading.
 * Allocates BitMap RAM by calling (*Allocator)(size).
 *
 ****************************************************************************/

#ifdef FDwAT
   extern IFFP ReadPicture(LONG,   ILBMFrame *);
                        /* file, iFrame,     */
   /* iFrame is the top level "client frame". */
   extern struct BitMap *getBitMap(ILBMFrame *);

#else /* not FDwAT */
   extern IFFP ReadPicture();
   extern struct BitMap *getBitMap();
#endif

#endif READPICT_H

