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

GRwritelut/mgwrlut/mgwclut

intn GRwritetlut(int32 pal_id, int32 ncomp, int32 data_type, int32 interlace, int32 num_entries, VOIDP pal_data)
pal_id

IN:

Palette identifier to be assigned to the written data

ncomp

IN:

Number of color components in the palette

data_type

IN:

Data type of the palette data

interlace

IN:

Interlace mode of the stored palette data

num_entries

IN:

Number of entries in the palette

pal_data

IN:

Buffer for the palette data to be written

Purpose

Writes palette data to a general raster image dataset.

Return value

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

Description

This routine is commonly used in conjunction with a call to GRgetlutid.

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

Example

This example illustrates the use of GRwritelut:

     #include "hdf.h"

     int32 pal_id, ri_id, gr_id, stat;
     intn lut_index;
     char pal_data[PALETTE_SIZE][3];
     int32 ncomp = 3;
     int32 data_type = DFNT_INT8;
     int32 interlace = MFGR_INTERLACE_PIXEL;
       ...
     index = GRnametoindex(gr_id, "Target image");
     ri_id = GRselect(gr_id, index);
     pal_id = GRgetlutid(ri_id, lut_index);
     stat = GRwritelut(pal_id, ncomp, data_type, interlace,
                       PALETTE_SIZE, pal_data);
       ...
         
FORTRAN

integer function mgwrlut(pal_id, ncomp, data_type, interlace, num_entries, pal_data)

integer pal_id, ncomp, data_type, interlace, num_entries

<valid numeric data type> pal_data(*)

integer function mgwclut(pal_id, ncomp, data_type, interlace, num_entries, pal_data)

integer pal_id, ncomp, data_type, interlace, num_entries

character* (*) pal_data



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

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