$extrastylesheet
Olena  User documentation 2.1
An Image Processing Platform
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
complex_windows.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_CORE_IMAGE_COMPLEX_WINDOWS_HH
27 # define MLN_CORE_IMAGE_COMPLEX_WINDOWS_HH
28 
31 
32 # include <mln/core/internal/complex_window_base.hh>
33 # include <mln/core/internal/complex_window_p_base.hh>
34 
35 # include <mln/topo/complex_iterators.hh>
36 
37 
51 # define mln_gen_complex_window_with_base(Win, Fwd_Complex_Iter, Bkd_Complex_Iter, Base) \
52  /* Forward declaration. */ \
53  template <unsigned D, typename G> struct Win; \
54  \
55  /* Traits. */ \
56  namespace trait \
57  { \
58  template <unsigned D, typename G> \
59  struct window_< Win <D, G> > \
60  : window_< Base < D, G, \
61  Fwd_Complex_Iter<D>, \
62  Bkd_Complex_Iter <D>, \
63  Win <D, G> > > \
64  { \
65  }; \
66  } \
67  \
68  /* Definition. */ \
69  template <unsigned D, typename G> \
70  struct Win \
71  : Base < D, G, \
72  Fwd_Complex_Iter <D>, \
73  Bkd_Complex_Iter <D>, \
74  Win <D, G> > \
75  { \
76  }
77 
78 
94 # define mln_gen_complex_window(Win, Fwd_Complex_Iter, Bkd_Complex_Iter) \
95  mln_gen_complex_window_with_base(Win, \
96  Fwd_Complex_Iter, \
97  Bkd_Complex_Iter, \
98  mln::internal::complex_window_base)
99 
100 
115 # define mln_gen_complex_window_p(Win, Fwd_Complex_Iter, Bkd_Complex_Iter) \
116  mln_gen_complex_window_with_base(Win, \
117  Fwd_Complex_Iter, \
118  Bkd_Complex_Iter, \
119  mln::internal::complex_window_p_base)
120 
121 
122 
123 namespace mln
124 {
125 
126  /*-----------------------.
127  | Non-centered windows. |
128  `-----------------------*/
129 
132  mln_gen_complex_window(complex_lower_window,
133  topo::adj_lower_face_fwd_iter,
135 
138  mln_gen_complex_window(complex_higher_window,
141 
144  mln_gen_complex_window(complex_lower_higher_window,
147 
150  mln_gen_complex_window(complex_lower_dim_connected_n_face_window,
153 
156  mln_gen_complex_window(complex_higher_dim_connected_n_face_window,
159 
162  mln_gen_complex_window(complex_m_face_window,
165 
166 
167  /*-------------------.
168  | Centered windows. |
169  `-------------------*/
170 
173  mln_gen_complex_window_p(complex_lower_window_p,
176 
179  mln_gen_complex_window_p(complex_higher_window_p,
182 
186  mln_gen_complex_window_p(complex_lower_higher_window_p,
189 
193  mln_gen_complex_window_p(complex_lower_dim_connected_n_face_window_p,
196 
200  mln_gen_complex_window_p(complex_higher_dim_connected_n_face_window_p,
203 
207  mln_gen_complex_window_p(complex_m_face_window_p,
210 
211 } // end of namespace mln
212 
213 # undef mln_gen_complex_window_p
214 # undef mln_gen_complex_window
215 # undef mln_gen_complex_window_from_base
216 
217 #endif // ! MLN_CORE_IMAGE_COMPLEX_WINDOWS_HH