MeVisLab Toolbox Reference
ml::LUTData< T > Class Template Reference

A LUTData object stores an instance of a LUT, rendered for a specified visual type, data type, reference range and index/row/layer set. More...

#include <mlLUTData.h>

Inheritance diagram for ml::LUTData< T >:
ml::LUTDataBase

Public Member Functions

 LUTData ()
 Constructor, passes data type identifier constant to LUTDataBase A specialized constructor for each supported data type is defined.
 
MLDataType getType (MLuint8 *)
 supported basic data types
 
MLDataType getType (MLint8 *)
 
MLDataType getType (MLuint16 *)
 
MLDataType getType (MLint16 *)
 
MLDataType getType (MLuint32 *)
 
MLDataType getType (MLint32 *)
 
MLDataType getType (MLint64 *)
 
MLDataType getType (MLuint64 *)
 
MLDataType getType (float *)
 
MLDataType getType (double *)
 
MLDataType getType (MLldouble *)
 
MLErrorCode init (LUTVisualType visualType, int minIndex, int maxIndex, T maxEntry)
 Initialize LUT data for specified visual type, index range and maximum entry value (= reference value used for scaling LUT entries)
 
MLErrorCode init (LUTVisualType visualType, int minIndex, int maxIndex, int minRow, int maxRow, T maxEntry)
 Initialize 2D-LUT data for specified visual type, index/row ranges and maximum entry value (= reference value used for scaling LUT entries)
 
MLErrorCode init (LUTVisualType visualType, int minIndex, int maxIndex, int minRow, int maxRow, int minLayer, int maxLayer, T maxEntry)
 Initialize 3D-LUT data for specified visual type, index/row/layer ranges and maximum entry value (= reference value used for scaling LUT entries)
 
MLErrorCode initShared1D (LUTVisualType visualType, int minIndex, int maxIndex, int row, int layer, LUTData< T > *srcLutData, int srcIndex, int srcRow, int srcLayer)
 Initialize 1D-LUT data for specified visual type and index range.
 
MLErrorCode initShared2D (LUTVisualType visualType, int minRow, int maxRow, int layer, LUTData< T > *srcLutData, int srcRow, int srcLayer)
 Initialize 2D-LUT data for specified visual type, row range and layer.
 
T getMaxEntry (void) const
 Get maximum (reference) entry value.
 
TgetData (void)
 Get LUT data pointer, entries are stored interleaved (e.g. RGBARGBA...)
 
const TgetData (void) const
 Get LUT data pointer (const version)
 
TgetEntriesAt (int index, int row, int layer)
 Get LUT entries at given index, row and layer.
 
const TgetEntriesAt (int index, int row, int layer) const
 Get LUT entries at given index, row and layer (const version)
 
TgetEntriesAt (int index, int row)
 Get LUT entries at given index and row.
 
const TgetEntriesAt (int index, int row) const
 Get LUT entries at given index and row (const version)
 
TgetEntriesAt (int index)
 Get LUT entries at given index.
 
const TgetEntriesAt (int index) const
 Get LUT entries at given index (const version)
 
virtual LUTData< T > * clone (void) const
 Create a new LUTData object with the same properties and a new, uninitialized data buffer.
 
- Public Member Functions inherited from ml::LUTDataBase
virtual ~LUTDataBase ()
 Destructor.
 
void clear ()
 Clear.
 
bool isInitialized (void) const
 Return true if LUT initialized.
 
bool ownsData (void) const
 Return true if this LUTData object owns the referenced LUT data buffer.
 
MLDataType getDataType (void) const
 Get data type.
 
int getEntrySize (void) const
 Get size of a single LUT entry.
 
LUTVisualType getVisualType (void) const
 Get visual type.
 
int getNumChannels (void) const
 Get number of channels.
 
LUTDimensionality getDimensionality (void) const
 Get number of dimensions (1, 2, or 3)
 
int getMinIndex (void) const
 Get minimum index value.
 
int getMaxIndex (void) const
 Get maximum index value.
 
