SE_rasbandinfo_get_colormap

Retrieves the colormap information in a raster band.

Usage syntax

LONG SE_rasbandinfo_get_colormap
(const SE_RASBANDINFO rasterband,
SE_COLORMAP_TYPE *colormap_type,
SE_COLORMAP_DATA_TYPE *data_type,
LONG *num_entries,
void **data);

Parameters
rasterband The SE_RASBANDINFO handle
colormap_type A pointer to the colormap type
data_type A pointer to the data type
num_entries A pointer to the number of entries
data The address of the pointer to the colormap data
Description

SE_rasbandinfo_get_colormap retrieves the colormap information in raster band. The colormap data returned will be a one-dimensional array. For example, if the colormap type is SE_COLORMAP_RGB, it should have the following structure: r0, g0, b0, r1, g1, b1, ...

The possible values for the SE_COLORMAP_TYPE enumeration are:

  SE_COLORMAP_NONE - The band does not have a colormap.
  SE_COLORMAP_RGB - The band has an RGB colormap. The data array will consists of three repeated values for red, green and blue.
  SE_COLORMAP_RGBA - The band has a RGBA colormap. The data array consists of four repeated values for red, green, blue and an attribute value used for transparency by some renderers.

The possible values for the SE_COLORMAP_DATA_TYPE enumeration are:

  SE_COLORMAP_DATA_BYTE, - The color map is an array of bytes.
  SE_COLORMAP_DATA_SHORT, - The colormap is an array of short integers.

Note

Colormaps can only be applied to single band rasters whose bit depth is either 8 or 16 bit. The allowable compression type for rasters with colormaps map is LZ77 (SE_COMPRESSION_LZ77). If a pyramid is created, only the nearest neighbor (SE_INTERPOLATION_NEAREST) interpolation type is allowed. These restrictions are necessary since color mapped rasters must be able to map to a discrete set of values that will not be resampled.

Returns

SE_SUCCESS
SE_INVALID_POINTER

SE_OPERATION_NOT_ALLOWED

SE_RASTERBAND_NO_COLORMAP

SE_OUT_OF_CLMEM

Notes:

Use SE_rasbandinfo_free_colormap to free the memory for colormap data.