MeVisLabToolboxReference
ml::LUTFBlend Class Reference

Generate a 2/3D-LUT by blending two 1/2D-LUTs. More...

#include <mlLUTFBlend.h>

Inheritance diagram for ml::LUTFBlend:
ml::LUTFunction ml::Base

List of all members.

Public Member Functions

 LUTFBlend (void)
 Constructor.
virtual void setInputLUTs (LUTFunction *inLUT1, LUTFunction *inLUT2)
 Set input LUTs, set relative flag to true if both input LUTs are relative.
Transform parameters
virtual void setBlendingSteps (int numBlendingSteps)
 Set number of blending steps (= number of rows/layers in output 2/3D-LUT, min = 2)
virtual int getBlendingSteps (void) const
 Get number of blending steps.
LUT properties
virtual bool isValid (void) const
 Return true if the LUT function is valid.
virtual LUTDimensionality getDimensionality (void) const
 Get dimensionality (1, 2, or 3)
virtual int getNativeMinIndex (void) const
 Get native minimum index.
virtual int getNativeMaxIndex (void) const
 Get native maximum index.
virtual int getHeight (void) const
 Get native LUT height (= number of rows, numbering starts at 0)
virtual int getDepth (void) const
 Get native LUT depth (= number of layers, numbering starts at 0)
virtual double getNativeMinValue (void) const
 Get native minimum LUT value.
virtual double getNativeMaxValue (void) const
 Get native maximum LUT value.
LUT rendering

These methods are called by LUT users to obtain a rendering of the LUT function.

virtual bool render (LUTDataBase *lutData) const
 Render LUT in (previously initialized) LUTData object.
virtual bool renderRescaled (LUTDataBase *lutData, double minIndex, double maxIndex) const
 Render rescaled LUT in (previously initialized) LUTData object.

Protected Member Functions

 ML_CLASS_HEADER (LUTFBlend)
LUT implementation
virtual LUTVisualType getRenderType (LUTDataBase *lutData) const
 Get visual type used for rendering.
virtual bool renderLUTNative (LUTDataBase *lutData, LUTIteratorBase *lutIterator) const
 Render the lookup table into lutData using lutIterator to access and increment the LUT pointers.
virtual bool renderLUTRescaled (LUTDataBase *lutData, LUTIteratorBase *lutIterator, double minIndex, double maxIndex) const
 Render rescaled LUT into lutData using lutIterator to access and increment the LUT pointers.
virtual bool renderLUT (LUTDataBase *lutData, LUTIteratorBase *lutIterator) const
 Perform LUT rendering, return true if successful.
virtual bool startRender (LUTDataBase *lutData, double minIndex, double maxIndex, bool rescaled) const
 Initialize LUT data objects for input LUTs for rendering, return true if successful.
virtual void clearLutData (void) const
 Clear LUT data objects after rendering.
template<typename T >
LUTData< T > * createInputLUTData (LUTData< T > *outLutData, int blendIndex, LUTFunction *lutFunction, double minIndex, double maxIndex, bool rescaled) const
 Allocate, initialize and render LUT data object for input LUT.
template<typename T >
void blendData (LUTData< T > *outLutData, double blendFactor, int inRow, int outRow, int outLayer) const
 Interpolate LUT data between input LUTs 1 and 2 at inRow, store result in outLutData at outRow, outLayer.
template<typename T >
void copyData (LUTData< T > *outLutData, LUTDataBase *inLutData, int inRow, int outRow, int outLayer) const
 Copy data from inLutData at inRow to outLutData at outRow, outLayer.

Protected Attributes

LUTFunction_inLUT1
 Input LUTs.
LUTFunction_inLUT2
int _numBlendingSteps
 Number of blending steps.
LUTDataBase_lutData1
 Rendered LUT data for original input LUTs, used at first and last blending steps.
LUTDataBase_lutData2
LUTDimensionality _dimensionality
 Output LUT dimensionality (1, 2, or 3)

Detailed Description

Generate a 2/3D-LUT by blending two 1/2D-LUTs.

Definition at line 30 of file mlLUTFBlend.h.


Constructor & Destructor Documentation

ml::LUTFBlend::LUTFBlend ( void  )

Constructor.


Member Function Documentation

template<typename T >
void ml::LUTFBlend::blendData ( LUTData< T > *  outLutData,
double  blendFactor,
int  inRow,
int  outRow,
int  outLayer 
) const [protected]

Interpolate LUT data between input LUTs 1 and 2 at inRow, store result in outLutData at outRow, outLayer.

virtual void ml::LUTFBlend::clearLutData ( void  ) const [protected, virtual]

Clear LUT data objects after rendering.

template<typename T >
void ml::LUTFBlend::copyData ( LUTData< T > *  outLutData,
LUTDataBase inLutData,
int  inRow,
int  outRow,
int  outLayer 
) const [protected]

Copy data from inLutData at inRow to outLutData at outRow, outLayer.

template<typename T >
LUTData<T>* ml::LUTFBlend::createInputLUTData ( LUTData< T > *  outLutData,
int  blendIndex,
LUTFunction lutFunction,
double  minIndex,
double  maxIndex,
bool  rescaled 
) const [protected]

Allocate, initialize and render LUT data object for input LUT.

virtual int ml::LUTFBlend::getBlendingSteps ( void  ) const [inline, virtual]

