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

GRgetattr/mggnatt/mggcatt

intn GRgetattr(int32 [ri, gr]_id, int32 attr_index, VOIDP values)
[ri, gr]_id

IN:

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

attr_index

IN:

Index of the attribute(s)

values

OUT:

Buffer for the attribute values

Purpose

Reads an attribute of a raster image, or all raster images, into a buffer.

Return value

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

Description

GRgetattr is often used in conjunction with GRselect and GRnametoindex, or GRselect and GRreftoindex, to retrieve the attributes of a specific general raster image. If a gr_id is specified as the first parameter, the global attributes (applied to all general raster images in the file) are retrieved.

It is not possible to read a subset of the attribute values assigned to the target object with GRgetattr - all values will be read.

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

Example

This example illustrates the use of GRgetattr to read the attributes of a general raster image:

     #include "hdf.h"

     int32 ri_id, gr_id, stat, attr_index;
     int32 attr_values[2];
        ...
     ri_id = GRselect(gr_id, 0);
     attr_index = GRfindattr(ri_id, "Target attribute");
     stat = GRgetattr(ri_id, attr_index, attr_values);
       ...

         
FORTRAN

integer function mggnatt([ri, gr]_id, attr_index, values)

integer [ri, gr]_id, attr_index

<valid numeric data type> values(*)

integer function mggcatt([ri, gr]_id, attr_index,

values)

integer [ri, gr]_id, attr_index

character* (*) values



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

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