MrSID Decode SDK for Raster Reference Manual
9.0.0.3864
|
color lookup table More...
#include <lti_pixelLookupTable.h>
Public Member Functions | |
LTIPixelLookupTable (const LTIPixel &pixelProps, lt_uint32 tableSize) | |
default constructor | |
LTIPixelLookupTable (const LTIPixelLookupTable &) | |
copy constructor | |
~LTIPixelLookupTable () | |
destructor | |
lt_uint32 | getTableSize () const |
get table size | |
void | setTableEntry (lt_uint32 index, const LTIPixel &pixelData) |
set table entry | |
void | setTableEntries (const void *mapData) |
set all table entries | |
LTIPixel * | getTableEntry (lt_uint32 index) const |
get table entry | |
const void * | getTableEntries () const |
get all table entries |
This class implements a color lookup table, for use with "indexed" or "palletized" images.
Definition at line 28 of file lti_pixelLookupTable.h.
LTIPixelLookupTable::LTIPixelLookupTable | ( | const LTIPixel & | pixelProps, |
lt_uint32 | tableSize | ||
) |
This constructor creates an LTIPixelLookupTable object consisting of the given number of entries.
pixelProps | the basic properties of the pixel in this LUT |
tableSize | the number of elements in the table |
const void* LTIPixelLookupTable::getTableEntries | ( | ) | const |
This function returns the color map data as a one-dimensional array, according to the format described in setAllEntries().
LTIPixel* LTIPixelLookupTable::getTableEntry | ( | lt_uint32 | index | ) | const |
This function returns the entry with the given index number. The caller takes ownership of the returned object.
index | the index number of the entry to look up |
lt_uint32 LTIPixelLookupTable::getTableSize | ( | ) | const |
Returns the number of entries in the table.
void LTIPixelLookupTable::setTableEntries | ( | const void * | mapData | ) |
This function sets all entries to the table. The mapData parameter is expected to be a one-dimensional array of length tablesize * numbands, e.g. if the pixel datatype is UINT8 then the array should be of the form "lt_uint8 data[3 * 256]" for a 3-banded, 256-entry table. Entry i will be referenced as data[i], data[i+256], data[i+512].
mapData | the colormap data |
void LTIPixelLookupTable::setTableEntry | ( | lt_uint32 | index, |
const LTIPixel & | pixelData | ||
) |
This function adds an entry to the table. The index must be less than the number of entries. The pixel data is copied into the table.
If the table already contains an entry with the given index number, the old entry is removed in favor of the new one.
index | the index number of the entry |
pixelData | the pixel data to be recorded for the index |