Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ xil_compress(3) — SunOS 5.6

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

xil_decompress(3)

xil_cis_get_bits_ptr(3)

xil_cis_get_input_type(3)

xil_cis_create(3)

xil_cis_number_of_frames(3)

xil_cis_flush(3)

xil_cis_put_bits(3)

xil_cis_put_bits_ptr(3)

xil_compress(3)

NAME

xil_compress − compress an image and write it to a compressed image sequence

SYNOPSIS

#include <xil/xil.h>

void xil_compress ( XilImage src,

XilCis cis);

DESCRIPTION

This function compresses an image and writes the compressed data to a compressed image sequence (CIS). 

src is the image (possibly a device image) containing the uncompressed data to be compressed. 

cis is the compressed image sequence into which the compressed data will be written.  The compressor to be used is established when the CIS is created with the xil_cis_create (3) call. 

This function appends the compressed image at the CIS’s current write_frame location, and then increments write_frame.  Frame insertions at random points in the cis are not supported. Note that even after the xil_compress () operation occurs, the data for that frame is not guaranteed to be retrievable by an xil_cis_get_bits_ptr(3) function, nor to be detectable by an xil_cis_has_data(3) operation, until xil_cis_flush(3) is called. 

Unless the CIS is reset, with a call to xil_cis_reset(3), all frames written to a CIS must have the same width, height, number of bands and datatype. 

XIL Compressors

The XIL library provides the functions necessary to compress an image or sequence of images.  A standard XIL compressor provides functions to:

Compress data and place it in a CIS (xil_compress(3)). 

Take user-supplied compressed data and copy it into a cis (xil_cis_put_bits(3)). 

Take a pointer to user-supplied compressed data and treat it as compressed frames by reference, eliminating the need to copy (xil_cis_put_bits_ptr(3)). 

Determine how much data a CIS contains. 

Empty a CIS. 

The standard XIL library currently supports compression for the following set of compression formats. 

Cell
CellB
Jpeg
Jpeg Lossless
CCITT G3 Fax
CCITT G4 Fax

In addition, support is provided for third parties to develop compression implementations for the Mpeg-1 and H.261 standards. 

ROI Behavior

This function does not support source image ROIs. 

ERRORS

For a complete list of XIL error messages by number, consult Appendix B of the XIL Programmer’s Guide. 

EXAMPLES

Compress an image into a compressed image sequence:

XilImage src;
XilCis cis;
XilImageType type;
XilSystemState State;
type = xil_cis_get_input_type(cis);
src = xil_create_from_type(State, type);
/∗ generate the src image... ∗/
xil_compress( src, cis );

NOTES

The XilImageType of the source image must match the input XilImageType of the CIS.  Use xil_cis_get_input_type(3) to determine the required type. 

SEE ALSO

xil_decompress(3), xil_cis_get_bits_ptr(3), xil_cis_get_input_type(3), xil_cis_create(3), xil_cis_number_of_frames(3), xil_cis_flush(3), xil_cis_put_bits(3), xil_cis_put_bits_ptr(3). 

SunOS 5.6  —  Last change: 04 August 1993

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