HDFGETR8 Function
Obtains an HDF Raster 8 image and associated palette.
 
Restriction
See Support for optional PV-WAVE modules to check if this function is available on your operating system.
Usage
status = HDFGETR8 (filename, image, palette)
Input Parameters
filename—The name of the HDF file.
Output Parameters
image—A byte array which contains the obtained HDF Raster 8 image.
palette—A byte array (3-by-256) which contains the color palette associated with the HDF image. Use the HDFLCT procedure to load the palette.
Return Value
status—The status of the function call, where:
*SUCCEED (0)—Indicates success.
*FAIL (–1)—Indicates failure.
Keywords
Help—If present and nonzero, lists the usage for this routine.
Usage—If present and nonzero, lists the usage for this routine. (Same as the Help keyword.)
Discussion
HDFGETR8 obtains an HDF Raster 8 image from the named HDF file. HDFGETR8 will read the current (or first) Raster 8 image in the file and position the HDF active pointer to the next Raster 8 image. You can read all Raster 8 images in an HDF file using successive calls to HDFGETR8. The return status is set to FAIL when the function reads beyond the last Raster 8 image.
You can load the HDF palette associated with the image into PV‑WAVE directly using the HDFLCT procedure.
Use DFR8READREF or DFR8RESTART to position the active pointer within the HDF file.
Example
hdf_init
@hdf_common
testfile = !Data_dir + '/raster8.hdf'
status = DFR8RESTART()
IF (status EQ FAIL) THEN $
   MESSAGE, 'Failed at DFR8restart for HDFGETR8.'
status = HDFGETR8(testfile, image, palette)
IF (status EQ FAIL) THEN $
   MESSAGE, 'HDFGETR8 failed.' $
ELSE LOADCT, 0 & TV, image
See Also
Also refer to the following routines in the HDF Reference Manual:
DFR8GETDIMS, DFR8GETIMAGE, DFR8NIMAGES, DFR8READREF, DFR8RESTART, HISHDF
For more information on using the HDF interface and the calling sequence for the entire suite of HDF base functions, refer to Appendix A: PV-WAVE HDF Interface.
For a complete list of the HDF convenience routines, refer to Chapter 1: Functional Summary of Routines.