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

GRsetattr/mgsnatt/mgscatt

intn GRsetattr(int32 [ri, gr]_id, const char *attr_name, int32 data_type, int32 count, const VOIDP values)
[ri, gr]_id

IN:

Identifier of the raster image or the GR interface identifier returned by GRstart

attr_name

IN:

Name of the attribute(s)

data_type

IN:

Data type of the attribute(s)

count

IN:

Number of values in the attribute(s)

values

IN:

Buffer for attribute values

Purpose

Assigns an attribute to one raster image, or all general raster images, in a file.

Return value

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

Description

Currently, the only predefined attribute is the fill value, identified by the FILL_ATTR definition. If a gr_id is specified as the first parameter, the global attributes (applied to all general raster images in the file) are set.

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

Example

This example illustrates the use of GRsetattr to assign atrributes to a general raster image:

     #include "hdf.h"

     int32 ri_id, gr_id, stat;
     int32 attr_values[2];
       ...
     attr_values[0] = 5;
     attr_values[1] = 50;
     ri_id = GRselect(gr_id, 0);
     stat = GRsetattr(ri_id, "Value range", DFNT_INT32, 2
                      attr_values);
       ...
         
FORTRAN

integer function mgsnatt([ri, gr]_id, ttr_name, data_type, count, values)

integer [ri, gr]_id, attr_name, data_type

integer count

<valid numeric data type> values(*)

integer function mgscatt([ri, gr]_id, attr_name, data_type, count, values)

integer [ri, gr]_id, attr_name, data_type

integer count

character* (*) values



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

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