27 #ifndef MLN_CORE_IMAGE_COMPLEX_WINDOW_PITER_HH
28 # define MLN_CORE_IMAGE_COMPLEX_WINDOW_PITER_HH
33 # include <mln/core/concept/window.hh>
34 # include <mln/core/internal/site_relative_iterator_base.hh>
53 template <
typename I,
typename G,
typename W>
55 :
public internal::site_relative_iterator_base< W,
56 complex_window_fwd_piter<I, G, W> >
59 typedef internal::site_relative_iterator_base< W, self_ > super_;
71 template <typename Pref>
72 complex_window_fwd_piter(const
Window<W>& win, const Pref& p_ref);
76 template <typename Pref>
77 void init_(const
Window<W>& win, const Pref& p_ref);
82 bool is_valid_() const;
92 template <typename Pref>
93 void center_at_(const Pref& c);
96 psite compute_p_() const;
101 const iter_type&
iter() const;
112 template <typename I, typename G, typename W>
114 operator<<(std::ostream& ostr,
115 const complex_window_fwd_piter<I, G, W>& p);
123 template <typename I, typename G, typename W>
125 : public internal::site_relative_iterator_base< W,
129 typedef internal::site_relative_iterator_base< W, self_ > super_;
133 typedef mln_psite(W) psite;
135 typedef typename W::complex_bkd_iter iter_type;
141 template <typename Pref>
142 complex_window_bkd_piter(const
Window<W>& win, const Pref& p_ref);
146 template <typename Pref>
147 void init_(const
Window<W>& win, const Pref& p_ref);
152 bool is_valid_() const;
162 template <typename Pref>
163 void center_at_(const Pref& c);
166 psite compute_p_() const;
171 const iter_type& iter() const;
182 template <typename I, typename G, typename W>
184 operator<<(std::ostream& ostr,
185 const complex_window_bkd_piter<I, G, W>& p);
189 # ifndef MLN_INCLUDE_ONLY
195 template <
typename I,
typename G,
typename W>
201 template <
typename I,
typename G,
typename W>
202 template <
typename Pref>
210 template <
typename I,
typename G,
typename W>
211 template <
typename Pref>
214 complex_window_fwd_piter<I, G, W>::init_(
const Window<W>& win,
217 this->change_target(exact(win));
218 this->center_at(p_ref);
219 mln_postcondition(!this->is_valid());
223 template <
typename I,
typename G,
typename W>
226 complex_window_fwd_piter<I, G, W>::is_valid_()
const
228 return iter_.is_valid();
231 template <
typename I,
typename G,
typename W>
234 complex_window_fwd_piter<I, G, W>::invalidate_()
239 template <
typename I,
typename G,
typename W>
242 complex_window_fwd_piter<I, G, W>::do_start_()
247 template <
typename I,
typename G,
typename W>
250 complex_window_fwd_piter<I, G, W>::do_next_()
255 template <
typename I,
typename G,
typename W>
256 template <
typename Pref>
259 complex_window_fwd_piter<I, G, W>::center_at_(
const Pref&)
261 iter_.center_at(this->center().face());
264 template <
typename I,
typename G,
typename W>
267 complex_window_fwd_piter<I, G, W>::compute_p_()
const
272 template <
typename I,
typename G,
typename W>
274 const typename W::complex_fwd_iter&
280 template <
typename I,
typename G,
typename W>
282 typename W::complex_fwd_iter&
289 template <
typename I,
typename G,
typename W>
292 operator<<(std::ostream& ostr,
295 return ostr << p.unproxy_();
303 template <
typename I,
typename G,
typename W>
309 template <
typename I,
typename G,
typename W>
310 template <
typename Pref>
318 template <
typename I,
typename G,
typename W>
319 template <
typename Pref>
322 complex_window_bkd_piter<I, G, W>::init_(
const Window<W>& win,
325 this->change_target(exact(win));
326 this->center_at(p_ref);
327 mln_postcondition(!this->is_valid());
331 template <
typename I,
typename G,
typename W>
334 complex_window_bkd_piter<I, G, W>::is_valid_()
const
336 return iter_.is_valid();
339 template <
typename I,
typename G,
typename W>
342 complex_window_bkd_piter<I, G, W>::invalidate_()
347 template <
typename I,
typename G,
typename W>
350 complex_window_bkd_piter<I, G, W>::do_start_()
355 template <
typename I,
typename G,
typename W>
358 complex_window_bkd_piter<I, G, W>::do_next_()
363 template <
typename I,
typename G,
typename W>
364 template <
typename Pref>
367 complex_window_bkd_piter<I, G, W>::center_at_(
const Pref& c)
371 iter_.center_at(this->center().face());
374 template <
typename I,
typename G,
typename W>
377 complex_window_bkd_piter<I, G, W>::compute_p_()
const
382 template <
typename I,
typename G,
typename W>
384 const typename W::complex_bkd_iter&
390 template <
typename I,
typename G,
typename W>
392 typename W::complex_bkd_iter&
399 template <
typename I,
typename G,
typename W>
402 operator<<(std::ostream& ostr,
405 return ostr << p.unproxy_();
408 # endif // ! MLN_INCLUDE_ONLY
412 #endif // ! MLN_CORE_IMAGE_COMPLEX_WINDOW_PITER_HH