[Back to Interface] [Prev] [Next]

GRwriteimage/mgwrimg/mgwcimg

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

ri_id IN:

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

Purpose

Writes a raster image.

Return value

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

Description

GRwriteimage writes the subsample of the raster image data stored in the buffer data to the raster image specified by the parameter ri_id. The subsample is defined by the values of the parameters start, stride and edge.

The array start specifies the starting location of the subsample to be written. Valid values of each element in the array start are 0 to the size of the corresponding raster image dimension - 1. The first element of the array start specifies an offset from the beginning of the array data along the fastest-changing dimension, which is the second dimension in C and the first dimension in Fortran. The second element of the array start specifies an offset from the beginning of the array data along the second fastest-changing dimension, which is the first dimension in C and the second dimension in Fortran. For example, if the first value of the array start is 2 and the second value is 3, the starting location of the subsample to be written is at the fourth row and third column in C, and at the third row and fourth column in Fortran. Note that the correspondence between elements in the array start and the raster image dimensions in the GR interface is different from that in the SD interface. See the reference manual page on SDreaddata for an example of this.

The array stride specifies the writing pattern along each dimension. For example, if one of the elements of the array stride is 1, then every element along the corresponding dimension of the array data will be written. If one of the elements of the stride array is 2, then every other element along the corresponding dimension of the array data will be written, and so on. The correspondence between elements of the array stride and the dimensions of the array data is the same as described above for the array start.

Each element of the array edges specifies the number of data elements to be written along the corresponding dimension. The correspondence between the elements of the array edges and the dimensions of the array data is the same as described above for the array start.

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

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



[Back to Interface] [Prev] [Next]

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