ml::LUTFLinear Class Reference

A color/gray LUT with sampling points and linear, nearest neighbor or truncated interpolation inbetween. More...

#include <mlLUTFLinear.h>

Inheritance diagram for ml::LUTFLinear:

ml::LUTFunction ml::Base

List of all members.

Public Types

enum  ColorInterpolation {
  InterpolateRGB, InterpolateHLS, InterpolateHLSpos, InterpolateHLSneg,
  InterpolateConstant, numColorInterpolation
}
 Color interpolation constants. More...

Public Member Functions

 LUTFLinear (void)
 Constructor.
LUT parameters
virtual bool setPoints (const LUTRGBAPointList &points)
 Set table with sampling points, data is copied to internal storage.
const LUTRGBAPointListgetPoints () const
 Get sampling point table as a const reference.
LUTRGBAPointListgetModifiablePoints ()
 Get modifiable sampling point table.
void setVisualType (LUTVisualType visualType)
 Set the visual type of the table (this affects how the points in the list are handled).
int insertPoint (const LUTRGBAPoint &point)
 Insert a given point and return the resulting index in the sampling point table.
void removePoint (int idx)
 Remove the point at the given index.
const LUTRGBAPointgetPoint (int idx) const
 Get a point at given index.
void setPoint (int idx, const LUTRGBAPoint &point)
 Set a point at given index, does not check if position is correct!
virtual double getStartIndex (void) const
 Get start index.
virtual double getEndIndex (void) const
 Get end index.
virtual ColorInterpolation getColorInterpolation (void) const
 Get color interpolation mode.
virtual void setColorInterpolation (ColorInterpolation c)
 Set color interpolation mode.
void setAlphaFactor (float factor)
 Set the global alpha factor (default is 1.).
float getAlphaFactor () const
 Get the global alpha factor.
bool relativeUsesNativeRange () const
 Return true if the native index range (given by the first and last index position in the sampling point table) is used as the range for relative mapping, If set to false, [0,1] is used (default is false).
void setRelativeUsesNativeRange (bool flag)
 Specify whether the native index range (given by the first and last index position in the sampling point table) is used as the range for relative mapping, If set to false, [0,1] is used (default is false).
LUT properties
virtual bool isValid (void) const
 Return true if the LUT function is valid.
virtual int getNativeMinIndex (void) const
 Get native minimum index.
virtual int getNativeMaxIndex (void) const
 Get native maximum index.

Static Public Attributes

static const char * ColorInterpolationNames [numColorInterpolation]
 Color interpolation constant names.

Protected Member Functions

void copyPoint (int idx, double *array) const
 Copy the point at table index idx to the given array (ordered like in the LUTIterator).
 ML_CLASS_HEADER (LUTFLinear)
LUT implementation
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.
template<typename T >
bool renderLUT (LUTData< T > *lutData, LUTIterator< T > *lutIterator, double startIndex, double endIndex) const
 Render the LUT table between startIndex and endIndex into lutData using lutIterator to access and increment the LUT pointers.

Protected Attributes

LUTRGBAPointList _points
 LUT sampling point table.
float _alphaFactor
 Global alpha factor.
bool _relativeUsesNativeRange
 Flag specifying whether the native index range is used as the range for relative mapping, If set to false, [0,1] is used (default is false).
ColorInterpolation _colorInterpolation
 Color interpolation mode.


Detailed Description

A color/gray LUT with sampling points and linear, nearest neighbor or truncated interpolation inbetween.

Definition at line 114 of file mlLUTFLinear.h.


Member Enumeration Documentation

Color interpolation constants.

Enumerator:
InterpolateRGB  Interpolation in RGB space.
InterpolateHLS  Interpolation in HLS space, closest H direction.
InterpolateHLSpos  Interpolation in HLS space, positive H direction.
InterpolateHLSneg  Interpolation in HLS space, negative H direction.
InterpolateConstant  Interpolation by floor() truncation.
numColorInterpolation  Number of available constants.

Definition at line 119 of file mlLUTFLinear.h.


Constructor & Destructor Documentation

ml::LUTFLinear::LUTFLinear ( void   ) 

Constructor.


Member Function Documentation

void ml::LUTFLinear::copyPoint ( int  idx,
double *  array 
) const [protected]

Copy the point at table index idx to the given array (ordered like in the LUTIterator).

float ml::LUTFLinear::getAlphaFactor (  )  const [inline]

Get the global alpha factor.

Definition at line 185 of file mlLUTFLinear.h.

virtual ColorInterpolation ml::LUTFLinear::getColorInterpolation ( void   )  const [inline, virtual]

Get color interpolation mode.

Definition at line 173 of file mlLUTFLinear.h.

virtual double ml::LUTFLinear::getEndIndex ( void   )  const [virtual]

Get end index.

LUTRGBAPointList& ml::LUTFLinear::getModifiablePoints (  )  [inline]

Get modifiable sampling point table.

Make sure that you keep the order of the points and that you call changed() after each change to the table.

Definition at line 149 of file mlLUTFLinear.h.

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

Get native maximum index.

Reimplemented from ml::LUTFunction.

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

Get native minimum index.

Reimplemented from ml::LUTFunction.

const LUTRGBAPoint& ml::LUTFLinear::getPoint ( int  idx  )  const

Get a point at given index.

const LUTRGBAPointList& ml::LUTFLinear::getPoints (  )  const [inline]

Get sampling point table as a const reference.

Definition at line 145 of file mlLUTFLinear.h.

virtual double ml::LUTFLinear::getStartIndex ( void   )  const [virtual]

Get start index.

int ml::LUTFLinear::insertPoint ( const LUTRGBAPoint point  ) 

Insert a given point and return the resulting index in the sampling point table.

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

Return true if the LUT function is valid.

Reimplemented from ml::LUTFunction.

ml::LUTFLinear::ML_CLASS_HEADER ( LUTFLinear   )  [protected]

bool ml::LUTFLinear::relativeUsesNativeRange (  )  const [inline]

Return true if the native index range (given by the first and last index position in the sampling point table) is used as the range for relative mapping, If set to false, [0,1] is used (default is false).

Definition at line 191 of file mlLUTFLinear.h.

void ml::LUTFLinear::removePoint ( int  idx  ) 

Remove the point at the given index.

template<typename T >
bool ml::LUTFLinear::renderLUT ( LUTData< T > *  lutData,
LUTIterator< T > *  lutIterator,
double  startIndex,
double  endIndex 
) const [inline, protected]

Render the LUT table between startIndex and endIndex into lutData using lutIterator to access and increment the LUT pointers.

Return true if successful.

virtual bool ml::LUTFLinear::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::LUTFLinear::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.

void ml::LUTFLinear::setAlphaFactor ( float  factor  )  [inline]

Set the global alpha factor (default is 1.).

Definition at line 179 of file mlLUTFLinear.h.

References ml::LUTFunction::changed().

virtual void ml::LUTFLinear::setColorInterpolation ( ColorInterpolation  c  )  [inline, virtual]

Set color interpolation mode.

Definition at line 176 of file mlLUTFLinear.h.

References ml::LUTFunction::changed().

void ml::LUTFLinear::setPoint ( int  idx,
const LUTRGBAPoint point 
)

Set a point at given index, does not check if position is correct!

virtual bool ml::LUTFLinear::setPoints ( const LUTRGBAPointList points  )  [virtual]

Set table with sampling points, data is copied to internal storage.

Returns true if successful.

void ml::LUTFLinear::setRelativeUsesNativeRange ( bool  flag  )  [inline]

Specify whether the native index range (given by the first and last index position in the sampling point table) is used as the range for relative mapping, If set to false, [0,1] is used (default is false).

Definition at line 195 of file mlLUTFLinear.h.

void ml::LUTFLinear::setVisualType ( LUTVisualType  visualType  )  [inline]

Set the visual type of the table (this affects how the points in the list are handled).

Definition at line 152 of file mlLUTFLinear.h.

References ml::LUTFunction::changed().


Member Data Documentation

float ml::LUTFLinear::_alphaFactor [protected]

Global alpha factor.

Definition at line 253 of file mlLUTFLinear.h.

Color interpolation mode.

Definition at line 260 of file mlLUTFLinear.h.

LUT sampling point table.

Definition at line 250 of file mlLUTFLinear.h.

Flag specifying whether the native index range is used as the range for relative mapping, If set to false, [0,1] is used (default is false).

Definition at line 257 of file mlLUTFLinear.h.

const char* ml::LUTFLinear::ColorInterpolationNames[numColorInterpolation] [static]

Color interpolation constant names.

Definition at line 130 of file mlLUTFLinear.h.


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

Generated on Sat Sep 3 18:39:38 2011 for MeVisLab Toolbox Reference by  doxygen 1.5.8