Image Component Library (ICL)
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
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

Public Member Functions

 LUTOp (const std::vector< icl8u > &lut)
 creates a LUT object with given lut (LUT-mode) More...
 
 LUTOp (icl8u quantizationLevels=255)
 creates a LUT object with given count of quatization levels (Levels-mode) More...
 
virtual ~LUTOp ()
 destructor More...
 
virtual void apply (const core::ImgBase *src, core::ImgBase **dst)
 Common Filter apply function using current mode. More...
 
void setLUT (const std::vector< icl8u > &lut)
 sets the current lut and switches to the lut-mode More...
 
void setQuantizationLevels (int levels)
 sets current count of quatization levels and switches to the levels-mode More...
 
icl8u getQuantizationLevels () const
 returns the current count of quatization levels or 0 if current mode is lut-mode More...
 
const std::vector< icl8u > & getLUT () const
 return the current used lut, of a 0-sized vector if current mode is levels-mode More...
 
bool isLUTSet () const
 retruns whether current mode is lut-mode More...
 
bool isLevelsSet () const
 retruns whether current mode is levels-mode More...
 
virtual void apply (const core::ImgBase *operand1, core::ImgBase **dst)=0
 Import unaryOps apply function without destination image. More...
 
virtual const core::ImgBaseapply (const core::ImgBase *src)
 Import unaryOps apply function without destination image. More...
 
- Public Member Functions inherited from icl::filter::UnaryOp
 UnaryOp ()
 Explicit empty constructor. More...
 
 UnaryOp (const UnaryOp &other)
 Explicit copy constructor. More...
 
UnaryOpoperator= (const UnaryOp &other)
 Explicit declaration of the assignment operator. More...
 
virtual ~UnaryOp ()
 Destructor. More...
 
virtual ICL_DEPRECATED void applyMT (const core::ImgBase *operand1, core::ImgBase **dst, unsigned int nThreads)
 apply function for multithreaded filtering (currently even slower than using one thread) More...
 
virtual const core::ImgBaseapply (const core::ImgBase *src)
 applys the filter usign an internal buffer as output image More...
 
void operator() (const core::ImgBase *src, core::ImgBase **dst)
 function operator (alternative for apply(src,dst) More...
 
const core::ImgBaseoperator() (const core::ImgBase *src)
 function operator for the implicit destination apply(src) call More...
 
const core::ImgBaseoperator() (const core::ImgBase &src)
 reference based function operator More...
 
void setClipToROI (bool bClipToROI)
 sets if the image should be clip to ROI or not More...
 
void setCheckOnly (bool bCheckOnly)
 sets if the destination image should be adapted to the source, or if it is only checked if it can be adapted. More...
 
bool getClipToROI () const
 returns the ClipToROI status More...
 
bool getCheckOnly () const
 returns the CheckOnly status More...
 
virtual void setPropertyValue (const std::string &propertyName, const utils::Any &value)
 sets value of a property (always call call_callbacks(propertyName) or Configurable::setPropertyValue) More...
 
- Public Member Functions inherited from icl::utils::Configurable
virtual ~Configurable ()
 virtual destructor More...
 
 Configurable (const Configurable &other)
 Copy constructor. More...
 
Configurableoperator= (const Configurable &other)
 Assignment operator. More...
 
void setConfigurableID (const std::string &ID)
 sets the ID of this configurable More...
 
const std::string & getConfigurableID () const
 returns the configurables static ID More...
 
bool isOrderedFlagSet () const
 returns whether the ordered flag is set More...
 
void deactivateProperty (const std::string &pattern)
 adds an additional deativation pattern More...
 
void deleteDeactivationPattern (const std::string &pattern)
 removed a formerly added deactivation pattern More...
 
std::vector< std::string > getPropertyListWithoutDeactivated () const
 this returns a filtered list of properties (using all filters added by deactivateProperty) More...
 
virtual void adaptProperty (const std::string &name, const std::string &newType, const std::string &newInfo, const std::string &newToolTip)
 this function can be used to adapt a specific property afterwards More...
 
void registerCallback (const Callback &cb)
 add a callback for changed properties More...
 
void removedCallback (const Callback &cb)
 removes a callback that was registered before More...
 
void syncChangesTo (Configurable *others, int num=1)
 this can be used to let this instance also apply property changes to others More...
 
virtual std::vector< std::string > getPropertyList () const
 returns a list of All properties, that can be set using setProperty More...
 
virtual bool supportsProperty (const std::string &propertyName) const
 base implementation for property check (seaches in the property list) More...
 
virtual void saveProperties (const std::string &filename, const std::vector< std::string > &propertiesToSkip=EMPTY_VEC) const
 writes all available properties into a file More...
 
virtual void loadProperties (const std::string &filename, const std::vector< std::string > &propertiesToSkip=EMPTY_VEC)
 reads a camera config file from disc More...
 
virtual std::string getPropertyType (const std::string &propertyName) const
 get type of property More...
 
virtual std::string getPropertyInfo (const std::string &propertyName) const
 get information of a properties valid values More...
 
virtual Any getPropertyValue (const std::string &propertyName) const
 returns the current value of a property or a parameter More...
 
virtual std::string getPropertyToolTip (const std::string &propertyName) const
 returns the tooltip description for a given property More...
 
virtual int getPropertyVolatileness (const std::string &propertyName) const
 Returns whether this property may be changed internally. More...
 

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)) More...
 
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 More...
 