int getWidth (void) const
 Get index range width.
 
int getMinRow (void) const
 Get minimum row value.
 
int getMaxRow (void) const
 Get maximum row value.
 
int getHeight (void) const
 Get number of rows.
 
int getMinLayer (void) const
 Get minimum layer value.
 
int getMaxLayer (void) const
 Get maximum layer value.
 
int getDepth (void) const
 Get number of layers.
 
int getLength (void) const
 Get total number of entries.
 
int getStride (int dim) const
 Get entry stride for index (dim = 1), row (2) and layer (3) dimension, relative to entry size, i.e.
 
int getDataSize (void) const
 Get size of LUT data area (in bytes)
 
bool isInRange (int index, int row=0, int layer=0) const
 Return true if specified index, row and layer position is in LUT range.
 
unsigned int getId (void) const
 Get LUT ID.
 
void setId (unsigned int id)
 Set LUT ID.
 
void setId (unsigned int id, double minIndex, double maxIndex)
 Set LUT ID including min/max range on rescaled luts.
 
const LUTDataIdgetFullId () const
 Get full LUT data ID, including min/max ranged from renderRescaled.
 
void setFullId (const LUTDataId &id)
 Set full LUT data ID, including min/max ranged from renderRescaled.
 

Protected Attributes

T _maxEntry
 Maximum entry value (= reference value used for scaling LUT entries)
 
- Protected Attributes inherited from ml::LUTDataBase
MLDataType _dataType
 Data type identifier constant.
 
int _entrySize
 Size of single data entry.
 
int _dataLength
 Number of entries.
 
void_data
 LUT data pointer.
 
bool _ownsData
 This flag is true if LUT data buffer is owned by this LUTData object.
 
LUTVisualType _visualType
 Visual type.
 
int _numChannels
 Number of channels.
 
LUTDimensionality _dimensionality
 Dimensionality (1, 2 or 3)
 
int _minIndex
 Index range (1st dimension)
 
int _maxIndex
 
int _minRow
 Row range (2nd dimension)
 
int _maxRow
 
int _minLayer
 Layer range (3rd dimension)
 
int _maxLayer
 
int _strides [3]
 Data strides (entry address differences) for index (1st), row (2nd) and layer (3rd) dimension (relative to entry size)
 
int _entryOffset
 Entry offset for addressing via getEntriesAt() in derived LUTData class.
 
LUTDataId _lutId
 LUT ID.
 

Additional Inherited Members

- Protected Member Functions inherited from ml::LUTDataBase
 LUTDataBase (MLDataType dataType)
 Constructor, create empty, unallocated table.
 
MLErrorCode init (LUTVisualType visualType, int minIndex, int maxIndex, int minRow, int maxRow, int minLayer, int maxLayer)
 Initialize LUT data for specified visual type and index/row/layer ranges.
 
MLErrorCode initShared1D (LUTVisualType visualType, int minIndex, int maxIndex, int row, int layer, LUTDataBase *srcLutData, int srcIndex, int srcRow, int srcLayer)
 Initialize 1D-LUT data for specified visual type, index range and row/layer.
 
MLErrorCode initShared2D (LUTVisualType visualType, int minRow, int maxRow, int layer, LUTDataBase *srcLutData, int srcRow, int srcLayer)
 Initialize 2D-LUT data for specified visual type, row range and layer.
 
void reset (void)
 Reset properties.
 
void clearData (void)
 Clear data buffer.
 
bool initData (void)
 Initialize data buffer, return true if successful.
 

Detailed Description

template<typename T>
class ml::LUTData< T >

A LUTData object stores an instance of a LUT, rendered for a specified visual type, data type, reference range and index/row/layer set.

For rendering a LUTFunction object into a LUTData, use the methods LUTFunction::render() and LUTFunction::renderRescaled(). To access the data stored in the LUTData object, use the getData() method.

Definition at line 242 of file mlLUTData.h.

Constructor & Destructor Documentation

◆ LUTData()

template<typename T >
ml::LUTData< T >::LUTData ( )
inline

