$extrastylesheet
Olena  User documentation 2.1
An Image Processing Platform
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mixed_neighb.hh
1 // Copyright (C) 2009, 2012, 2013 EPITA Research and Development
2 // Laboratory (LRDE)
3 //
4 // This file is part of Olena.
5 //
6 // Olena is free software: you can redistribute it and/or modify it under
7 // the terms of the GNU General Public License as published by the Free
8 // Software Foundation, version 2 of the License.
9 //
10 // Olena is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with Olena. If not, see <http://www.gnu.org/licenses/>.
17 //
18 // As a special exception, you may use this file as part of a free
19 // software project without restriction. Specifically, if other files
20 // instantiate templates or use macros or inline functions from this
21 // file, or you compile this file and link it with other files to produce
22 // an executable, this file does not by itself cause the resulting
23 // executable to be covered by the GNU General Public License. This
24 // exception does not however invalidate any other reasons why the
25 // executable file might be covered by the GNU General Public License.
26 
27 #ifndef MLN_CORE_MIXED_NEIGHB_HH
28 # define MLN_CORE_MIXED_NEIGHB_HH
29 
40 
41 # include <mln/core/neighb.hh>
42 # include <mln/core/internal/neighb_base.hh>
43 # include <mln/core/internal/neighb_niter_base.hh>
44 # include <mln/core/internal/site_relative_iterator_base.hh>
45 # include <mln/core/internal/neighb_niter_impl.hh>
46 
47 
48 namespace mln
49 {
50 
51  // Forward declarations.
52  template <typename W> class mixed_neighb_fwd_niter;
53  template <typename W> class mixed_neighb_bkd_niter;
54 
55 
57 
58  template <typename W>
60  : public internal::neighb_base<W,mixed_neighb<W> >,
61  private mlc_is_a(W, Window)::check_t
62  {
64 
65  public:
66 
69 
72 
74  typedef fwd_niter niter;
75 
76 
78  mixed_neighb();
79 
81  mixed_neighb(const W& win);
82 
83  };
84 
85 
88  template <typename W>
89  void
90  from_to_(const mln::mixed_neighb<W>& from, W& to);
91 
93  template <typename W>
94  void
95  from_to_(const W& from, mln::mixed_neighb<W>& to);
97 
98 
99  // mixed_neighb_fwd_niter<W>
100 
101  template <typename W>
103  : public internal::neighb_niter_base<W,mixed_neighb<W>,
104  mln_fwd_qiter(W),neighb_fwd_niter<W> >
105  {
106  typedef
108  mln_fwd_qiter(W),neighb_fwd_niter<W> > super_;
109 
110  public:
112 
113  template <typename P>
115  const mln_target(W)& nbh_site_set,
116  const P& c);
117 
118  };
119 
120 
121 
122  // mixed_neighb_bkd_niter<W,E>
123 
124  template <typename W>
126  : public internal::neighb_niter_base<W,mixed_neighb<W>,
127  mln_bkd_qiter(W),neighb_bkd_niter<W> >
128  {
129  typedef
131  mln_bkd_qiter(W),neighb_bkd_niter<W> > super_;
132 
133  public:
135 
136  template <typename P>
138  const mln_target(W)& nbh_site_set,
139  const P& c);
140 
141  };
142 
143 
144 
145 # ifndef MLN_INCLUDE_ONLY
146 
147  // mixed_neighb<W>
148 
149  template <typename W>
150  inline
152  {
153  }
154 
155  template <typename W>
156  inline
157  mixed_neighb<W>::mixed_neighb(const W& win)
158  : super_(win)
159  {
160  }
161 
162 
163  // Conversion
164 
165  template <typename W>
166  void
167  from_to_(const mln::mixed_neighb<W>& from, W& to)
168  {
169  to = from.win();
170  }
171 
172  template <typename W>
173  void
174  from_to_(const W& from, mln::mixed_neighb<W>& to)
175  {
176  to.change_window(from);
177  }
178 
179 
180  // mixed_neighb_fwd_niter<W>
181 
182  template <typename W>
183  inline
185  {
186  }
187 
188  template <typename W>
189  template <typename P>
190  inline
191  mixed_neighb_fwd_niter<W>::mixed_neighb_fwd_niter(const mixed_neighb<W>& nbh,
192  const mln_target(W)& nbh_site_set,
193  const P& c)
194  : super_(nbh, c)
195  {
196  this->i_.init_(nbh.win(), nbh_site_set, c);
197  }
198 
199 
200 
201  // mixed_neighb_bkd_niter<W>
202 
203  template <typename W>
204  inline
206  {
207  }
208 
209  template <typename W>
210  template <typename P>
211  inline
212  mixed_neighb_bkd_niter<W>::mixed_neighb_bkd_niter(const mixed_neighb<W>& nbh,
213  const mln_target(W)& nbh_site_set,
214  const P& c)
215  : super_(nbh, c)
216  {
217  this->i_.init_(nbh.win(), nbh_site_set, c);
218  }
219 
220 
221 # endif // ! MLN_INCLUDE_ONLY
222 
223 } // end of namespace mln
224 
225 
226 #endif // ! MLN_CORE_MIXED_NEIGHB_HH