Image Component Library (ICL)
|
Class for comparing operations. More...
#include <UnaryCompareOp.h>
Public Types | |
enum | optype { lt = ippCmpLess, lteq = ippCmpLessEq, eq = ippCmpEq, gteq = ippCmpGreaterEq, gt = ippCmpGreater, eqt } |
this enum specifiy all possible compare operations More... | |
Public Member Functions | |
UnaryCompareOp (optype ot=gt, icl64f value=128, icl64f tolerance=0) | |
Creates a new UnaryCompareOp object with given optype, value and tolerance level. | |
UnaryCompareOp (const std::string &op, icl64f value=128, icl64f tolerance=0) | |
creates a new UnaryCompareOp instance with given parameters | |
virtual | ~UnaryCompareOp () |
Destructor. | |
void | setOpType (optype ot) |
sets the current optype | |
void | setValue (icl64f value) |
sets the current compare value | |
void | setTollerance (icl64f tolerance) |
sets the current tolerance level | |
optype | getOpType () const |
returns the current optype | |
icl64f | getValue () const |
returns the current compare-value | |
icl64f | getTolerance () const |
returns the current tolerance level | |
virtual void | apply (const core::ImgBase *poSrc, core::ImgBase **ppoDst) |
applies the operation to a source image | |
Static Public Member Functions | |
static optype | translate_op_type (const std::string &stringVersion) throw (utils::ICLException) |
translate a given relation into an optype | |
Private Attributes | |
optype | m_eOpType |
internal storage of the current optype | |
icl64f | m_dValue |
internal storage of the current value | |
icl64f | m_dTolerance |
internal storage of the current tolerance level |
Class for comparing operations.
This class Compares each pixelvalue of an image with a constant value using a specified compare operation. The result is written to a binarized image of type Img8u. If the result of the comparison is true, the corresponding output pixel is set to 255; otherwise, it is set to 0.
icl::filter::UnaryCompareOp::UnaryCompareOp | ( | optype | ot = gt , |
icl64f | value = 128 , |
||
icl64f | tolerance = 0 |
||
) | [inline] |
Creates a new UnaryCompareOp object with given optype, value and tolerance level.
ot | operation type ("<","<=",...) |
value | value to compare each pixel with |
tolerance | tolerance level (only of optype==eqt) |
icl::filter::UnaryCompareOp::UnaryCompareOp | ( | const std::string & | op, |
icl64f | value = 128 , |
||
icl64f | tolerance = 0 |
||
) | [inline] |
creates a new UnaryCompareOp instance with given parameters
The optype parameters is here given as a string
virtual icl::filter::UnaryCompareOp::~UnaryCompareOp | ( | ) | [inline, virtual] |
Destructor.
virtual void icl::filter::UnaryCompareOp::apply | ( | const core::ImgBase * | poSrc, |
core::ImgBase ** | ppoDst | ||
) | [virtual] |
applies the operation to a source image
poSrc | source image |
ppoDst | destination image |
Implements icl::filter::UnaryOp.
optype icl::filter::UnaryCompareOp::getOpType | ( | ) | const [inline] |
returns the current optype
icl64f icl::filter::UnaryCompareOp::getTolerance | ( | ) | const [inline] |
returns the current tolerance level
icl64f icl::filter::UnaryCompareOp::getValue | ( | ) | const [inline] |
returns the current compare-value
void icl::filter::UnaryCompareOp::setOpType | ( | optype | ot | ) | [inline] |
sets the current optype
ot | new optype value |
void icl::filter::UnaryCompareOp::setTollerance | ( | icl64f | tolerance | ) | [inline] |
sets the current tolerance level
tolerance | new tolerance level |
void icl::filter::UnaryCompareOp::setValue | ( | icl64f | value | ) | [inline] |
sets the current compare value
value | new compare value |
static optype icl::filter::UnaryCompareOp::translate_op_type | ( | const std::string & | stringVersion | ) | throw (utils::ICLException) [inline, static] |
translate a given relation into an optype
satisfy the compiler :-)
internal storage of the current tolerance level
icl64f icl::filter::UnaryCompareOp::m_dValue [private] |
internal storage of the current value
optype icl::filter::UnaryCompareOp::m_eOpType [private] |
internal storage of the current optype