## Printer Device Driver

[prev][next][parent][TOC]

### GplCompressTIFF

Description

This function performs tagged image file format (TIFF) encoding, PackBits encoding algorithm. This function compresses a scanline.

Once in a repeated run, this function stops and emits a block if a different byte is encountered.

Once in a literal run, this function stops and emits a block if at least four repeated bytes follow. The next block will be a repeat block. Repeats of two or more instances of a byte b are represented by -(n-1) b. Literal runs of different bytes b1 b2 b3 ... bn are represented by (n-1) b1 b2 b3 . .. bn.

Format

    LONG APIENTRY GplCompressTIFF(

                         PBYTE  pbDataIn,      // Input raster data to compress (page/band)

                         LONG   cbDataIn,      // Length of input data buffer (pbDataIn)

                         PBYTE  pbDataOut,     // Output buffer to which compressed data is written

                         LONG   cbDataOut );   // Length count of compressed data written

Parameters

pbDataIn (PBYTE) Pointer to input data.

cbDataIn (LONG) Count of bytes in.

pbDataOut (PBYTE) Pointer to output data.

cbDataOut (LONG) Size of buffer in bytes pointed to by pbDataOut.

Returns

Success Count of bytes put in destination.
Failure GPLCOMPRESS_ERROR (-1)