Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ilCompress(3X) — HP-UX ANSI C A.10.11

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ilGetPipeInfo(3X)

ilCreatePipe(3X)

ilImageDes(3x)

ilCompress(3X)

NAME

ilCompress() − compress or decompress an image using the method requested

SYNOPSIS

ilBool
ilCompress (

ilPipe pipe,

unsigned int compression,

ilPtr pData,

long dstStripHeight,

unsigned long mustBeZero);

DESCRIPTION

ilCompress() compresses or decompresses an image in the pipe based on the value supplied for compression.  To decompress an image, you can alternatively use ilGetPipeInfo().  If you use IL_JPEG compression on an IL_RGB image, you must first convert the image to an IL_YCBCR image. 

Using this function requires a good understanding of the ilImageDes data structure.  See ilImageDes(3X) for details on this structure. 

pipe identifies an ilPipe structure created by ilCreatePipe(). 

compression identifies the compression method which may be one of IL_G3, IL_LZW, IL_PACKBITS, IL_JPEG, IL_G4, or IL_UNCOMPRESSED. 

pData determines the compression format; use this parameter based on the value of compression as follows:

If compression is neither IL_JPEG nor lL_G3, pData must be NULL. 

If you supply lL_G3 for compression, pData must point to an unsigned long that contains either IL_G3M_TIFF, which stores the image in TIFF format, or IL_G3M_CLASS_F, which stores the image in FAX format.  If pData is NULL, IL_G3M_TIFF is assumed. 

If you supply lL_JPEG for compression, pData must point to an ilJPEGEncodeControl data structure that has the following fields:

mustBeZero identifies a value that must be zero; this field is reserved for future use. 

Q identifies the Quantization factor, which determines the quantity of compression.  If Q is zero (0), a default quantization (50) is used.  The same effect is achieved by passing pData as NULL.  Otherwise, Q can range from a minimum compression of 1 to a maximum compression of 255. 

dstStripHeight identifies the constant height of the strips to be compressed.  If dstStripHeight is the recommended value of zero (0), the Image Library determines the height of the strips. 

mustBeZero identifies a value that must be zero; this parameter is reserved for future use. 

RETURN VALUE

Upon successful completion, ilCompress() returns TRUE. 

ERRORS

If the call fails, context->error receives a non-zero error code. 

EXAMPLE

The following example compresses the image in the pipe with G3 compression in TIFF format. 

ilPipe pipe;

unsigned long compFlags = IL_G3M_CLASS_F;
.
.
.

if (!ilCompress (pipe, IL_G3, (ilPtr) &compFlags, 0, 0))

return(context->error);

AUTHOR

ilCompress() was developed by HP. 

SEE ALSO

ilGetPipeInfo(3X), ilCreatePipe(3X), ilImageDes(3x). 

Using the Image Developer’s Kit.

Hewlett-Packard Company  —  Image Library: February, 1995

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026