[Back to Interface] [Prev] [Next]

GRcreate/mgcreat

int32 GRcreate(int32 gr_id, char *name, int32 ncomp, int32 data_type, int32 interlace_mode, int32 dim_sizes[2])

gr_id IN:

GR interface identifier returned by GRstart

name IN:

Name of the raster image

ncomp IN:

Number of pixel components in the image

data_type IN:

Type of the image data

interlace_mode IN:

Interlace mode of the image data

dim_sizes IN:

Size of each dimension of the image

Purpose

Creates a new raster image.

Return value

Returns a raster image identifier if successful and FAIL (or -1) otherwise.

Description

GRcreate creates a raster image with the values provided in the parameters name, ncomp, data_type, interlace_mode and dim_sizes.

The parameter name specifies the name of the image and must not be NULL. The length of the name should not be longer than MAX_GR_NAME (or 256).

The parameter ncomp specifies the number of pixel components in the raster image and must have a value of at least 1.

The parameter data_type specifies the type of the raster image data and can be any of the data types supported by the HDF library. The data types supported by HDF are listed in Table 1A in Section I of this manual.

The parameter interlace_mode specifies the interlacing in which the raster image is to be written. The valid values of interlace_mode are: MFGR_INTERLACE_PIXEL (or 0), MFGR_INTERLACE_LINE (or 1) and MFGR_INTERLACE_COMPONENT (or 2).

The array dimsizes specifies the size of the two dimensions of the image. The dimensions must be specified and their values must be greater than 0.

Once a raster image has been created, it is not possible to change its name, data type, dimension sizes or number of pixel components. However, it is possible to create a raster image and close the file before writing any data values to it. Later, the values can be added to or modified in the raster image, which then can be obtained using GRselect.

FORTRAN

integer function mgcreat(gr_id, name, ncomp, data_type, interlace_mode, dim_sizes)

integer gr_id, data_type, interlace_mode, ncomp, dim_sizes(2)

character*(*) name



[Back to Interface] [Prev] [Next]

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