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

Class for comparing operations. More...

#include <UnaryCompareOp.h>

Inheritance diagram for icl::filter::UnaryCompareOp:
icl::filter::UnaryOp icl::utils::Configurable

List of all members.

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

Detailed Description

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.


Member Enumeration Documentation

this enum specifiy all possible compare operations

Enumerator:
lt 

"<"- relation

lteq 

"<="-relation

eq 

"=="-relation

gteq 

">="-relation

gt 

">" -relation

eqt 

"=="-relation using a given tolerance level


Constructor & Destructor Documentation

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.

Parameters:
otoperation type ("<","<=",...)
valuevalue to compare each pixel with
tolerancetolerance 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

See also:
translate_op_type(const std::string&)
virtual icl::filter::UnaryCompareOp::~UnaryCompareOp ( ) [inline, virtual]

Destructor.


Member Function Documentation

virtual void icl::filter::UnaryCompareOp::apply ( const core::ImgBase poSrc,
core::ImgBase **  ppoDst 
) [virtual]

applies the operation to a source image

Parameters:
poSrcsource image
ppoDstdestination image

Implements icl::filter::UnaryOp.

returns the current optype

returns the current tolerance level

Returns:
current tolerance level

returns the current compare-value

Returns:
current value

sets the current optype

Parameters:
otnew optype value
void icl::filter::UnaryCompareOp::setTollerance ( icl64f  tolerance) [inline]

sets the current tolerance level

Parameters:
tolerancenew tolerance level

sets the current compare value

Parameters:
valuenew 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 :-)


Member Data Documentation

internal storage of the current tolerance level

internal storage of the current value

internal storage of the current optype


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