[Back to Interface] [Prev] [Next]

DFR8putimage/d8pimg

intn DFR8putimage(char *filename, VOIDP image, int32 width, int32 height, uint16 compress)

filename IN:

Name of the file to store the raster image in

image IN:

Array with image to put in file

width IN:

Number of columns in the image

height IN:

Number of rows in the image

compress IN:

Type of compression used, if any

Purpose

Writes the RIS8 for the image as the first image in the file, overwriting any information previously in the file.

Return value

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

Description

The compress parameter identifies the method to be used for compressing the data, if any. If IMCOMP compression is used, the image must include a palette.

DFR8putimage overwrites any information that exists in the HDF file. To write an image to a file by appending it, rather than overwriting it, use DFR8addimage.

In FORTRAN-77, the dimensions of the image array must be the same as the dimensions of the image itself.

The order in which dimensions are declared is different between C and FORTRAN-77. Ordering varies because FORTRAN-77 arrays are stored in column-major order, while C arrays are stored in row-major order. (Row-major order implies that the horizontal coordinate varies fastest). When DFR8putimage writes an image to a file, it assumes row-major order. The FORTRAN-77 declaration that causes an image to be stored in this way must have the width as its first dimension and the height as its second dimension, the reverse of the way it is done in C. To take this into account as you build your image in your FORTRAN-77 program, the image must be built "on its side".

FORTRAN

integer function d8pimg(filename, image, width, height, compress)

character*(*) filename, image

integer width, height, compress



[Back to Interface] [Prev] [Next]

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