$extrastylesheet
Olena
User documentation 2.1
An Image Processing Platform
Milena
Getting started
API Reference Manual
All Classes
Examples
Demos
Publications
All
Classes
Namespaces
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
distance_functor.hh
1
// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
2
//
3
// This file is part of Olena.
4
//
5
// Olena is free software: you can redistribute it and/or modify it under
6
// the terms of the GNU General Public License as published by the Free
7
// Software Foundation, version 2 of the License.
8
//
9
// Olena is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
// General Public License for more details.
13
//
14
// You should have received a copy of the GNU General Public License
15
// along with Olena. If not, see <http://www.gnu.org/licenses/>.
16
//
17
// As a special exception, you may use this file as part of a free
18
// software project without restriction. Specifically, if other files
19
// instantiate templates or use macros or inline functions from this
20
// file, or you compile this file and link it with other files to produce
21
// an executable, this file does not by itself cause the resulting
22
// executable to be covered by the GNU General Public License. This
23
// exception does not however invalidate any other reasons why the
24
// executable file might be covered by the GNU General Public License.
25
26
#ifndef MLN_TRANSFORM_INTERNAL_DISTANCE_FUNCTOR_HH
27
# define MLN_TRANSFORM_INTERNAL_DISTANCE_FUNCTOR_HH
28
34
35
# include <mln/core/macros.hh>
36
37
38
39
namespace
mln
40
{
41
42
namespace
transform
43
{
44
45
namespace
internal
46
{
47
48
template
<
typename
I>
49
struct
distance_functor
50
{
51
typedef
mln_value(I)
V
;
52
typedef mln_site(I)
P
;
53
54
void
init
(const I&);
55
bool
inqueue_p_wrt_input_p
(const V& input_p);
56
void
init_p
(const P&);
57
bool
inqueue_p_wrt_input_n
(const V& input_n);
58
void
process
(const P&, const P&);
59
60
61
void
init_
(const I&);
62
bool
inqueue_p_wrt_input_p_
(const V& input_p);
63
void
init_p_
(
unsigned
);
64
bool
inqueue_p_wrt_input_n_
(const V& input_n);
65
void
process_
(
unsigned
,
unsigned
);
66
};
67
68
69
# ifndef MLN_INCLUDE_ONLY
70
71
72
// Generic implementation.
73
74
template
<
typename
I>
75
inline
76
void
77
distance_functor<I>::init
(
const
I&)
78
{
79
}
80
81
template
<
typename
I>
82
inline
83
bool
84
distance_functor<I>::inqueue_p_wrt_input_p
(
const
V& input_p)
85
{
86
return
input_p ==
true
;
87
}
88
89
template
<
typename
I>
90
inline
91
void
92
distance_functor<I>::init_p
(
const
mln_site(I)&)
93
{
94
}
95
96
template
<
typename
I>
97
inline
98
bool
99
distance_functor<I>::inqueue_p_wrt_input_n
(
const
V& input_n)
100
{
101
return
input_n ==
false
;
102
}
103
104
template
<
typename
I>
105
inline
106
void
distance_functor<I>::process
(
const
P&,
const
P&)
107
{
108
}
109
110
111
112
// Fastest implementation.
113
114
template
<
typename
I>
115
inline
116
void
117
distance_functor<I>::init_
(
const
I&)
118
{
119
}
120
121
template
<
typename
I>
122
inline
123
bool
124
distance_functor<I>::inqueue_p_wrt_input_p_
(
const
V& input_p)
125
{
126
return
input_p ==
true
;
127
}
128
129
template
<
typename
I>
130
inline
131
void
132
distance_functor<I>::init_p_
(
unsigned
)
133
{
134
}
135
136
template
<
typename
I>
137
inline
138
bool
139
distance_functor<I>::inqueue_p_wrt_input_n_
(
const
V& input_n)
140
{
141
return
input_n ==
false
;
142
}
143
144
template
<
typename
I>
145
inline
146
void
distance_functor<I>::process_
(
unsigned
,
unsigned
)
147
{
148
}
149
150
# endif // ! MLN_INCLUDE_ONLY
151
152
}
// end of namespace mln::transform::internal
153
154
}
// end of namespace mln::transform
155
156
}
// end of namespace mln
157
158
159
#endif // ! MLN_TRANSFORM_INTERNAL_DISTANCE_FUNCTOR_HH
mln
transform
internal
distance_functor.hh
Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)