MeVisLab Toolbox Reference
ml::LUTDataBase Class Reference

Untyped base class for LUTData template classes. More...

#include <mlLUTData.h>

Inheritance diagram for ml::LUTDataBase:
ml::LUTData< float > ml::LUTData< MLfloat > ml::LUTData< MLuint8 > ml::LUTData< MLuint16 > ml::LUTData< T >

Public Member Functions

virtual ~LUTDataBase ()
 Destructor. More...
 
void clear ()
 Clear. More...
 
bool isInitialized (void) const
 Return true if LUT initialized. More...
 
bool ownsData (void) const
 Return true if this LUTData object owns the referenced LUT data buffer. More...
 
MLDataType getDataType (void) const
 Get data type. More...
 
int getEntrySize (void) const
 Get size of a single LUT entry. More...
 
LUTVisualType getVisualType (void) const
 Get visual type. More...
 
int getNumChannels (void) const
 Get number of channels. More...
 
LUTDimensionality getDimensionality (void) const
 Get number of dimensions (1, 2, or 3) More...
 
int getMinIndex (void) const
 Get minimum index value. More...
 
int getMaxIndex (void) const
 Get maximum index value. More...
 
int getWidth (void) const
 Get index range width. More...
 
int getMinRow (void) const
 Get minimum row value. More...
 
int getMaxRow (void) const
 Get maximum row value. More...
 
int getHeight (void) const
 Get number of rows. More...
 
int getMinLayer (void) const
 Get minimum layer value. More...
 
int getMaxLayer (void) const
 Get maximum layer value. More...
 
int getDepth (void) const
 Get number of layers. More...
 
int getLength (void) const
 Get total number of entries. More...
 
int getStride (int dim) const
 Get entry stride for index (dim = 1), row (2) and layer (3) dimension, relative to entry size, i.e. More...
 
int getDataSize (void) const
 Get size of LUT data area (in bytes) More...
 
bool isInRange (int index, int row=0, int layer=0) const
 Return true if specified index, row and layer position is in LUT range. More...
 
unsigned int getId (void) const
 Get LUT ID. More...
 
void setId (unsigned int id)
 Set LUT ID. More...
 
void setId (unsigned int id, double minIndex, double maxIndex)
 Set LUT ID including min/max range on rescaled luts. More...
 
const LUTDataIdgetFullId () const
 Get full LUT data ID, including min/max ranged from renderRescaled. More...
 
void setFullId (const LUTDataId &id)
 Set full LUT data ID, including min/max ranged from renderRescaled. More...
 

Protected Member Functions

 LUTDataBase (MLDataType dataType)
 Constructor, create empty, unallocated table. More...
 
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. More...
 
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. More...
 
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. More...
 
void reset (void)
 Reset properties. More...
 
void clearData (void)
 Clear data buffer. More...
 
bool initData (void)
 Initialize data buffer, return true if successful. More...
 

Protected Attributes

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

Detailed Description

Untyped base class for LUTData template classes.

Store instances of a LUT rendered for a given visual type, reference value and index, row and layer range. This class has a protected constructor, i.e. can only be instantiated by derived classes. The type information stored in this class can be used to typecast a pointer to the appropriate derived LUTData class. The ID stored with each LUTDataBase object can be used to identify the source the LUT was rendered from, e.g. the LUTFunction.

Definition at line 63 of file mlLUTData.h.

Constructor & Destructor Documentation

◆ LUTDataBase()

ml::LUTDataBase::LUTDataBase ( MLDataType  dataType)
protected

Constructor, create empty, unallocated table.

◆ ~LUTDataBase()

virtual ml::LUTDataBase::~LUTDataBase ( )
virtual

Destructor.

Member Function Documentation

◆ clear()

void ml::LUTDataBase::clear ( )

Clear.

◆ clearData()

void ml::LUTDataBase::clearData ( void  )
protected

Clear data buffer.

◆ getDataSize()

int ml::LUTDataBase::getDataSize ( void  ) const
inline

Get size of LUT data area (in bytes)

Definition at line 154 of file mlLUTData.h.

◆ getDataType()

MLDataType ml::LUTDataBase::getDataType ( void  ) const
inline

Get data type.

