[Back to Interface] [Prev] [Next]

SDsetcompress/sfscompress

intn SDsetcompress(int32 sds_id, int32 comp_type, comp_info *c_info)

sds_id IN:

Data set identifier returned by SDcreate or SDselect

comp_type IN:

Compression method

C only:

c_info IN:

Pointer to the comp_info union

Fortran only:

comp_prm IN:

Compression parameters array

Purpose

Compresses the data set with the specified compression method.

Return value

Returns SUCCEED (or 0) if successful and FAIL (or -1) otherwise.

Description

SDsetcompress compresses the data set identified by the parameter sds_id according to the compression method specified by the parameter comp_type and the compression information specified by the parameter c_info in C and comp_prm in Fortran. SDsetcompress compresses the data set data at the time it is called, not during the next call to SDwritedata.

SDsetcompress is a simplified interface to the HCcreate routine and should be used instead of HCcreate unless the user is familiar with working with the lower-level routines.

The parameter comp_type is the compression type definition and is set to COMP_CODE_RLE (or 1) for run-length encoding (RLE), COMP_CODE_SKPHUFF (or 3) for Skipping Huffman, COMP_CODE_DEFLATE (or 4) for GZIP compression, or COMP_CODE_NONE (or 0) for no compression.

The parameter c_info is a pointer to a union structure of type comp_info. This union structure is defined as follows:

typedef union tag_comp_info
{
	struct
	{
	/* Not used by SDsetcompress */
	} jpeg;

	struct
	{
	/* Not used by SDsetcompress */
	} nbit;

	struct
	{  /* struct to contain info about how to compress size of the 
		elements when skipping */
		intn skp_size;
	} skphuff;

	struct
	{  /* struct to contain info about how to compress or decompress 
		gzip encoded dataset how hard to work when compressing 
		data*/
		intn level;
	} deflate;

} comp_info;

The skipping size for the Skipping Huffman algorithm is specified in the field c_info.skphuff.skp_size in C and in the parameter comp_prm(1) in Fortran.

The deflate level for the GZIP algorithm is specified in the c_info.deflate.level field in C and in the parameter comp_prm(1) in Fortran.

FORTRAN

integer sfscompress(sds_id, comp_type, comp_prm)

integer sds_id, comp_type, comp_prm(*)



[Back to Interface] [Prev] [Next]

hdfhelp@ncsa.uiuc.edu
HDF Reference Manual - 07/29/98, NCSA HDF Development Group.