[Top] [Prev] [Next] [Bottom]

GRwriteimage/mgwrimg/mgwcimg

intn GRwriteimage(int32 ri_id, int32 start[2], int32 stride[2], int32 edge[2], VOIDP data)
ri_id

IN:

General raster image identifier returned by GRcreate or GRselect

start

IN:

Array containing the two-dimensional coordinate of the initial location for the write

stride

IN:

Array containing the number of data locations the current location is to be moved forward before each write

edge

IN:

Array containing the number of data elements that will be written along each dimension

data

IN:

Buffer containing the image data to be written

Purpose

Writes a general raster image to the current HDF file.

Return value

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

Description

By setting the start, stride and edge parameters appropriately, GRwriteimage will perform subsampling and image slab writes. Setting stride to NULL assumes a stride value of 1.

Note that there are two Fortran-77 versions of this routine; one for buffered numeric data (mgwrimg) and the other for buffered character data (mgwcimg).

Example

This example illustrates the use of GRwriteimage:

     #include "hdf.h"

     int32 file_id, gr_id, ri_id, stat;
     char *name = "Image name";
     int32 ncomp = 0;
     int32 interlace_mode = MFGR_INTERLACE_PIXEL;
     int32 data_type = DFNT_UINT16;
     int32 dim_sizes[2];
     uint16 *data;
file_id = Hopen("myfile", DFACC_WRITE, 0); gr_id = GRstart(file_id); ri_id = GRcreate(gr_id, name, ncomp, data_type, interlace_mode, dim_sizes); ... stat = GRwriteimage(ri_id, start, stride, edge, data); ... stat = GRendaccess(ri_id); stat = GRend(gr_id); Hclose(file_id);
FORTRAN

integer function mgwrimg(ri_id, start, stride, edge, data)

integer ri_id, start(2), stride(2), edge(2)

<valid numeric data type> data(*)

integer function mgwcimg(ri_id, start, stride, edge, data)

integer ri_id, start(2), stride(2), edge(2)

character* (*) data



[Top] [Prev] [Next] [Bottom]

hdfhelp@ncsa.uiuc.edu
HDF User's Reference Manual, Draft 06/09/97, NCSA HDF Development Group.