home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / TRSICAT.LZX / CATS_CD2_TRSI / Reference_Library / Devices / iffp / packer.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-21  |  1.6 KB  |  45 lines

  1. #ifndef PACKER_H
  2. #define PACKER_H
  3. /*----------------------------------------------------------------------*
  4.  * PACKER.H  typedefs for Data-Compresser.                  1/22/86
  5.  *
  6.  * This module implements the run compression algorithm "cmpByteRun1"; the
  7.  * same encoding generated by Mac's PackBits.
  8.  *
  9.  * By Jerry Morrison and Steve Shaw, Electronic Arts.
  10.  * This software is in the public domain.
  11.  *
  12.  * This version for the Commodore-Amiga computer.
  13.  *----------------------------------------------------------------------*/
  14.  
  15. #include <exec/types.h>
  16.  
  17. /* This macro computes the worst case packed size of a "row" of bytes. */
  18. #define MaxPackedSize(rowSize)  ( (rowSize) + ( ((rowSize)+127) >> 7 ) )
  19.  
  20.  
  21. /* Given POINTERS to POINTER variables, packs one row, updating the source
  22.  * and destination pointers. Returns the size in bytes of the packed row.
  23.  * ASSUMES destination buffer is large enough for the packed row.
  24.  * See MaxPackedSize. */
  25. extern LONG PackRow(BYTE **, BYTE **, LONG);
  26.         /*  pSource, pDest,   rowSize */
  27.  
  28. /* Given POINTERS to POINTER variables, unpacks one row, updating the source
  29.  * and destination pointers until it produces dstBytes bytes (i.e., the
  30.  * rowSize that went into PackRow).
  31.  * If it would exceed the source's limit srcBytes or if a run would overrun
  32.  * the destination buffer size dstBytes, it stops and returns TRUE.
  33.  * Otherwise, it returns FALSE (no error). */
  34. extern BOOL UnPackRow(BYTE **, BYTE **, WORD,     WORD);
  35.           /*  pSource, pDest,   srcBytes, dstBytes  */
  36.  
  37.  
  38. BYTE *PutDump(BYTE *, int);
  39. BYTE *PutRun(BYTE *,int,int);
  40. LONG PackRow(BYTE **,BYTE **,LONG);
  41. BOOL UnPackRow(BYTE **,BYTE **,WORD,WORD);
  42.  
  43. #endif
  44.  
  45.