Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions | Private Attributes
icl::filter::LUTOp Class Reference

class for applying table lookup transformation to Img8u images More...

#include <LUTOp.h>

Inheritance diagram for icl::filter::LUTOp:
icl::filter::UnaryOp icl::utils::Uncopyable icl::utils::Configurable

List of all members.

Public Member Functions

 LUTOp (const std::vector< icl8u > &lut)
 creates a LUT object with given lut (LUT-mode)
 LUTOp (icl8u quantizationLevels=255)
 creates a LUT object with given count of quatization levels (Levels-mode)
virtual ~LUTOp ()
 destructor
virtual void apply (const core::ImgBase *src, core::ImgBase **dst)
 Common Filter apply function using current mode.
void setLUT (const std::vector< icl8u > &lut)
 sets the current lut and switches to the lut-mode
void setQuantizationLevels (int levels)
 sets current count of quatization levels and switches to the levels-mode
icl8u getQuantizationLevels () const
 returns the current count of quatization levels or 0 if current mode is lut-mode
const std::vector< icl8u > & getLUT () const
 return the current used lut, of a 0-sized vector if current mode is levels-mode
bool isLUTSet () const
 retruns whether current mode is lut-mode
bool isLevelsSet () const
 retruns whether current mode is levels-mode

Static Public Member Functions

static void simple (const core::Img8u *src, core::Img8u *dst, const std::vector< icl8u > &lut)
 simple lut transformation dst(p) = lut(src(p))
static void reduceBits (const core::Img8u *src, core::Img8u *dst, icl8u levels)
 specialization of a lut transformation to reduce the number colors levels image a given image

Private Attributes

bool m_bLevelsSet
bool m_bLutSet
std::vector< icl8um_vecLUT
icl8u m_ucQuantizationLevels
core::Img8um_poBuffer

Detailed Description

class for applying table lookup transformation to Img8u images

Class

The class knows two modes: first: given count of quantization levels, it is able to calculate an internal lut for applying a quantization on the given src image. The other mode requires a given LUT, that is used to apply a LUT-function on the source image.

How to use the ImgBase class.

The mode, that is currently used depend on the specific constructor, that is used to create the LUT object, or on the last setter-function, that was called to the object. The current mode can be read out by calling the isLUTSet() or isLevelsSet() getter functions. These two functions return values exclude each others.

Datatypes

The LUT function is only implemented for Img8u images with range [0,255]. Other image depths are emulated by converting the given image into an internal Img8u buffer.

Static functions

For a fast access two additional static functions are provided - one for each mode. This functions are only available for depth8u images.

IPP

Yet, only the reduceBits function and therewith the according LUT-objects mode with given count of quantization levels is IPP optimized.


Constructor & Destructor Documentation

icl::filter::LUTOp::LUTOp ( const std::vector< icl8u > &  lut)

creates a LUT object with given lut (LUT-mode)

Parameters:
lutLUT-vector to use
icl::filter::LUTOp::LUTOp ( icl8u  quantizationLevels = 255)

creates a LUT object with given count of quatization levels (Levels-mode)

Parameters:
quantizationLevelscount of quanzation levels to use
virtual icl::filter::LUTOp::~LUTOp ( ) [inline, virtual]

destructor


Member Function Documentation

virtual void icl::filter::LUTOp::apply ( const core::ImgBase src,
core::ImgBase **  dst 
) [virtual]

Common Filter apply function using current mode.

Parameters:
srcsource image
dstdestination image**

Implements icl::filter::UnaryOp.

const std::vector<icl8u>& icl::filter::LUTOp::getLUT ( ) const

return the current used lut, of a 0-sized vector if current mode is levels-mode

returns the current count of quatization levels or 0 if current mode is lut-mode

retruns whether current mode is levels-mode

retruns whether current mode is lut-mode

static void icl::filter::LUTOp::reduceBits ( const core::Img8u src,
core::Img8u dst,
icl8u  levels 
) [static]

specialization of a lut transformation to reduce the number colors levels image a given image

Parameters:
srcsource image
dstdestination image
levelscount of quantization levels to use
void icl::filter::LUTOp::setLUT ( const std::vector< icl8u > &  lut)

sets the current lut and switches to the lut-mode

Parameters:
lutnew lut vector to use

sets current count of quatization levels and switches to the levels-mode

Parameters:
levelsnew count of quantization levels
static void icl::filter::LUTOp::simple ( const core::Img8u src,
core::Img8u dst,
const std::vector< icl8u > &  lut 
) [static]

simple lut transformation dst(p) = lut(src(p))

Parameters:
srcsource image
dstdestination image
lutlut-vector to used

Member Data Documentation

std::vector<icl8u> icl::filter::LUTOp::m_vecLUT [private]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines