DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SimpleThresholdForegroundPredicate.h
1 
17 #pragma once
18 
31 #if defined(SimpleThresholdForegroundPredicate_RECURSES)
32 #error Recursive header files inclusion detected in SimpleThresholdForegroundPredicate.h
33 #else // defined(SimpleThresholdForegroundPredicate_RECURSES)
34 
35 #define SimpleThresholdForegroundPredicate_RECURSES
36 
37 #if !defined SimpleThresholdForegroundPredicate_h
38 
39 #define SimpleThresholdForegroundPredicate_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include "DGtal/images/CImage.h"
46 #include "DGtal/base/CountedPtr.h"
48 
49 namespace DGtal
50 {
51 
61  template <typename Image>
63  {
64  public:
66 
67  typedef typename Image::Value Value;
68  typedef typename Image::Point Point;
69 
77  const Value value):
78  myImage(new Image(aImage)), myVal(value) {};
79 
83  bool operator()(const typename Image::Point &aPoint) const
84  {
85  return ((*myImage)(aPoint) > myVal);
86  }
87 
91  bool operator()(const typename Image::Iterator &it) const
92  {
93  return ((*myImage)(it) > myVal);
94  }
95 
99  bool operator()(const typename Image::ConstIterator &it) const
100  {
101  return ((*myImage)(it) > myVal);
102  }
103 
107  bool operator()(const typename Image::SpanIterator &it) const
108  {
109  return ((*myImage)(it) > myVal);
110  }
111 
112  private:
115 
116  protected:
118 
119  };
120 
121 
122 
123 }
124 // //
126 
127 #endif // !defined SimpleThresholdForegroundPredicate_h
128 
129 #undef SimpleThresholdForegroundPredicate_RECURSES
130 #endif // else defined(SimpleThresholdForegroundPredicate_RECURSES)