Constructor, passes data type identifier constant to LUTDataBase A specialized constructor for each supported data type is defined.

Definition at line 248 of file mlLUTData.h.

Member Function Documentation

◆ clone()

template<typename T >
LUTData< T > * ml::LUTData< T >::clone ( void ) const
virtual

Create a new LUTData object with the same properties and a new, uninitialized data buffer.

Definition at line 413 of file mlLUTData.h.

References ML_RESULT_OK, and mlrange_cast().

◆ getData() [1/2]

template<typename T >
T * ml::LUTData< T >::getData ( void )
inline

Get LUT data pointer, entries are stored interleaved (e.g. RGBARGBA...)

Definition at line 306 of file mlLUTData.h.

References T.

◆ getData() [2/2]

template<typename T >
const T * ml::LUTData< T >::getData ( void ) const
inline

Get LUT data pointer (const version)

Definition at line 309 of file mlLUTData.h.

References T.

◆ getEntriesAt() [1/6]

template<typename T >
T * ml::LUTData< T >::getEntriesAt ( int index)
inline

Get LUT entries at given index.

Definition at line 328 of file mlLUTData.h.

◆ getEntriesAt() [2/6]

template<typename T >
const T * ml::LUTData< T >::getEntriesAt ( int index) const
inline

Get LUT entries at given index (const version)

Definition at line 332 of file mlLUTData.h.

◆ getEntriesAt() [3/6]

template<typename T >
T * ml::LUTData< T >::getEntriesAt ( int index,
int row )
inline

Get LUT entries at given index and row.

Definition at line 320 of file mlLUTData.h.

◆ getEntriesAt() [4/6]

template<typename T >
const T * ml::LUTData< T >::getEntriesAt ( int index,
int row ) const
inline

Get LUT entries at given index and row (const version)

Definition at line 324 of file mlLUTData.h.

◆ getEntriesAt() [5/6]

template<typename T >
T * ml::LUTData< T >::getEntriesAt ( int index,
int row,
int layer )
inline

Get LUT entries at given index, row and layer.

Definition at line 312 of file mlLUTData.h.

References mlrange_cast().

◆ getEntriesAt() [6/6]

template<typename T >
const T * ml::LUTData< T >::getEntriesAt ( int index,
int row,
int layer ) const
inline

Get LUT entries at given index, row and layer (const version)

Definition at line 316 of file mlLUTData.h.

References mlrange_cast().

◆ getMaxEntry()

template<typename T >
T ml::LUTData< T >::getMaxEntry ( void ) const
inline

Get maximum (reference) entry value.

Definition at line 302 of file mlLUTData.h.

◆ getType() [1/11]

template<typename T >
MLDataType ml::LUTData< T >::getType ( double * )
inline

Definition at line 260 of file mlLUTData.h.

References MLdoubleType.

◆ getType() [2/11]

template<typename T >
MLDataType ml::LUTData< T >::getType ( float * )
inline

Definition at line 259 of file mlLUTData.h.

References MLfloatType.

◆ getType() [3/11]

template<typename T >
MLDataType ml::LUTData< T >::getType ( MLint16 * )
inline

Definition at line 254 of file mlLUTData.h.

References MLint16Type.

◆ getType() [4/11]

template<typename T >
MLDataType ml::LUTData< T >::getType ( MLint32 * )
inline

Definition at line 256 of file mlLUTData.h.

References MLint32Type.

◆ getType() [5/11]

template<typename T >
MLDataType ml::LUTData< T >::getType ( MLint64 * )
inline

Definition at line 257 of file mlLUTData.h.

References MLint64Type.

◆ getType() [6/11]

template<typename T >
MLDataType ml::LUTData< T >::getType ( MLint8 * )
inline

Definition at line 252 of file mlLUTData.h.

References MLint8Type.

◆ getType() [7/11]

template<typename T >
MLDataType ml::LUTData< T >::getType ( MLldouble * )
inline

Definition at line 261 of file mlLUTData.h.

