= compress - Image Compression/Decompression Coders��� �  0 




NAME

1compress - Image Compression/Decompression Coders








SYNOPSIS

)ASCII85Encode(code,file)

Zstatus=BMPDecodeImage(file,pixels,compression,number_columns,number_rows)

-status=GIFDecodeImage(image)

7status=GIFEncodeImage(image,data_size)

>status=Huffman2DEncodeImage(image_info,image)

1status=HuffmanDecodeImage(image)

<status=HuffmanEncodeImage(image_info,image)

Astatus=LZWEncodeImage(file,pixels,number_pixels)

Bstatus=PCDDecodeImage(image,luma,chroma1,chroma2)

@status=PICTEncodeImage(image,scanline,packbits)

Fstatus=PackbitsEncodeImage(file,pixels,number_pixels)

3status=RunlengthDecodeImage(image)

2count=RunlengthEncodeImage(image)

Bstatus=ZLIBEncodeImage(file,pixels,number_pixels)






9

FUNCTION DESCRIPTIONS






)

ASCII85Encode

JFunction ASCII85Encode encodes data in ASCII base-85 format. ASCII base-85Iencoding produces five ASCII printing characters from every four bytes of binary data.

+The format of the ASCII85Encode routine is:

%

        ASCII85Encode(code,file)


