Image Component Library (ICL)
|
class for applying table lookup transformation to Img8u images More...
#include <LUTOp.h>
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< icl8u > | m_vecLUT |
icl8u | m_ucQuantizationLevels |
core::Img8u * | m_poBuffer |
class for applying table lookup transformation to Img8u images
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.
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.
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.
For a fast access two additional static functions are provided - one for each mode. This functions are only available for depth8u images.
Yet, only the reduceBits function and therewith the according LUT-objects mode with given count of quantization levels is IPP optimized.
icl::filter::LUTOp::LUTOp | ( | const std::vector< icl8u > & | lut | ) |
creates a LUT object with given lut (LUT-mode)
lut | LUT-vector to use |
icl::filter::LUTOp::LUTOp | ( | icl8u | quantizationLevels = 255 | ) |
creates a LUT object with given count of quatization levels (Levels-mode)
quantizationLevels | count of quanzation levels to use |
virtual icl::filter::LUTOp::~LUTOp | ( | ) | [inline, virtual] |
destructor
virtual void icl::filter::LUTOp::apply | ( | const core::ImgBase * | src, |
core::ImgBase ** | dst | ||
) | [virtual] |
Common Filter apply function using current mode.
src | source image |
dst | destination 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
bool icl::filter::LUTOp::isLevelsSet | ( | ) | const |
retruns whether current mode is levels-mode
bool icl::filter::LUTOp::isLUTSet | ( | ) | const |
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
src | source image |
dst | destination image |
levels | count 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
lut | new lut vector to use |
void icl::filter::LUTOp::setQuantizationLevels | ( | int | levels | ) |
sets current count of quatization levels and switches to the levels-mode
levels | new 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))
src | source image |
dst | destination image |
lut | lut-vector to used |
bool icl::filter::LUTOp::m_bLevelsSet [private] |
bool icl::filter::LUTOp::m_bLutSet [private] |
core::Img8u* icl::filter::LUTOp::m_poBuffer [private] |
std::vector<icl8u> icl::filter::LUTOp::m_vecLUT [private] |