DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
IntervalForegroundPredicate.h
1
16
17
#pragma once
18
30
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
50
namespace
DGtal
{
51
namespace
functors
{
52
63
template
<
typename
Image>
64
class
IntervalForegroundPredicate
65
{
66
public
:
67
BOOST_CONCEPT_ASSERT
((
concepts::CConstImage<Image>
));
68
69
typedef
typename
Image::Value
Value
;
70
typedef
typename
Image::Point
Point
;
71
80
IntervalForegroundPredicate
(
ConstAlias<Image>
aImage,
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
:
103
const
Image
*
myImage
;
104
Value
myMaxVal
;
105
Value
myMinVal
;
106
107
protected
:
108
IntervalForegroundPredicate
();
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)
DGtal::ConstAlias
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition
ConstAlias.h:187
DGtal::ImageContainerBySTLVector< Domain, Value >::ConstIterator
std::vector< Value >::const_iterator ConstIterator
Definition
ImageContainerBySTLVector.h:265
DGtal::ImageContainerBySTLVector< Domain, Value >::Value
Value Value
Definition
ImageContainerBySTLVector.h:153
DGtal::ImageContainerBySTLVector< Domain, Value >::Point
Domain::Point Point
Definition
ImageContainerBySTLVector.h:138
DGtal::Image
Aim: implements association between points lying in a digital domain and values.
Definition
Image.h:70
DGtal::functors::IntervalForegroundPredicate::Value
Image::Value Value
Definition
IntervalForegroundPredicate.h:69
DGtal::functors::IntervalForegroundPredicate::IntervalForegroundPredicate
IntervalForegroundPredicate(ConstAlias< Image > aImage, const Value minVal, const Value maxVal)
Definition
IntervalForegroundPredicate.h:80
DGtal::functors::IntervalForegroundPredicate::myImage
const Image * myImage
Definition
IntervalForegroundPredicate.h:103
DGtal::functors::IntervalForegroundPredicate::operator()
bool operator()(const typename Image::ConstRange::ConstIterator &it) const
Definition
IntervalForegroundPredicate.h:96
DGtal::functors::IntervalForegroundPredicate::myMaxVal
Value myMaxVal
Definition
IntervalForegroundPredicate.h:104
DGtal::functors::IntervalForegroundPredicate::operator()
bool operator()(const typename Image::Point &aPoint) const
Definition
IntervalForegroundPredicate.h:88
DGtal::functors::IntervalForegroundPredicate::Point
Image::Point Point
Definition
IntervalForegroundPredicate.h:70
DGtal::functors::IntervalForegroundPredicate::IntervalForegroundPredicate
IntervalForegroundPredicate()
DGtal::functors::IntervalForegroundPredicate::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CConstImage< Image >))
DGtal::functors::IntervalForegroundPredicate::myMinVal
Value myMinVal
Definition
IntervalForegroundPredicate.h:105
DGtal::functors
functors namespace gathers all DGtal functors.
Definition
BasicBoolFunctors.h:49
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
DGtal::concepts::CConstImage
Aim: Defines the concept describing a read-only image, which is a refinement of CPointFunctor.
Definition
CConstImage.h:95
aPoint
const Point aPoint(3, 4)
src
DGtal
images
IntervalForegroundPredicate.h
Generated on
for DGtal by
1.18.0