27 #ifndef MLN_SUBSAMPLING_SUBSAMPLING_HH
28 # define MLN_SUBSAMPLING_SUBSAMPLING_HH
34 # include <mln/geom/ncols.hh>
35 # include <mln/geom/nrows.hh>
49 const mln_deduce(I, site, delta)& first_p,
50 const mln_deduce(I, site, coord)& gap);
52 # ifndef MLN_INCLUDE_ONLY
61 mln_concrete(image2d<T>)
62 subsampling_(const image2d<T>& input,
63 const mln_deduce(image2d<T>, site, delta)& first_p,
64 const mln_deduce(image2d<T>, site, coord)& gap)
66 trace::entering(
"subsampling::impl::subsampling_");
67 mln_concrete(image2d<T>) output(geom::nrows(input) / gap,
68 geom::ncols(input) / gap);
70 for (def::coord j = geom::min_col(output);
71 j <= geom::max_col(output); ++j)
72 for (def::coord i = geom::min_row(output);
73 i <= geom::max_row(output); ++i)
76 point2d p2(first_p[0] + i * gap, first_p[1] + j * gap);
78 output(p1) = input(p2);
81 trace::exiting(
"subsampling::impl::subsampling_");
92 const mln_deduce(I, site, delta)& first_p,
93 const mln_deduce(I, site, coord)& gap)
95 trace::entering(
"subsampling::subsampling");
96 mln_precondition(exact(input).is_valid());
101 output = impl::subsampling_(exact(input), first_p, gap);
103 trace::exiting(
"subsampling::subsampling");
107 # endif // ! MLN_INCLUDE_ONLY
114 #endif // ! MLN_SUBSAMPLING_SUBSAMPLING_HH