## Printer Device Driver

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

### GplFaxTIFF2EncodeBlock

Description

TIFF algorithm 2 compression. This function essentially provides a " Modified Huffman" G3 compression with no size limits. It is limited only by the byte representation of ULONG (4 Gigabytes).

Format

    GplFaxTIFF2EncodeBlock( PVOID   pHandle,

                            PBYTE   pbOutput,

                            ULONG   ulOutputSize,

                            PULONG  pulBitposition,

                            PBYTE   pbInput,

                            ULONG   ulBitwide,

                            ULONG   ulBitheight,

                            PFN     pfnFlushBuffer );

Parameters

pHandle (PVOID) Pointer to a handle.

pbOutput (PBYTE) Pointer to output buffer to fill.

ulOutputSize (ULONG) Size in bytes of output buffer; must be a multiple of 32 bits; must be divisible by 4.

pulBitposition (PULONG) Pointer to position in output buffer.

pbInput (PBYTE) Input pointer to upper left corner of raster image to compress.

ulBitwide (ULONG) Width of raster image to compress in bits.

ulBitheight (ULONG) Height of raster image to compress in bits.

pfnFlushBuffer (PFN) Flush buffer function; prototype for this function must be:

    void   pfnFlushBuffer( PVOID,

                           PBYTE,

                           ULONG );

PVOID Necessary parameter for separating printout; generally pddc or hThread.

PBYTE Unsigned char * to output buffer; same as pbOutput.

ULONG Unsigned long; size of pbOutput buffer; same as ulOutputSize.

Returns

Success Count of data written out (compressed data count).
Failure GPLCOMPRESS_ERROR (-1)

Related Functions The following are TIFF2-compression related functions.

GplFaxTIFF2StartBlock() TIFF algorithm 2 compression start-of-document function.

Inputs

pulBitposition Bit-position count in the output buffer; *pulBitposition gets updated and must be stored off the pddc; function just sets pulBitposition to 0 (you can do this yourself).

Returns Void

GplFaxTIFF2EndBlock() TIFF algorithm 2 compression to flush output buffer.

    GplFaxTIFF2EndBlock( PVOID   pHandle,

                         PBYTE   pbOutput,

                         ULONG   ulOutputSize,

                         PULONG  pulBitposition,

                         PBYTE   pbInput,

                         ULONG   ulBitwide,

                         ULONG   ulBitheight,

                         PFN     pfnFlushBuffer );

Inputs

hThread HTHREAD.

pbOutput Output buffer to fill.

ulOutputSize Size in bytes of output buffer; must be divisible by 4.

pulBitposition Bit-position count in the output buffer; must be a multiple of 32 bits; gets updated and must be stored off the pddc.

pbInput Input pointer to upper left corner of raster image to compress.

ulBitwide Width of the raster image in bits.

ulBitheight Height of the raster image in bits.

pfnFlushBuffer Flush buffer function; prototype for this function must be:

    int  pfnFlushBuffer( HTHREAD,

                         PBYTE,

                         ULONG );

HTHREAD Gotten from GplThreadCreateInstance().

PBYTE Unsigned char to output buffer; same as pbOutput.

ULONG Unsigned long; size of pbOutput buffer; same as ulOutputSize.

Returns

TRUE If OK
FALSE If error