[Back to Interface] [Prev] [Next]

DF24getdims/d2gdims

intn DF24getdims (char *filename, int32 *width, int32 *height, intn *interlace_mode)

filename IN:

Name of the file

width OUT:

Width of the image

height OUT:

Height of the image

interlace_mode OUT:

File interlace mode of the image

Purpose

Retrieves dimensions and interlace storage scheme of next image.

Return value

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

Description

DF24getdims retrieves the dimensions and interlace of the image. If the file is being opened for the first time, DF24getdims returns information about the first image in the file. If an image has already been read, DF24getdims finds the next image. In this way, images are read in the same order in which they were written to the file.

If the dimensions and interlace of the image are known beforehand, there is no need to call DF24getdims. Simply allocate arrays with the proper dimensions for the image and invoke DF24getimage to read the images. If, however, you do not know the values of width and height, you must call DF24getdims to get them and then use them to determine the amount of memory to allocate for the image buffer.

Successive calls to DF24getdims and DF24getimage retrieve all of the images in the file in the sequence in which they were written.

The interlace mode codes are: 0 for pixel interlacing, 1 for scan-line interlacing and 2 for scan-plane interlacing.

FORTRAN

integer function d2gdims(filename, width, height, interlace_mode)

character*(*) filename

integer width, height, interlace_mode



[Back to Interface] [Prev] [Next]

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