home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 004.lha / Dpaintx_source / PACKER.h < prev    next >
C/C++ Source or Header  |  1986-03-02  |  2KB  |  37 lines

  1. #ifndef PACKER_H
  2. #define PACKER_H
  3. /*----------------------------------------------------------------------*
  4.  * PACKER.H  typedefs for Data-Compresser.               11/11/85
  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. /* This macro computes the worst case packed size of a "row" of bytes. */
  16. #define MaxPackedSize(rowSize)  ( (rowSize) + ( ((rowSize)+127) >> 7 ) )
  17.  
  18.  
  19. /* Given POINTERS to POINTER variables, packs one row, updating the source
  20.  * and destination pointers. Returns the size in bytes of the packed row.
  21.  * ASSUMES destination buffer is large enough for the packed row.
  22.  * See MaxPackedSize. */
  23. extern LONG PackRow(/* BYTE **, BYTE **, LONG */);
  24.               /* pSource, pDest,   rowSize */
  25.  
  26. /* Given POINTERS to POINTER variables, unpacks one row, updating the source
  27.  * and destination pointers until it produces dstBytes bytes (i.e., the
  28.  * rowSize that went into PackRow).
  29.  * If it would exceed the source's limit srcBytes or if a run would overrun
  30.  * the destination buffer size dstBytes, it stops and returns TRUE.
  31.  * Otherwise, it returns FALSE (no error). */
  32. extern BOOL UnPackRow(/* BYTE **, BYTE **, LONG,     LONG */);
  33.                 /* pSource, pDest,   srcBytes, dstBytes  */
  34.  
  35. #endif
  36.  
  37.