Get number of blending steps.

Definition at line 49 of file mlLUTFBlend.h.

virtual int ml::LUTFBlend::getDepth ( void  ) const [virtual]

Get native LUT depth (= number of layers, numbering starts at 0)

Reimplemented from ml::LUTFunction.

virtual LUTDimensionality ml::LUTFBlend::getDimensionality ( void  ) const [inline, virtual]

Get dimensionality (1, 2, or 3)

Reimplemented from ml::LUTFunction.

Definition at line 61 of file mlLUTFBlend.h.

virtual int ml::LUTFBlend::getHeight ( void  ) const [virtual]

Get native LUT height (= number of rows, numbering starts at 0)

Reimplemented from ml::LUTFunction.

virtual int ml::LUTFBlend::getNativeMaxIndex ( void  ) const [virtual]

Get native maximum index.

Reimplemented from ml::LUTFunction.

virtual double ml::LUTFBlend::getNativeMaxValue ( void  ) const [virtual]

Get native maximum LUT value.

Reimplemented from ml::LUTFunction.

virtual int ml::LUTFBlend::getNativeMinIndex ( void  ) const [virtual]

Get native minimum index.

Reimplemented from ml::LUTFunction.

virtual double ml::LUTFBlend::getNativeMinValue ( void  ) const [virtual]

Get native minimum LUT value.

Reimplemented from ml::LUTFunction.

virtual LUTVisualType ml::LUTFBlend::getRenderType ( LUTDataBase lutData) const [inline, protected, virtual]

Get visual type used for rendering.

This method is called by render() and renderRescaled() to initialize the LUT iterator object appropriate for a pair of source/target visual types. By returning the visual type of lutData, we always render directly in the visual type requested.

Reimplemented from ml::LUTFunction.

Definition at line 116 of file mlLUTFBlend.h.

References ml::LUTDataBase::getVisualType().

virtual bool ml::LUTFBlend::isValid ( void  ) const [virtual]

Return true if the LUT function is valid.

Reimplemented from ml::LUTFunction.

ml::LUTFBlend::ML_CLASS_HEADER ( LUTFBlend  ) [protected]
virtual bool ml::LUTFBlend::render ( LUTDataBase lutData) const [virtual]

Render LUT in (previously initialized) LUTData object.

Return true if successful.

Overloaded here to perform initialization and cleanup

Reimplemented from ml::LUTFunction.

virtual bool ml::LUTFBlend::renderLUT ( LUTDataBase lutData,
LUTIteratorBase lutIterator 
) const [protected, virtual]

Perform LUT rendering, return true if successful.

virtual bool ml::LUTFBlend::renderLUTNative ( LUTDataBase lutData,
LUTIteratorBase lutIterator 
) const [protected, virtual]

Render the lookup table into lutData using lutIterator to access and increment the LUT pointers.

Both lutData and lutIterator should be type-cast to a derived, type specific class pointer, according to lutData->getDataType(). Return true if successful.

Implements ml::LUTFunction.

virtual bool ml::LUTFBlend::renderLUTRescaled ( LUTDataBase lutData,
LUTIteratorBase lutIterator,
double  minIndex,
double  maxIndex 
) const [protected, virtual]

Render rescaled LUT into lutData using lutIterator to access and increment the LUT pointers.

Both lutData and lutIterator should be type-cast to a derived, type specific class pointer, according to lutData->getDataType(). The LUT is rendered for range minIndex .. maxIndex, but resampled to the index range specified in lutData. Return true if successful.

Reimplemented from ml::LUTFunction.

virtual bool ml::LUTFBlend::renderRescaled ( LUTDataBase lutData,
double  minIndex,
double  maxIndex 
) const [virtual]

Render rescaled LUT in (previously initialized) LUTData object.

LUT is rendered for range minIndex .. maxIndex, but resampled to the index range specified in lutData. Return true if successful

Overloaded here to perform initialization and cleanup

Reimplemented from ml::LUTFunction.

virtual void ml::LUTFBlend::setBlendingSteps ( int  numBlendingSteps) [virtual]

Set number of blending steps (= number of rows/layers in output 2/3D-LUT, min = 2)

virtual void ml::LUTFBlend::setInputLUTs ( LUTFunction inLUT1,
LUTFunction inLUT2 
) [virtual]

Set input LUTs, set relative flag to true if both input LUTs are relative.

virtual bool ml::LUTFBlend::startRender ( LUTDataBase lutData,
double  minIndex,
double  maxIndex,
bool  rescaled 
) const [protected, virtual]

Initialize LUT data objects for input LUTs for rendering, return true if successful.


Member Data Documentation

Output LUT dimensionality (1, 2, or 3)

Definition at line 169 of file mlLUTFBlend.h.

Input LUTs.

Definition at line 160 of file mlLUTFBlend.h.

Definition at line 160 of file mlLUTFBlend.h.

LUTDataBase* ml::LUTFBlend::_lutData1 [mutable, protected]

Rendered LUT data for original input LUTs, used at first and last blending steps.

Definition at line 166 of file mlLUTFBlend.h.

LUTDataBase * ml::LUTFBlend::_lutData2 [mutable, protected]

Definition at line 166 of file mlLUTFBlend.h.

Number of blending steps.

Definition at line 163 of file mlLUTFBlend.h.


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