DGtal 1.4.2
Loading...
Searching...
No Matches
IntervalForegroundPredicate.h
1
17#pragma once
18
31#if defined(IntervalForegroundPredicate_RECURSES)
32#error Recursive header files inclusion detected in IntervalForegroundPredicate.h
33#else // defined(IntervalForegroundPredicate_RECURSES)
35#define IntervalForegroundPredicate_RECURSES
36
37#if !defined IntervalForegroundPredicate_h
39#define IntervalForegroundPredicate_h
40
42// Inclusions
43#include <iostream>
44#include "DGtal/base/Common.h"
45#include "DGtal/images/CConstImage.h"
46#include "DGtal/base/ConstAlias.h"
48
49// @since 0.8 In DGtal::functors
50namespace DGtal {
51 namespace functors {
52
63 template <typename Image>
65 {
66 public:
68
69 typedef typename Image::Value Value;
70 typedef typename Image::Point Point;
71
81 const Value minVal,
82 const Value maxVal):
83 myImage(&aImage), myMaxVal(maxVal), myMinVal(minVal) {};
84
88 bool operator()(const typename Image::Point &aPoint) const
89 {
90 return ((*myImage)(aPoint) > myMinVal) && ((*myImage)(aPoint) <= myMaxVal);
91 }
92
96 bool operator()(const typename Image::ConstRange::ConstIterator &it) const
97 {
98 return ((*it) > myMinVal) && ((*it) <= myMaxVal);
99 }
100
101
102 private:
106
107 protected:
109
110 };
111
112} // namespace functors
113} // namespace DGtal
114
115// //
117
118#endif // !defined IntervalForegroundPredicate_h
119
120#undef IntervalForegroundPredicate_RECURSES
121#endif // else defined(IntervalForegroundPredicate_RECURSES)
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition ConstAlias.h:187
Aim: implements association bewteen points lying in a digital domain and values.
Definition Image.h:70
Aim: Define a simple Foreground predicate thresholding image values between two constant values (the ...
IntervalForegroundPredicate(ConstAlias< Image > aImage, const Value minVal, const Value maxVal)
bool operator()(const typename Image::ConstRange::ConstIterator &it) const
bool operator()(const typename Image::Point &aPoint) const
BOOST_CONCEPT_ASSERT((concepts::CConstImage< Image >))
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: Defines the concept describing a read-only image, which is a refinement of CPointFunctor.
Definition CConstImage.h:95
const Point aPoint(3, 4)