31 #ifndef MLN_GEOM_CROP_HH
32 # define MLN_GEOM_CROP_HH
34 # include <mln/core/concept/image.hh>
35 # include <mln/core/concept/box.hh>
36 # include <mln/data/paste.hh>
48 template <
typename I,
typename B>
49 mln_concrete(I)
crop(const Image<I>& input, const Box<B>& b);
52 # ifndef MLN_INCLUDE_ONLY
54 template <
typename I,
typename B>
55 mln_concrete(I)
crop(const Image<I>& input_, const Box<B>& b_)
57 mln_trace(
"mln::geom::crop");
59 const I& input =
exact(input_);
60 const B& b =
exact(b_);
61 mln_precondition(input.is_valid());
62 mln_precondition(b.is_valid());
63 mln_precondition(b <= input.domain());
65 mln_concrete(I) output(b);
71 # endif // ! MLN_INCLUDE_ONLY
77 #endif // ! MLN_GEOM_CROP_HH