27 #ifndef MLN_GEOM_BBOX_HH
28 # define MLN_GEOM_BBOX_HH
43 # include <mln/core/site_set/box.hh>
44 # include <mln/core/concept/image.hh>
45 # include <mln/core/concept/window.hh>
46 # include <mln/core/concept/weighted_window.hh>
47 # include <mln/literal/zero.hh>
48 # include <mln/accu/shape/bbox.hh>
63 box<mln_site(S)>
bbox(
const Site_Set<S>& pset);
72 box<mln_site(I)>
bbox(
const Image<I>& ima);
80 box<mln_psite(W)>
bbox(
const Window<W>& win);
88 box<mln_psite(W)>
bbox(
const Weighted_Window<W>& win);
92 # ifndef MLN_INCLUDE_ONLY
98 box<mln_site(S)> bbox_(
const trait::site_set::bbox::known&,
104 template <
typename S>
105 box<mln_site(S)> bbox_(trait::site_set::bbox::unknown,
108 typedef mln_site(S) P;
112 mln_piter(S)
p(pset);
114 mln_precondition(
p.is_valid());
119 for (
unsigned i = 0; i < P::dim; ++i)
126 box<P> bb(pmin, pmax);
135 template <typename S>
137 box<mln_site(S)>
bbox(const Site_Set<S>& pset)
141 box<mln_site(S)> b = impl::bbox_(mln_trait_site_set_bbox(S)(),
147 template <
typename I>
148 box<mln_site(I)>
bbox(
const Image<I>& ima_)
150 const I& ima =
exact(ima_);
151 mln_precondition(ima.is_valid());
152 box<mln_site(I)> b =
geom::bbox(ima.domain());
157 template <
typename W>
158 box<mln_psite(W)>
bbox(
const Window<W>& win)
160 typedef mln_psite(W) P;
161 accu::shape::
bbox<P> b;
162 P O = literal::origin;
163 mln_qiter(W) q(
exact(win), O);
170 template <typename W>
171 box<mln_psite(W)>
bbox(const Weighted_Window<W>& win)
173 box<mln_psite(W)> b =
bbox(
exact(win).win());
179 # endif // ! MLN_INCLUDE_ONLY
186 #endif // ! MLN_GEOM_BBOX_HH