[Back to Interface] [Prev] [Next]

GRsetchunk/mgschnk

intn GRsetchunk(int32 ri_id, HDF_CHUNK_DEF cdef, int32 flags)

ri_id IN:

Raster image identifier returned by GRcreate or GRselect

C only:

cdef IN:

Chunk definition

flags IN:

Compression flags

Fortran only:

dim_length IN:

Chunk dimensions array

comp_type IN:

Type of compression

comp_prm IN:

Compression parameters array

Purpose

Makes a raster image a chunked raster image.

Return value

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

Description

GRsetchunk makes the raster image specified by the parameter ri_id a chunked raster image according to the chunking and compression information provided in the parameters cdef and flags in C, or in the parameters comp_type and comp_prm in Fortran.

C only:

The parameter cdef is a union of type HDF_CHUNK_DEF, which is defined as follows:

typedef union hdf_chunk_def_u
    {
     int32 chunk_lengths[2];  /* chunk lengths along each dim */
     
     struct
          {
           int32 chunk_lengths[2];   
           int32 comp_type;              /* compression type */
           struct comp_info cinfo;
          } comp;

     struct 
          {     
          /* is not used in GR interface */
          } nbit;
     } HDF_CHUNK_DEF


Purpose

Makes a raster image a chunked raster image.

Valid values of the parameter flags are HDF_CHUNK for chunked and uncompressed data and (HDF_CHUNK | HDF_COMP) for chunked and compressed data. Data can be compressed using run-length encoding (RLE), Skipping Huffman or GZIP compression algorithms.

If the parameter flags has a value of HDF_CHUNK, the chunk dimensions must be specified in the field cdef.chunk_lengths[]. If the parameter flags has a value of (HDF_CHUNK | HDF_COMP), the following must be specified:

1) The chunk dimensions in the field cdef.comp.chunk_lengths[].

2) The compression type in the field cdef.comp.comp_type. Valid values of compression type values are listed below.

COMP_CODE_NONE (or 0) for uncompressed data

COMP_CODE_RLE (or 1) for data compressed using the RLE compression algorithm

COMP_CODE_SKPHUFF (or 3) for data compressed using the Skipping Huffman compression algorithm

COMP_CODE_DEFLATE (or 4) for data compressed using the GZIP compression algorithm

3) If using Skipping Huffman compression, the skipping size is specified in the field cdef.comp.cinfo.skphuff.skp_size. If using GZIP compression, the deflate level is specified in the field cdef.comp.cinfo.deflate.level. Valid deflate level values are integers from 1 to 9 inclusive.

Refer to the SDsetcompress page in this manual for the definition of the comp_info structure.

Fortran only:

The dim_length array specifies the chunk dimensions.

The parameter comp_type specifies the compression type. Valid compression types and their values used are defined in the hdf.inc file, and are listed below.

COMP_CODE_NONE (or 0) for uncompressed data

COMP_CODE_RLE (or 1) for data compressed using the RLE compression algorithm

COMP_CODE_SKPHUFF (or 3) for data compressed using the Skipping Huffman compression algorithm

COMP_CODE_DEFLATE (or 4) for data compressed using the GZIP compression algorithm.

The parameter comp_prm specifies the compression parameters for the Skipping Huffman and GZIP compression methods. It contains only one element which is set to the skipping size for Skipping Huffman compression or the deflate level for GZIP compression

FORTRAN

integer function mgschnk(ri_id, dim_length, comp_type, comp_prm)

integer ri_id, dim_length, comp_type, comp_prm



[Back to Interface] [Prev] [Next]

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