(A description of each parameter follows:



"
code:
-a binary unsigned char to encode to ASCII 85.



file:
/write the encoded ASCII character to this file.






+

BMPDecodeImage

<Function BMPDecodeImage unpacks the packed image pixels into runlength-encoded pixel packets.

,The format of the BMPDecodeImage routine is:

V

        status=BMPDecodeImage(file,pixels,compression,number_columns,number_rows)


(A description of each parameter follows:




status:
GFunction BMPDecodeImage returns True if all the pixels are uncompressedwithout error, otherwise False.



file:
IThe address of a structure of type FILE. BMP encoded pixels are read from this file.



pixels:
JThe address of a byte (8 bits) array of pixel data created by the decodingprocess.



compression:
DA value of 1 means the compressed pixels are runlength encoded for a7256-color bitmap. A value of 2 means a 16-color bitmap.



number_columns:
IAn integer value that is the number of columns or width in pixels of your source image.



number_rows:
GAn integer value that is the number of rows or heigth in pixels of your source image.






+

BMPEncodeImage

KFunction BMPEncodeImage compresses pixels using a runlength encoded format.

,The format of the BMPEncodeImage routine is:

G

    status=BMPEncodeImage(pixels,compressed_pixels,number_columns,




      number_rows)


(A description of each parameter follows:




status:
DFunction BMPEncodeImage returns the number of bytes in the runlengthencoded compress_pixels array.



pixels:
AThe address of a byte (8 bits) array of pixel data created by thecompression process.



compressed_pixels:
>The address of a byte (8 bits) array of compressed pixel data.



number_columns:
IAn integer value that is the number of columns or width in pixels of your source image.



number_rows:
GAn integer value that is the number of rows or heigth in pixels of your source image.






+

GIFDecodeImage

=Function GIFDecodeImage uncompresses an image via GIF-coding.

,The format of the GIFDecodeImage routine is:

)

        status=GIFDecodeImage(image)


(A description of each parameter follows:




status:
GFunction GIFDecodeImage returns True if all the pixels are uncompressedwithout error, otherwise False.



image:
)The address of a structure of type Image.






+

GIFEncodeImage

;Function GIFEncodeImage compresses an image via GIF-coding.

,The format of the GIFEncodeImage routine is:

3

        status=GIFEncodeImage(image,data_size)


(A description of each parameter follows:




status:
EFunction GIFEncodeImage returns True if all the pixels are compressedwithout error, otherwise False.



image:
)The address of a structure of type Image.






3

HuffmanDecodeImage

EFunction HuffmanDecodeImage uncompresses an image via Huffman-coding.

0The format of the HuffmanDecodeImage routine is:

-

        status=HuffmanDecodeImage(image)


(A description of each parameter follows:




status:
IFunction HuffmanDecodeImage returns True if all the pixels are compressedwithout error, otherwise False.



image:
)The address of a structure of type Image.






3

HuffmanEncodeImage

CFunction HuffmanEncodeImage compresses an image via Huffman-coding.

0The format of the HuffmanEncodeImage routine is:

8

        status=HuffmanEncodeImage(image_info,image)


(A description of each parameter follows:




status:
IFunction HuffmanEncodeImage returns True if all the pixels are compressedwithout error, otherwise False.



image_info:
.Specifies a pointer to an ImageInfo structure.



image:
)The address of a structure of type Image.






7

Huffman2DEncodeImage

EFunction Huffman2DEncodeImage compresses an image via two-dimensionalHuffman-coding.

2The format of the Huffman2DEncodeImage routine is:

:

        status=Huffman2DEncodeImage(image_info,image)


(A description of each parameter follows:




status:
KFunction Huffman2DEncodeImage returns True if all the pixels are compressedwithout error, otherwise False.



image_info:
.Specifies a pointer to an ImageInfo structure.



image:
)The address of a structure of type Image.






+

LZWEncodeImage

FFunction LZWEncodeImage compresses an image via LZW-coding specific toKPostscript Level II or Portable Document Format. To ensure portability, the.binary LZW bytes are encoded as ASCII base-85.

,The format of the LZWEncodeImage routine is:

=

        status=LZWEncodeImage(file,pixels,number_pixels)


(A description of each parameter follows:




status:
EFunction LZWEncodeImage returns True if all the pixels are compressedwithout error, otherwise False.



file:
JThe address of a structure of type FILE. LZW encoded pixels are written to this file.



pixels:
GThe address of an unsigned array of characters containing the pixels to compress.



number_pixels:
EAn unsigned interger that specifies the number of pixels to compress.






5

PackbitsEncodeImage

GFunction PackbitsEncodeImage compresses an image via Macintosh PackbitsHencoding specific to Postscript Level II or Portable Document Format. ToKensure portability, the binary Packbits bytes are encoded as ASCII Base-85.

1The format of the PackbitsEncodeImage routine is:

B

        status=PackbitsEncodeImage(file,pixels,number_pixels)


(A description of each parameter follows:




status:
JFunction PackbitsEncodeImage returns True if all the pixels are compressedwithout error, otherwise False.



file:
JThe address of a structure of type FILE. LZW encoded pixels are written to this file.



pixels:
GThe address of an unsigned array of characters containing the pixels to compress.



number_pixels:
EAn unsigned interger that specifies the number of pixels to compress.






+

PCDDecodeImage

BFunction PCDDecodeImage recovers the Huffman encoded luminance andchrominance deltas.

,The format of the PCDDecodeImage routine is:

>

        status=PCDDecodeImage(image,luma,chroma1,chroma2)


(A description of each parameter follows:




status:
DFunction PCDDecodeImage returns True if all the deltas are recoveredwithout error, otherwise False.



image:
)The address of a structure of type Image.



luma:
JThe address of a character buffer that contains the luminance information.



chroma1:
?The address of a character buffer that contains the chrominance information.



chroma2:
?The address of a character buffer that contains the chrominance information.






-

PICTEncodeImage

DFunction PICTEncodeImage compresses an image via Macintosh pack bits#encoding for Macintosh PICT images.

-The format of the PICTEncodeImage routine is:

<

        status=PICTEncodeImage(image,scanline,packbits)


(A description of each parameter follows:




status:
FFunction PICTEncodeImage returns True if all the pixels are compressedwithout error, otherwise False.



image:
)The address of a structure of type Image.



scanline:
,A pointer to an array of characters to pack.



packbits:
KA pointer to an array of characters where the packed characters are stored.






7

RunlengthDecodeImage

BFunction RunlengthDecodeImage unpacks the packed image pixels intoFrunlength-encoded pixel packets. The packed image pixel memory is thenfreed.

2The format of the RunlengthDecodeImage routine is:

/

        status=RunlengthDecodeImage(image)


(A description of each parameter follows:




status:
KFunction RunlengthDecodeImage return True if the image is decoded. False is%returned if there is an error occurs.



image:
)The address of a structure of type Image.






7

RunlengthEncodeImage

GFunction RunlengthEncodeImage packs the runlength-encoded pixel packets!into the minimum number of bytes.

2The format of the RunlengthEncodeImage routine is:

.

        count=RunlengthEncodeImage(image)


(A description of each parameter follows:




status:
BFunction RunlengthEncodeImage return the number of bytes the image.consumes. Zero is returned if an error occurs.



image:
)The address of a structure of type Image.






+

SUNDecodeImage

<Function SUNDecodeImage unpacks the packed image pixels into runlength-encoded pixel packets.

,The format of the SUNDecodeImage routine is:

G

    status=SUNDecodeImage(compressed_pixels,pixels,number_columns,




      number_rows)


(A description of each parameter follows:




status:
GFunction SUNDecodeImage returns True if all the pixels are uncompressedwithout error, otherwise False.



compressed_pixels:
>The address of a byte (8 bits) array of compressed pixel data.



pixels:
AThe address of a byte (8 bits) array of pixel data created by theIuncompression process. The number of bytes in this array must be at leastJequal to the number columns times the number of rows of the source pixels.



number_columns:
IAn integer value that is the number of columns or width in pixels of your source image.



number_rows:
GAn integer value that is the number of rows or heigth in pixels of your source image.






-

ZLIBEncodeImage

HFunction ZLIBEncodeImage compresses an image via ZLIB-coding specific toKPostscript Level II or Portable Document Format. To ensure portability, the/binary ZLIB bytes are encoded as ASCII base-85.

-The format of the ZLIBEncodeImage routine is:

>

        status=ZLIBEncodeImage(file,pixels,number_pixels)


(A description of each parameter follows:




status:
FFunction ZLIBEncodeImage returns True if all the pixels are compressedwithout error, otherwise False.



file:
KThe address of a structure of type FILE. ZLIB encoded pixels are written to this file.



pixels:
GThe address of an unsigned array of characters containing the pixels to compress.



number_pixels:
EAn unsigned interger that specifies the number of pixels to compress.