Image Component Library (ICL)
BinaryCompareOp.h
Go to the documentation of this file.
1 /********************************************************************
2 ** Image Component Library (ICL) **
3 ** **
4 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld **
5 ** Neuroinformatics Group **
6 ** Website: www.iclcv.org and **
7 ** http://opensource.cit-ec.de/projects/icl **
8 ** **
9 ** File : ICLFilter/src/ICLFilter/BinaryCompareOp.h **
10 ** Module : ICLFilter **
11 ** Authors: Christof Elbrechter **
12 ** **
13 ** **
14 ** GNU LESSER GENERAL PUBLIC LICENSE **
15 ** This file may be used under the terms of the GNU Lesser General **
16 ** Public License version 3.0 as published by the **
17 ** **
18 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
19 ** included in the packaging of this file. Please review the **
20 ** following information to ensure the license requirements will **
21 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt **
22 ** **
23 ** The development of this software was supported by the **
24 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. **
25 ** The Excellence Cluster EXC 277 is a grant of the Deutsche **
26 ** Forschungsgemeinschaft (DFG) in the context of the German **
27 ** Excellence Initiative. **
28 ** **
29 ********************************************************************/
30 
31 #pragma once
32 
33 #include <ICLUtils/CompatMacros.h>
34 #include <ICLFilter/BinaryOp.h>
35 
36 namespace icl {
37  namespace filter{
38 
40 
46  public:
47  #ifdef ICL_HAVE_IPP
48  enum optype{
50  lt = ippCmpLess,
51  lteq = ippCmpLessEq,
52  eq = ippCmpEq,
53  gteq = ippCmpGreaterEq,
54  gt = ippCmpGreater,
55  eqt
56  };
57  #else
58  enum optype{
60  lt,
61  lteq,
62  eq,
63  gteq,
64  gt,
65  eqt
66  };
67  #endif
68 
70 
73  BinaryCompareOp(optype ot, icl64f tolerance=0):
74  m_eOpType(ot), m_dTolerance(tolerance){}
75 
77  virtual ~BinaryCompareOp(){}
78 
80 
84  virtual void apply(const core::ImgBase *poSrc1, const core::ImgBase *poSrc2, core::ImgBase **ppoDst);
85 
87  using BinaryOp::apply;
88 
90 
91  optype getOpType() const { return m_eOpType; }
92 
94 
95  icl64f getTolerance() const { return m_dTolerance; }
96 
98 
99  void setOpType(optype ot) { m_eOpType = ot; }
100 
102 
103  void setTolerance(icl64f tolerance){ m_dTolerance = tolerance; }
104 
105  private:
106 
109 
110  // internal storage for the current tolerance level
112  };
113 
114  } // namespace filter
115 } // namespace icl
116 
Class for comparing two images pixel-wise.
Definition: BinaryCompareOp.h:45
undocument this line if you encounter any issues!
Definition: Any.h:37
optype getOpType() const
returns the current optype
Definition: BinaryCompareOp.h:91
void setOpType(optype ot)
sets the current opttype
Definition: BinaryCompareOp.h:99
optype m_eOpType
internal storage for the current optype
Definition: BinaryCompareOp.h:108
virtual void apply(const core::ImgBase *operand1, const core::ImgBase *operand2, core::ImgBase **result)=0
pure virtual apply function
Abstract base class for binary image operations.
Definition: BinaryOp.h:42
void setTolerance(icl64f tolerance)
sets the current tolerance level
Definition: BinaryCompareOp.h:103
icl64f getTolerance() const
returns the current tolerance level
Definition: BinaryCompareOp.h:95
Ipp64f icl64f
64Bit floating point type for the ICL
Definition: BasicTypes.h:52
virtual ~BinaryCompareOp()
Destructor.
Definition: BinaryCompareOp.h:77
ICLQt_API core::Img< T > filter(const core::Img< T > &image, const std::string &filter)
applies a filter operation on the source image (affinity for float)
icl64f m_dTolerance
Definition: BinaryCompareOp.h:111
#define ICLFilter_API
Definition: CompatMacros.h:175
ImgBase is the Image-Interface class that provides save access to underlying Img-template .
Definition: ImgBase.h:131
optype
this enum specifiy all possible compare operations
Definition: BinaryCompareOp.h:49
BinaryCompareOp(optype ot, icl64f tolerance=0)
creates a new BinaryCompareOp object with given optype and tolerance level
Definition: BinaryCompareOp.h:73