3 #include <mln/border/duplicate.hh>
4 #include <mln/io/ppm/load.hh>
5 #include <mln/io/pgm/save.hh>
6 #include <mln/level/stretch.hh>
11 using namespace mln::value
;
13 int main (int argc
, char** argv
)
17 std::cerr
<< "usage: " << *argv
<< " in.ppm out.pgm\n";
21 image2d
<rgb8
> img
= io::ppm::load
<rgb8
> (argv
[1]);
22 border::duplicate (img
);
23 image2d
<float> nrg (img
.domain ());
24 image2d
<rgb8
>::fwd_piter
p (img
.domain ());
27 nrg (p
) = get_nrg (img
, p
);
29 std::cerr
<< "saving" << std::endl
;
30 image2d
<int_u8
> gl (img
.domain ());
31 level::stretch (nrg
, gl
);
32 io::pgm::save (gl
, argv
[2]);
33 std::cerr
<< "end" << std::endl
;