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

GRgetlutid/mggltid

int32 GRgetlutid(int32 ri_id, int32 palette_index)
ri_id

IN:

General raster image identifier returned by GRcreate or GRselect

palette_index

IN:

Index of the palette

Purpose

Assigns a palette identifier to a general raster image dataset.

Return value

Returns a palette identifier if successful and FAIL (or -1) otherwise.

Description

This routine establishes the connection between a palette and a general raster image. Often used in conjunction with GRwritelut. Currently, only one palette can be assigned to a general raster image, which means that palette_index should always be set to 0.

Example

This example illustrates the use of GRgetlutid in creating a palette:

     #include "hdf.h"

     int32 pal_id, ri_id, gr_id, stat, image_index;
     char pal_data[PALETTE_SIZE][3];
     int32 ncomp = 3;
     int32 data_type = DFNT_INT8;
     int32 interlace = MFGR_INTERLACE_PIXEL;

       ...
     image_index = GRnametoindex(gr_id, "Target image");
     ri_id = GRselect(gr_id, image_index);
     pal_id = GRgetlutid(ri_id, 0);
     stat = GRwritelut(pal_id, ncomp, data_type, interlace,
                       PALETTE_SIZE, pal_data);
       ...
 
FORTRAN

integer function mggltid(ri_id, palette_index)

integer ri_id, palette_index



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

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