aboutsummaryrefslogtreecommitdiff
path: root/PACKER.H
blob: 41dd404641a655eadc09722151bce45f57e183df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef PACKER_H
#define PACKER_H
/*----------------------------------------------------------------------*/
/* PACKER.H  typedefs for Data-Compresser.  			8/30/85 */
/*----------------------------------------------------------------------*/
#ifndef EXEC_TYPES_H
#include "exec/types.h"
#endif

typedef enum {cmpNone = 0, cmpByteRun1 = 1} _Compression;
typedef UBYTE Compression;
    /* Choice of compression algorithm applied to the rows of all     */
    /* source and mask planes.  "cmpByteRun1" is the byte run encoding  */
    /* generated by Mac's PackBits.  Do not compress across rows!    */

/* Converts data to packed format "cmpByteRun1".*/
extern LONG Packer(BYTE *, BYTE *, LONG, LONG);
	  /* source, destination, size in bytes, row size */
	  /* RETURNs packed size in bytes */
	  /* Assumes buffer is same size as source.  In theory, could
	     get a data pattern that expands rather than compressing.
	     Will run off the end of your buffer in that case.*/

/* Given POINTERS TO POINTERS, packs one row, updating the source and
   destination pointers. */
extern PackRow(BYTE **, BYTE **, LONG);
	/* pSource, pDest, rowSize */

/* Unpacks from format "cmpByteRun1".*/
extern LONG Unpacker(BYTE *, BYTE *, LONG, LONG);
	  /* source, destination, packedSize, bufferLimit */
	  /* RETURNs actual unpacked size */
	  /* If reachs buffer's end, stops there and returns its
	     size as "unpacked size". */

#endif