|
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). |