7.5.1 Reading a Raster Image: DF24getimage
If the dimensions and interlace format of the image are known, DF24getimage is the only function call required to read a raster image. If a file is being opened for the first time, DF24getimage returns the first image in the file. Additional calls will return successive images in the file, therefore images are read in the same order in which they were written to the file. Normally, DF24getdims and DF24getil are called before DF24getimage so that, if necessary, space allocations and interlace format for the image can be checked and the dimensions verified. If this information is already known, both function calls may be omitted.C: status = DF24getimage(filename, image, width, height);
FORTRAN: status = d2gimg(filename, image, width, height)
DF24getimage retrieves the next 24-bit image from the HDF file specified by the filename
parameter. If the image is compressed, DF24getimage decompresses it and places it in memory at the location pointed to by the image
parameter. DF24getimage assumes the data is stored using pixel interlacing. The space allocated to hold the image is specified by the width
and height
parameters and may be larger than the actual image.The parameters for DF24getimage are further defined below. Table 7F on page 252
7.5.2 Determining the Dimensions of an Image: DF24getdims
DF24getdims opens a named file, finds the next image or the first image if the file is being opened for the first time, retrieves the dimensions of the image, then determines the interlace format of the image. Images are read in the order they were written.C: status = DF24getdims(filename, width, height, il);
status = DF24getimage(filename, image, width, height);
FORTRAN: status = d2gdim(filename, width, height, il)
status = d2gimg(filename, image, width, height)
DF24getdims takes four parameters: filename
, width
, height
, and il
. It retrieves dimension and interlace format information of the next 24-bit image stored in the HDF file specified by the filename
parameter. The width and height are returned in the space pointed to by the width
and height
parameters respectively. The il
parameter is used to determine the interlace format. The parameters for DF24getdims are further defined below. (See Table 7F.)
7.5.3 Modifying the Interlacing of an Image: DF24reqil
DF24reqil specifies an interlace format to be used when reading a 24-bit image from a file into memory. Regardless of what interlace format is used to store the image, DF24reqil forces the image to be loaded into memory using the specified interlace format.C: status = DF24reqil(il);
status = DF24getimage(filename, image, width, height);
FORTRAN: status = d2reqil(il)
status = d2gimg(filename, image, width, height)
DF24reqil takes il
as its only parameter. Valid il
values are DFIL_PIXEL
, DFIL_LINE
and DFIL_PLANE
. As a call to DF24reqil may require a substantial reordering of the data, a much slower I/O performance than would be achieved if the interlace format wasn't reset may result.
TABLE 7F - DF24getimage, DF24getdims and DF24reqil Parameter List
C version
7.5.4 Reading a 24-Bit Raster Image with a Given Reference Number: DF24readref
DF24readref is used to access specific images stored in files containing multiple raster image sets. It is optionally used before DF24getimage. DF24readref can be used in connection with vgroups, which identify their members by tag/reference number pairs. See Chapter 5, Vgroups (V API), for a discussion of vgroups and tag/reference number pairs.
To access a specific raster image set, use the following sequence of routine calls:
C: status = DF24readref(filename, ref);
status DF24getimage(filename, image, width, height);
FORTRAN: status = d2rref(filename, ref)
status = d2gimg(filename, image, width, height)
DF24readref sets the reference number for the next read operation performed on the HDF file filename
to the reference number contained in ref
. Because reference numbers are not always assigned in sequence, it is not guaranteed that a reference number represents the location of the image in the file. TABLE 7G - DF24readref Parameter List
C: status = DF24restart( );
FORTRAN: status = d2first( )
|
|
|
| |
|
| |||
|
|
|
None.
|