MeVisLab Toolbox Reference
ml::LUTFRampPair Class Reference

An RGBA LUT consisting of a RGB ramp and an alpha ramp. More...

#include <mlLUTFRampPair.h>

Inheritance diagram for ml::LUTFRampPair:
ml::LUTFunction ml::Base

Public Member Functions

 LUTFRampPair (void)
 Constructor. More...
 
LUT parameters
void setRelative (bool relative) override
 Set/reset relative flag. More...
 
virtual double getRGBCenter (void) const
 Get RGB ramp center. More...
 
virtual void setRGBCenter (double center)
 Set RGB ramp center. More...
 
virtual double getRGBWidth (void) const
 Get RGB ramp width. More...
 
virtual void setRGBWidth (double width)
 Set RGB ramp width. More...
 
virtual void getRGBStart (double *r, double *g, double *b) const
 Store start color RGB in r, g, b (if not null) More...
 
virtual void setRGBStart (double r, double g, double b)
 Set start color RGB. More...
 
virtual void getRGBEnd (double *r, double *g, double *b) const
 Store end color RGB in r, g, b (if not null) More...
 
virtual void setRGBEnd (double r, double g, double b)
 Set end color RGB. More...
 
virtual double getAlphaCenter (void) const
 Get alpha ramp center. More...
 
virtual void setAlphaCenter (double center)
 Set alpha ramp center. More...
 
virtual double getAlphaWidth (void) const
 Get alpha ramp width. More...
 
virtual void setAlphaWidth (double width)
 Set alpha ramp width. More...
 
virtual double getAlphaStart (void) const
 Get alpha start value. More...
 
virtual void setAlphaStart (double a)
 Set alpha start value. More...
 
virtual double getAlphaEnd (void) const
 Get alpha end value. More...
 
virtual void setAlphaEnd (double a)
 Set alpha end value. More...
 
LUT properties
double getNativeMinIndex (void) const override
 Get native minimum index. More...
 
double getNativeMaxIndex (void) const override
 Get native maximum index. More...
 
- Public Member Functions inherited from ml::LUTFunction
 LUTFunction (LUTVisualType vt, bool relative)
 Constructor. More...
 
void changed (void)
 Assign a new LUT ID. More...
 
void overwriteUniqueId (unsigned int newId)
 Overwrites the unique id. NOTE: use this only if you really know what you are doing! More...
 
virtual bool isValid (void) const
 Return true if the LUT function is valid. An invalid LUT function can not be rendered. More...
 
virtual LUTVisualType getVisualType (void) const
 Get LUT visual type. More...
 
virtual bool isRelative (void) const
 Is LUT relative? More...
 
virtual LUTDimensionality getDimensionality (void) const
 Get dimensionality (1, 2, or 3), usually depending on height and depth. More...
 
virtual int getHeight (void) const
 Get native LUT height (= number of rows, numbering starts at 0) More...
 
virtual int getDepth (void) const
 Get native LUT depth (= number of layers, numbering starts at 0) More...
 
virtual double getNativeMinValue (void) const
 Get native minimum LUT value. More...
 
virtual double getNativeMaxValue (void) const
 Get native maximum LUT value. More...
 
unsigned int getId (void) const
 Get current LUT ID. More...
 
virtual bool render (LUTDataBase *lutData) const
 Render LUT in (previously initialized) LUTData object. More...
 
virtual bool renderRescaled (LUTDataBase *lutData, double minIndex, double maxIndex) const
 Render rescaled LUT in (previously initialized) LUTData object. More...
 
- Public Member Functions inherited from ml::Base
 Base ()
 Constructor. More...
 
virtual ~Base ()
 Destructor. More...
 
virtual BasedeepCopy () const
 Set addStateToTree version number that can be accessed via getAddStateVersion() More...
 
bool isOfAllowedType (const std::vector< const RuntimeType * > &types) const
 Check if this object's type is equal to or derived from one of the types given in the argument. More...
 
virtual bool isRefCountedBase () const
 Returns if the instance is derived from RefCountedBase. More...
 
virtual std::string detailString () const
 Return a string describing this object. More...
 
virtual bool implementsPersistence (PersistenceInterface) const
 Override this method to declare which persistence interfaces are implemented by your derived class. More...
 
virtual std::string persistentState () const
 Returns a string describing the object's internal state. More...
 
virtual void setPersistentState (const std::string &state)
 Restores the object's internal state from a string that had been previously generated using persistentState(). More...
 
virtual void addStateToTree (TreeNode *) const
 Attaches the object state as children of the given parent node. More...
 
virtual void readStateFromTree (TreeNode *)
 Reads the object state from the children of the given parent node. More...
 
virtual void writeTo (AbstractPersistenceOutputStream *) const
 Write the objects state to the data stream object. More...
 
virtual void readFrom (AbstractPersistenceInputStream *, int)
 Read the objects state from the data stream object. More...
 

