[Back to Interface] [Prev]

GRwritelut/mgwrlut/mgwclut

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

pal_id IN:

Palette identifier returned by GRgetlutid

ncomp IN:

Number of components in the palette

data_type IN:

Data type of the palette data

interlace_mode 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 a palette.

Return value

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

Description

GRwritelut writes a palette with the number of pixel components specified by the parameter ncomp, the data type of the palette data specified by the parameter data_type, the interlace mode specified by the parameter interlace_mode, and the number of entries in the palette specified by the parameter num_entries. The palette data itself is stored in the pal_data buffer. Currently only "old-style" palettes are supported, i.e ncomp = 3, num_entries = 256, data_type = uint8.

The parameter ncomp specifies the number of pixel components in the palette and must have a value of at least 1.

The parameter data_type specifies the type of the palette data and can be any of the data types supported by the HDF library. The data types supported by HDF are listed in Table 1A in Section I of this manual.

The parameter interlace_mode specifies the interlacing in which the palette is to be written. The valid values of interlace_mode are: MFGR_INTERLACE_PIXEL (or 0), MFGR_INTERLACE_LINE (or 1) and MFGR_INTERLACE_COMPONENT (or 2).

The buffer pal_data is assumed to have sufficient space allocated to store all of the palette data.

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

FORTRAN

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

integer pal_id, ncomp, data_type, interlace_mode, num_entries

<valid numeric data type> pal_data(*)

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

integer pal_id, ncomp, data_type, interlace_mode, num_entries

character*(*) pal_data



[Back to Interface] [Prev]

hdfhelp@ncsa.uiuc.edu
HDF Reference Manual - 07/29/98, NCSA HDF Development Group.