26 #ifndef MLN_CONVERT_TO_WINDOW_HH
27 # define MLN_CONVERT_TO_WINDOW_HH
35 # include <mln/core/concept/gdpoint.hh>
36 # include <mln/core/concept/neighborhood.hh>
37 # include <mln/core/window.hh>
38 # include <mln/pw/image.hh>
39 # include <mln/pw/cst.hh>
40 # include <mln/metal/is_a.hh>
55 window<mln_site(I)::dpsite>
to_window(const Image<I>& ima);
59 window<mln_site(S)::dpsite>
to_window(const Site_Set<S>& pset);
62 template <typename D, typename C>
63 window<D>
to_window(const std::set<D, C>& s);
66 # ifndef MLN_INCLUDE_ONLY
76 return exact(nbh).win();
94 window<mln_site(I)::dpsite>
to_window(
const Image<I>& ima_)
96 const I& ima =
exact(ima_);
97 mln_precondition(ima.is_valid());
99 typedef mln_site(I) P;
100 typedef mln_dpsite(P) D;
103 mln_piter(I)
p(ima.domain());
106 win.insert(
p - P::origin);
115 template <typename S>
117 window<mln_site(S)::dpsite>
to_window(const Site_Set<S>& pset)
126 template <
typename D,
typename C>
128 window<D>
to_window(
const std::set<D, C>& s)
132 mln::metal::is_a<D, Gdpoint>::check();
134 for (
typename std::set<D, C>::const_iterator i = s.begin();
140 # endif // ! MLN_INCLUDE_ONLY
147 #endif // ! MLN_CONVERT_TO_WINDOW_HH