DGtal
0.6.devel
Main Page
Related Pages
Modules
Namespaces
Data Structures
Examples
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
src
DGtal
images
imagesSetsUtils
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)
34
35
#define IntervalForegroundPredicate_RECURSES
36
37
#if !defined IntervalForegroundPredicate_h
38
39
#define IntervalForegroundPredicate_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
59
template
<
typename
Image>
60
class
IntervalForegroundPredicate
61
{
62
public
:
63
BOOST_CONCEPT_ASSERT
((
CImage<Image>
));
64
65
typedef
typename
Image::Value
Value
;
66
typedef
typename
Image::Point
Point
;
67
75
IntervalForegroundPredicate
(
const
Image
& aImage,
76
const
Value
minVal,
77
const
Value
maxVal):
78
myImage
(new
Image
(aImage)),
myMaxVal
(maxVal),
myMinVal
(minVal) {};
79
83
bool
operator()
(
const
typename
Image::Point
&aPoint)
const
84
{
85
return
((*
myImage
)(aPoint) >
myMinVal
) && ((*myImage)(aPoint) <=
myMaxVal
);
86
}
87
91
bool
operator()
(
const
typename
Image::Iterator
&it)
const
92
{
93
return
((*
myImage
)(it) >
myMinVal
) && ((*myImage)(it) <=
myMaxVal
);
94
}
95
99
bool
operator()
(
const
typename
Image::ConstIterator
&it)
const
100
{
101
return
((*
myImage
)(it) >
myMinVal
) && ((*myImage)(it) <=
myMaxVal
);
102
}
103
107
bool
operator()
(
const
typename
Image::SpanIterator
&it)
const
108
{
109
return
((*
myImage
)(it) >
myMinVal
) && ((*myImage)(it) <=
myMaxVal
);
110
}
111
112
private
:
113
CountedPtr<Image>
myImage
;
114
Value
myMaxVal
;
115
Value
myMinVal
;
116
117
protected
:
118
IntervalForegroundPredicate
();
119
120
};
121
122
123
124
}
125
// //
127
128
#endif // !defined IntervalForegroundPredicate_h
129
130
#undef IntervalForegroundPredicate_RECURSES
131
#endif // else defined(IntervalForegroundPredicate_RECURSES)
Generated on Wed Dec 19 2012 19:10:27 for DGtal by
1.8.1.1