## Printer Device Driver

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

### GplCompressDeltaRow

Description

This function performs delta-row encoding. This method replaces only the bytes in a new row that are different from the preceding (seed) row. Unreplaced bytes are replicated from the seed row. The new row then becomes the seed row after it is printed.

Format

    INT APIENTRY GplCompressDeltaRow(

                          INT      usTotalBytes,   // Bytes in the scan line

                          PBYTE    pbData,         // Input raster data to compress

                          PBYTE    pbLastLine,     // Previous scanline's raster data

                          INT      usMaxReturn,    // Length of output buffer

                          PBYTE    pbReturn,       // Output buffer with compressed data

                          PUSHORT  pDeltas );      // Differences indexes-start/end pairs

Parameters

usTotalBytes (INT) Count of bytes in, pointed to by pbData.

pbData (PBYTE) Pointer to bytes of data to compress.

pbLastLine (PBYTE) Pointer to previous scanline's raster data.

usMaxReturn (INT) Size of output buffer.

pbReturn (PBYTE) Pointer to compressed data will be written.

pDeltas (PUSHORT) Differences indexes = array of start and end pairs.

Note: This array is returned as the result of calling GplCompressChooseMode; therefore, you must call GplCompressChooseMode() before calling this function.

Returns

0 Current and previous line are identical.

>0 Length of data pointed to by pbReturn.

-1 GPLCOMPRESS_ERROR
usMaxReturn is not large enough for the compressed output.