References MLldoubleType.

◆ getType() [8/11]

template<typename T >
MLDataType ml::LUTData< T >::getType ( MLuint16 * )
inline

Definition at line 253 of file mlLUTData.h.

References MLuint16Type.

◆ getType() [9/11]

template<typename T >
MLDataType ml::LUTData< T >::getType ( MLuint32 * )
inline

Definition at line 255 of file mlLUTData.h.

References MLuint32Type.

◆ getType() [10/11]

template<typename T >
MLDataType ml::LUTData< T >::getType ( MLuint64 * )
inline

Definition at line 258 of file mlLUTData.h.

References MLuint64Type.

◆ getType() [11/11]

template<typename T >
MLDataType ml::LUTData< T >::getType ( MLuint8 * )
inline

supported basic data types

Definition at line 251 of file mlLUTData.h.

References MLuint8Type.

◆ init() [1/3]

template<typename T >
MLErrorCode ml::LUTData< T >::init ( LUTVisualType visualType,
int minIndex,
int maxIndex,
int minRow,
int maxRow,
int minLayer,
int maxLayer,
T maxEntry )

Initialize 3D-LUT data for specified visual type, index/row/layer ranges and maximum entry value (= reference value used for scaling LUT entries)

Definition at line 351 of file mlLUTData.h.

References ML_BAD_PARAMETER, ML_RESULT_OK, and mlrange_cast().

◆ init() [2/3]

template<typename T >
MLErrorCode ml::LUTData< T >::init ( LUTVisualType visualType,
int minIndex,
int maxIndex,
int minRow,
int maxRow,
T maxEntry )
inline

Initialize 2D-LUT data for specified visual type, index/row ranges and maximum entry value (= reference value used for scaling LUT entries)

Definition at line 270 of file mlLUTData.h.

References mlrange_cast().

◆ init() [3/3]

template<typename T >
MLErrorCode ml::LUTData< T >::init ( LUTVisualType visualType,
int minIndex,
int maxIndex,
T maxEntry )
inline

Initialize LUT data for specified visual type, index range and maximum entry value (= reference value used for scaling LUT entries)

Definition at line 265 of file mlLUTData.h.

References mlrange_cast().

◆ initShared1D()

template<typename T >
MLErrorCode ml::LUTData< T >::initShared1D ( LUTVisualType visualType,
int minIndex,
int maxIndex,
int row,
int layer,
LUTData< T > * srcLutData,
int srcIndex,
int srcRow,
int srcLayer )

Initialize 1D-LUT data for specified visual type and index range.

Initialize 1D-LUT data for specified visual type, index range and row/layer.

The LUT data buffer is shared with the data buffer of srcLutData, starting at specified srcIndex, srcRow and srcLayer. An error is returned if the requested visual type and index range is incompatible with the source LUTData.

CAUTION: Make sure that the LUT data buffer of the source LUTData remains valid during the life time of this object or until it is re-initialized.

Definition at line 375 of file mlLUTData.h.

References ML_RESULT_OK, and mlrange_cast().

◆ initShared2D()

template<typename T >
MLErrorCode ml::LUTData< T >::initShared2D ( LUTVisualType visualType,
int minRow,
int maxRow,
int layer,
LUTData< T > * srcLutData,
int srcRow,
int srcLayer )

Initialize 2D-LUT data for specified visual type, row range and layer.

The LUT data buffer is shared with the data buffer of srcLutData, starting at specified srcRow and srcLayer. An error is returned if the requested visual type and row range is incompatible with the source LUTData.

CAUTION: Make sure that the LUT data buffer of the source LUTData remains valid during the life time of this object or until it is re-initialized.

Definition at line 397 of file mlLUTData.h.

References ML_RESULT_OK, and mlrange_cast().

Member Data Documentation

◆ _maxEntry

template<typename T >
T ml::LUTData< T >::_maxEntry
protected

Maximum entry value (= reference value used for scaling LUT entries)

Definition at line 343 of file mlLUTData.h.


The documentation for this class was generated from the following file: