Image Component Library (ICL)
Public Member Functions | Private Attributes | List of all members
icl::filter::LUT2D< RESULT_T, IDX_T > Class Template Reference

Simple 2D indexed LUT Implementation. More...

#include <LUT2D.h>

Public Member Functions

 LUT2D (RESULT_T(*generator_func)(IDX_T v1, IDX_T v2), IDX_T minVal, IDX_T maxVal)
 creating a new LUT2D object with given element creation function More...
 
 ~LUT2D ()
 destructor More...
 
RESULT_T operator() (IDX_T v1, IDX_T v2) const
 inline access in constant time of data element at (v1,v2) More...
 

Private Attributes

RESULT_T * lut
 
int minVal
 
int range
 

Detailed Description

template<class RESULT_T = float, class IDX_T = int>
class icl::filter::LUT2D< RESULT_T, IDX_T >

Simple 2D indexed LUT Implementation.

The LUT2D template class provides functionalities for aranging 2D index data in a linear array for best and constant access performance, whereby x and y indices are allowed to be in an abitrary integer range [minVal,maxVal].

Internally an array of size RANGEĀ² named "lut" is created. Date element Lookup can be calculated using the following formula ( $range := maxVal - minVal$):

\[ LUTIDX_{naiv}(x,y) = x-minVal + range \cdot (y-minVal) \]

To enhance access performace, the lut-pointer can be adapted as follows:

\[ lut -= (range+1)*minVal; \]

Now, data element lookup can be calculated much easier:

\[ LUTIDX_{optimized}(x,y) = x + range\cdot y \]

A simple ()-operator can be used to access lut elements.

Constructor & Destructor Documentation

◆ LUT2D()

template<class RESULT_T = float, class IDX_T = int>
icl::filter::LUT2D< RESULT_T, IDX_T >::LUT2D ( RESULT_T(*)(IDX_T v1, IDX_T v2)  generator_func,
IDX_T  minVal,
IDX_T  maxVal 
)
inline

creating a new LUT2D object with given element creation function

◆ ~LUT2D()

template<class RESULT_T = float, class IDX_T = int>
icl::filter::LUT2D< RESULT_T, IDX_T >::~LUT2D ( )
inline

destructor

Member Function Documentation

◆ operator()()

template<class RESULT_T = float, class IDX_T = int>
RESULT_T icl::filter::LUT2D< RESULT_T, IDX_T >::operator() ( IDX_T  v1,
IDX_T  v2 
) const
inline

inline access in constant time of data element at (v1,v2)

Member Data Documentation

◆ lut

template<class RESULT_T = float, class IDX_T = int>
RESULT_T* icl::filter::LUT2D< RESULT_T, IDX_T >::lut
private

◆ minVal

template<class RESULT_T = float, class IDX_T = int>
int icl::filter::LUT2D< RESULT_T, IDX_T >::minVal
private

◆ range

template<class RESULT_T = float, class IDX_T = int>
int icl::filter::LUT2D< RESULT_T, IDX_T >::range
private

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