Definition at line 104 of file mlLUTData.h.

◆ getDepth()

int ml::LUTDataBase::getDepth ( void  ) const
inline

Get number of layers.

Definition at line 143 of file mlLUTData.h.

◆ getDimensionality()

LUTDimensionality ml::LUTDataBase::getDimensionality ( void  ) const
inline

Get number of dimensions (1, 2, or 3)

Definition at line 116 of file mlLUTData.h.

◆ getEntrySize()

int ml::LUTDataBase::getEntrySize ( void  ) const
inline

Get size of a single LUT entry.

Definition at line 107 of file mlLUTData.h.

◆ getFullId()

const LUTDataId& ml::LUTDataBase::getFullId ( ) const
inline

Get full LUT data ID, including min/max ranged from renderRescaled.

Definition at line 170 of file mlLUTData.h.

◆ getHeight()

int ml::LUTDataBase::getHeight ( void  ) const
inline

Get number of rows.

Definition at line 134 of file mlLUTData.h.

◆ getId()

unsigned int ml::LUTDataBase::getId ( void  ) const
inline

Get LUT ID.

Definition at line 161 of file mlLUTData.h.

◆ getLength()

int ml::LUTDataBase::getLength ( void  ) const
inline

Get total number of entries.

Definition at line 146 of file mlLUTData.h.

◆ getMaxIndex()

int ml::LUTDataBase::getMaxIndex ( void  ) const
inline

Get maximum index value.

Definition at line 122 of file mlLUTData.h.

◆ getMaxLayer()

int ml::LUTDataBase::getMaxLayer ( void  ) const
inline

Get maximum layer value.

Definition at line 140 of file mlLUTData.h.

◆ getMaxRow()

int ml::LUTDataBase::getMaxRow ( void  ) const
inline

Get maximum row value.

Definition at line 131 of file mlLUTData.h.

◆ getMinIndex()

int ml::LUTDataBase::getMinIndex ( void  ) const
inline

Get minimum index value.

Definition at line 119 of file mlLUTData.h.

Referenced by ml::LUTIterator< T >::init().

◆ getMinLayer()

int ml::LUTDataBase::getMinLayer ( void  ) const
inline

Get minimum layer value.

Definition at line 137 of file mlLUTData.h.

◆ getMinRow()

int ml::LUTDataBase::getMinRow ( void  ) const
inline

Get minimum row value.

Definition at line 128 of file mlLUTData.h.

◆ getNumChannels()

int ml::LUTDataBase::getNumChannels ( void  ) const
inline

Get number of channels.

Definition at line 113 of file mlLUTData.h.

◆ getStride()

int ml::LUTDataBase::getStride ( int  dim) const

Get entry stride for index (dim = 1), row (2) and layer (3) dimension, relative to entry size, i.e.

each entry counts as 1. Return 0 if dim is invalid for the present LUT data.

Referenced by ml::LUTIterator< T >::init().

◆ getVisualType()

LUTVisualType ml::LUTDataBase::getVisualType ( void  ) const
inline

Get visual type.

Definition at line 110 of file mlLUTData.h.

Referenced by ml::LUTFBlend::getRenderType(), ml::LUTFCompose::getRenderType(), and ml::LUTIterator< T >::init().

◆ getWidth()

int ml::LUTDataBase::getWidth ( void  ) const
inline

Get index range width.

Definition at line 125 of file mlLUTData.h.

◆ init()

MLErrorCode ml::LUTDataBase::init ( LUTVisualType  visualType,
int  minIndex,
int  maxIndex,
int  minRow,
int  maxRow,
int  minLayer,
int  maxLayer 
)
protected

Initialize LUT data for specified visual type and index/row/layer ranges.

◆ initData()

bool ml::LUTDataBase::initData ( void  )
protected

Initialize data buffer, return true if successful.

◆ initShared1D()

MLErrorCode ml::LUTDataBase::initShared1D ( LUTVisualType  visualType,
int  minIndex,
int  maxIndex,
int  row,
int  layer,
LUTDataBase srcLutData,
int  srcIndex,
int  srcRow,
int  srcLayer 
)
protected

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.

◆ initShared2D()