- Static Public Member Functions inherited from icl::filter::UnaryOp
static UnaryOpfromString (const std::string &definition)
 Creates a UnaryOp instance from given string definition. More...
 
static std::string getFromStringSyntax (const std::string &opSpecifier)
 gives a string syntax description for given opSpecifier More...
 
static std::vector< std::string > listFromStringOps ()
 returns a list of all supported OP_SPEC values for the fromString function More...
 
static void applyFromString (const std::string &definition, const core::ImgBase *src, core::ImgBase **dst)
 creates, applies and releases a UnaryOp defined by given definition string More...
 
- Static Public Member Functions inherited from icl::utils::Configurable
static std::string create_default_ID (const std::string &prefix)
 this function can be used in subclasses to create a default ID More...
 
static Configurableget (const std::string &id)
 returns configurable by given ID More...
 
static void register_configurable_type (const std::string &classname, Function< Configurable * > creator)
 registers a configurable type More...
 
static std::vector< std::string > get_registered_configurables ()
 returns a list of all registered configurable classnames More...
 
static Configurablecreate_configurable (const std::string &classname)
 creates a configurable by given name More...
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from icl::utils::Configurable
typedef Function< void, const Property & > Callback
 Function type for changed properties. More...
 
- Static Public Attributes inherited from icl::utils::Configurable
static const std::vector< std::string > EMPTY_VEC
 used as shortcut – just an empty vector of std::strings More...
 
- Protected Member Functions inherited from icl::filter::UnaryOp
bool prepare (core::ImgBase **ppoDst, core::depth eDepth, const utils::Size &imgSize, core::format eFormat, int nChannels, const utils::Rect &roi, utils::Time timestamp=utils::Time::null)
 
virtual bool prepare (core::ImgBase **ppoDst, const core::ImgBase *poSrc)
 check+adapt destination image to properties of given source image More...
 
virtual bool prepare (core::ImgBase **ppoDst, const core::ImgBase *poSrc, core::depth eDepth)
 
- Protected Member Functions inherited from icl::utils::Configurable
void addProperty (const std::string &name, const std::string &type, const std::string &info, const Any &value=Any(), const int volatileness=0, const std::string &tooltip=std::string())
 This can be used by derived classes to store supported properties in the internal list. More...
 
void addChildConfigurable (Configurable *configurable, const std::string &childPrefix="")
 This adds another configurable as child. More...
 
void removeChildConfigurable (Configurable *configurable)
 removes the given child configurable More...
 
Propertyprop (const std::string &propertyName)
 this CAN be used e.g. to store a property value in internal property-list More...
 
const Propertyprop (const std::string &propertyName) const
 this CAN be used e.g. to store a property value in internal property-list More...
 
 Configurable (const std::string &ID="", bool ordered=true)
 create this configurable with given ID More...
 
void call_callbacks (const std::string &propertyName, const Configurable *caller) const
 calls all registered callbacks More...
 
- Protected Member Functions inherited from icl::utils::Uncopyable
 Uncopyable ()
 Empty base constructor. More...
 
- Protected Attributes inherited from icl::filter::UnaryOp
utils::MultiThreaderm_poMT
 
- Protected Attributes inherited from icl::utils::Configurable
std::vector< Callbackcallbacks
 internally managed list of callbacks More...
 

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

◆ LUTOp() [1/2]

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

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

Parameters
lutLUT-vector to use

◆ LUTOp() [2/2]

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

◆ ~LUTOp()

virtual icl::filter::LUTOp::~LUTOp ( )
inlinevirtual

destructor

Member Function Documentation

◆ apply() [1/3]

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.

◆ apply() [2/3]

virtual void icl::filter::UnaryOp::apply

Import unaryOps apply function without destination image.

◆ apply() [3/3]

virtual const core::ImgBase* icl::filter::UnaryOp::apply

Import unaryOps apply function without destination image.

◆ getLUT()

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

◆ getQuantizationLevels()

icl8u icl::filter::LUTOp::getQuantizationLevels ( ) const

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

◆ isLevelsSet()

bool icl::filter::LUTOp::isLevelsSet ( ) const

retruns whether current mode is levels-mode

◆ isLUTSet()

bool icl::filter::LUTOp::isLUTSet ( ) const

retruns whether current mode is lut-mode

◆ reduceBits()

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

◆ setLUT()

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

◆ setQuantizationLevels()

void icl::filter::LUTOp::setQuantizationLevels ( int  levels)

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

Parameters
levelsnew count of quantization levels

◆ simple()

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

◆ m_bLevelsSet

bool icl::filter::LUTOp::m_bLevelsSet
private

◆ m_bLutSet

bool icl::filter::LUTOp::m_bLutSet
private

◆ m_poBuffer

core::Img8u* icl::filter::LUTOp::m_poBuffer
private

◆ m_ucQuantizationLevels

icl8u icl::filter::LUTOp::m_ucQuantizationLevels
private

◆ m_vecLUT

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

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