Protected Member Functions

 ML_CLASS_HEADER (LUTFRampPair)
 
LUT implementation
bool renderLUTNative (LUTDataBase *lutData, LUTIteratorBase *lutIterator) const override
 Render the lookup table into lutData using lutIterator to access and increment the LUT pointers. More...
 
bool renderLUTRescaled (LUTDataBase *lutData, LUTIteratorBase *lutIterator, double minIndex, double maxIndex) const override
 Render rescaled LUT into lutData using lutIterator to access and increment the LUT pointers. More...
 
virtual LUTDataBasecreateLUT (LUTDataBase *lutData) const
 Create single-channel LUT with same index and entry range as lutData. More...
 
template<typename T >
bool copyLUT (LUTData< T > *lutData, LUTIterator< T > *lutIterator, const LUTData< double > *rgbLut, const LUTData< T > *alphaLut) const
 Copy the single-channel LUTs rgbLut and alphaLut into lutData, applying RGB start and end color to the RGB channels and using lutIterator to access and increment the LUT pointers. More...
 
- Protected Member Functions inherited from ml::LUTFunction
template<typename T >
bool renderT (LUTData< T > *lutData, bool rescaled, double minIndex, double maxIndex) const
 Perform type-specific, native or rescaled (rescaled = true, rescale to range minIndex ... More...
 
template<typename T >
bool interpolateLUT (LUTData< T > *lutData, LUTIterator< T > *lutIterator, double minIndex, double maxIndex) const
 Perform type-specific rescaled LUT rendering by. More...
 
 ML_ABSTRACT_CLASS_HEADER (LUTFunction)
 
virtual LUTVisualType getRenderType (LUTDataBase *) const
 Get visual type used for rendering. More...
 
- Protected Member Functions inherited from ml::Base
virtual char * getPersistentState () const
 Returns a C string describing the object's internal state. More...
 
virtual void setPersistentState (const char *)
 Restores the object's internal state from a string that had been previously generated using getPersistentState(). More...
 
virtual void clearPersistentState (char *) const
 Disposes a string previously allocated by getPersistentState(). More...
 

Protected Attributes

LUTFPrimitive _rgbRamp
 RGB ramp LUT function. More...
 
LUTFPrimitive _alphaRamp
 Alpha ramp LUT function. More...
 
double _rgbStart [3]
 Start and end RGB. More...
 
double _rgbEnd [3]
 
- Protected Attributes inherited from ml::LUTFunction
LUTVisualType _visualType
 LUT visual type. More...
 
bool _relative
 Flag for relative LUT. More...
 
unsigned int _id
 Unique LUT ID, changed by the changed() method whenever a property of the LUT function object is modified. More...
 

Additional Inherited Members

- Public Types inherited from ml::Base
enum  PersistenceInterface { PersistenceByString , PersistenceByTreeNode , PersistenceByStream }
 This enum describes the different persistence interfaces available. More...
 
- Static Public Member Functions inherited from ml::LUTFunction
static unsigned int generateUniqueId (void)
 Generate a unique id (unique for all mlLUTFunctions), this can also be called to get a unique id for a LUTData object manually. More...
 
- Static Protected Attributes inherited from ml::LUTFunction
static unsigned int _gNextId
 Global storage for next unused LUT ID to ensure uniqueness. More...
 

Detailed Description

An RGBA LUT consisting of a RGB ramp and an alpha ramp.

Definition at line 29 of file mlLUTFRampPair.h.

Constructor & Destructor Documentation

◆ LUTFRampPair()

ml::LUTFRampPair::LUTFRampPair ( void  )

Constructor.

Member Function Documentation

◆ copyLUT()

template<typename T >
bool ml::LUTFRampPair::copyLUT ( LUTData< T > *  lutData,
LUTIterator< T > *  lutIterator,
const LUTData< double > *  rgbLut,
const LUTData< T > *  alphaLut 
) const
protected

Copy the single-channel LUTs rgbLut and alphaLut into lutData, applying RGB start and end color to the RGB channels and using lutIterator to access and increment the LUT pointers.

Return true if successful.

◆ createLUT()

virtual LUTDataBase* ml::LUTFRampPair::createLUT ( LUTDataBase lutData) const
protectedvirtual

Create single-channel LUT with same index and entry range as lutData.

◆ getAlphaCenter()

virtual double ml::LUTFRampPair::getAlphaCenter ( void  ) const
inlinevirtual

Get alpha ramp center.

Definition at line 68 of file mlLUTFRampPair.h.

◆ getAlphaEnd()

virtual double ml::LUTFRampPair::getAlphaEnd ( void  ) const
inlinevirtual

Get alpha end value.

Definition at line 86 of file mlLUTFRampPair.h.

◆ getAlphaStart()

virtual double ml::LUTFRampPair::getAlphaStart ( void  ) const
inlinevirtual

Get alpha start value.

Definition at line 80 of file mlLUTFRampPair.h.

◆ getAlphaWidth()

virtual double ml::LUTFRampPair::getAlphaWidth ( void  ) const
inlinevirtual

Get alpha ramp width.

Definition at line 74 of file mlLUTFRampPair.h.

◆ getNativeMaxIndex()

double ml::LUTFRampPair::getNativeMaxIndex ( void  ) const
overridevirtual

Get native maximum index.

Reimplemented from ml::LUTFunction.

◆ getNativeMinIndex()

double ml::LUTFRampPair::getNativeMinIndex ( void  ) const
overridevirtual

Get native minimum index.

Reimplemented from ml::LUTFunction.

◆ getRGBCenter()

virtual double ml::LUTFRampPair::getRGBCenter ( void  ) const
inlinevirtual

Get RGB ramp center.

Definition at line 44 of file mlLUTFRampPair.h.

◆ getRGBEnd()

virtual void ml::LUTFRampPair::getRGBEnd ( double *  r,
double *  g,
double *  b 
) const
virtual

Store end color RGB in r, g, b (if not null)

◆ getRGBStart()

virtual void ml::LUTFRampPair::getRGBStart ( double *  r,
double *  g,
double *  b 
) const
virtual

Store start color RGB in r, g, b (if not null)

◆ getRGBWidth()

virtual double ml::LUTFRampPair::getRGBWidth ( void  ) const
inlinevirtual

Get RGB ramp width.

Definition at line 50 of file mlLUTFRampPair.h.

◆ ML_CLASS_HEADER()

ml::LUTFRampPair::ML_CLASS_HEADER ( LUTFRampPair  )
protected

◆ renderLUTNative()

bool ml::LUTFRampPair::renderLUTNative ( LUTDataBase lutData,
LUTIteratorBase lutIterator 
) const
overrideprotectedvirtual

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.

◆ renderLUTRescaled()

bool ml::LUTFRampPair::renderLUTRescaled ( LUTDataBase lutData,
LUTIteratorBase lutIterator,
double  minIndex,
double  maxIndex 
) const
overrideprotectedvirtual

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.

◆ setAlphaCenter()

virtual void ml::LUTFRampPair::setAlphaCenter ( double  center)
inlinevirtual

Set alpha ramp center.

Definition at line 71 of file mlLUTFRampPair.h.

References ml::LUTFunction::changed().

◆ setAlphaEnd()

virtual void ml::LUTFRampPair::setAlphaEnd ( double  a)
inlinevirtual

Set alpha end value.

Definition at line 89 of file mlLUTFRampPair.h.

References ml::LUTFunction::changed().

◆ setAlphaStart()

virtual void ml::LUTFRampPair::setAlphaStart ( double  a)
inlinevirtual

Set alpha start value.

Definition at line 83 of file mlLUTFRampPair.h.

References ml::LUTFunction::changed().

◆ setAlphaWidth()

virtual void ml::LUTFRampPair::setAlphaWidth ( double  width)
inlinevirtual

Set alpha ramp width.

Definition at line 77 of file mlLUTFRampPair.h.

References ml::LUTFunction::changed().

◆ setRelative()

void ml::LUTFRampPair::setRelative ( bool  relative)
overridevirtual

Set/reset relative flag.

Reimplemented from ml::LUTFunction.

◆ setRGBCenter()

virtual void ml::LUTFRampPair::setRGBCenter ( double  center)
inlinevirtual

Set RGB ramp center.

Definition at line 47 of file mlLUTFRampPair.h.

References ml::LUTFunction::changed().

◆ setRGBEnd()

virtual void ml::LUTFRampPair::setRGBEnd ( double  r,
double  g,
double  b 
)
virtual

Set end color RGB.

◆ setRGBStart()

virtual void ml::LUTFRampPair::setRGBStart ( double  r,
double  g,
double  b 
)
virtual

Set start color RGB.

◆ setRGBWidth()

virtual void ml::LUTFRampPair::setRGBWidth ( double  width)
inlinevirtual

Set RGB ramp width.

Definition at line 53 of file mlLUTFRampPair.h.

References ml::LUTFunction::changed().

Member Data Documentation

◆ _alphaRamp

LUTFPrimitive ml::LUTFRampPair::_alphaRamp
protected

Alpha ramp LUT function.

Definition at line 144 of file mlLUTFRampPair.h.

◆ _rgbEnd

double ml::LUTFRampPair::_rgbEnd[3]
protected

Definition at line 147 of file mlLUTFRampPair.h.

◆ _rgbRamp

LUTFPrimitive ml::LUTFRampPair::_rgbRamp
protected

RGB ramp LUT function.

Definition at line 141 of file mlLUTFRampPair.h.

◆ _rgbStart

double ml::LUTFRampPair::_rgbStart[3]
protected

Start and end RGB.

Definition at line 147 of file mlLUTFRampPair.h.


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