MLErrorCode ml::LUTDataBase::initShared2D ( LUTVisualType  visualType,
int  minRow,
int  maxRow,
int  layer,
LUTDataBase srcLutData,
int  srcRow,
int  srcLayer 
)
protected

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.

◆ isInitialized()

bool ml::LUTDataBase::isInitialized ( void  ) const
inline

Return true if LUT initialized.

Definition at line 98 of file mlLUTData.h.

◆ isInRange()

bool ml::LUTDataBase::isInRange ( int  index,
int  row = 0,
int  layer = 0 
) const

Return true if specified index, row and layer position is in LUT range.

◆ ownsData()

bool ml::LUTDataBase::ownsData ( void  ) const
inline

Return true if this LUTData object owns the referenced LUT data buffer.

Definition at line 101 of file mlLUTData.h.

◆ reset()

void ml::LUTDataBase::reset ( void  )
protected

Reset properties.

◆ setFullId()

void ml::LUTDataBase::setFullId ( const LUTDataId id)
inline

Set full LUT data ID, including min/max ranged from renderRescaled.

Definition at line 173 of file mlLUTData.h.

◆ setId() [1/2]

void ml::LUTDataBase::setId ( unsigned int  id)
inline

Set LUT ID.

Definition at line 164 of file mlLUTData.h.

◆ setId() [2/2]

void ml::LUTDataBase::setId ( unsigned int  id,
double  minIndex,
double  maxIndex 
)
inline

Set LUT ID including min/max range on rescaled luts.

Definition at line 167 of file mlLUTData.h.

Member Data Documentation

◆ _data

void* ml::LUTDataBase::_data
protected

LUT data pointer.

Definition at line 197 of file mlLUTData.h.

◆ _dataLength

int ml::LUTDataBase::_dataLength
protected

Number of entries.

Definition at line 194 of file mlLUTData.h.

◆ _dataType

MLDataType ml::LUTDataBase::_dataType
protected

Data type identifier constant.

Definition at line 188 of file mlLUTData.h.

◆ _dimensionality

LUTDimensionality ml::LUTDataBase::_dimensionality
protected

Dimensionality (1, 2 or 3)

Definition at line 210 of file mlLUTData.h.

◆ _entryOffset

int ml::LUTDataBase::_entryOffset
protected

Entry offset for addressing via getEntriesAt() in derived LUTData class.

Definition at line 226 of file mlLUTData.h.

◆ _entrySize

int ml::LUTDataBase::_entrySize
protected

Size of single data entry.

Definition at line 191 of file mlLUTData.h.

◆ _lutId

LUTDataId ml::LUTDataBase::_lutId
protected

LUT ID.

Definition at line 230 of file mlLUTData.h.

◆ _maxIndex

int ml::LUTDataBase::_maxIndex
protected

Definition at line 213 of file mlLUTData.h.

◆ _maxLayer

int ml::LUTDataBase::_maxLayer
protected

Definition at line 219 of file mlLUTData.h.

◆ _maxRow

int ml::LUTDataBase::_maxRow
protected

Definition at line 216 of file mlLUTData.h.

◆ _minIndex

int ml::LUTDataBase::_minIndex
protected

Index range (1st dimension)

Definition at line 213 of file mlLUTData.h.

◆ _minLayer

int ml::LUTDataBase::_minLayer
protected

Layer range (3rd dimension)

Definition at line 219 of file mlLUTData.h.

◆ _minRow

int ml::LUTDataBase::_minRow
protected

Row range (2nd dimension)

Definition at line 216 of file mlLUTData.h.

◆ _numChannels

int ml::LUTDataBase::_numChannels
protected

Number of channels.

Definition at line 207 of file mlLUTData.h.

◆ _ownsData

bool ml::LUTDataBase::_ownsData
protected

This flag is true if LUT data buffer is owned by this LUTData object.

Definition at line 200 of file mlLUTData.h.

◆ _strides

int ml::LUTDataBase::_strides[3]
protected

Data strides (entry address differences) for index (1st), row (2nd) and layer (3rd) dimension (relative to entry size)

Definition at line 223 of file mlLUTData.h.

◆ _visualType

LUTVisualType ml::LUTDataBase::_visualType
protected

Visual type.

Definition at line 204 of file mlLUTData.h.


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