00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 #include <mln/core/image/image2d.hh>
00028 #include <mln/core/image/image3d.hh>
00029 #include <mln/core/image/dmorph/slice_image.hh>
00030 #include <mln/core/routine/duplicate.hh>
00031 
00032 #include <mln/value/rgb8.hh>
00033 
00034 #include <mln/io/ppm/load.hh>
00035 #include <mln/io/ppm/save.hh>
00036 #include <mln/io/ppms/load.hh>
00037 
00038 #include <mln/data/compare.hh>
00039 
00040 #include <mln/util/array.hh>
00041 
00042 #include <mln/literal/colors.hh>
00043 
00044 #include "tests/data.hh"
00045 
00046 
00047 int main()
00048 {
00049   using namespace mln;
00050   using value::rgb8;
00051 
00052   image2d<rgb8> ima = io::ppm::load<rgb8>(MLN_IMG_DIR "/fly.ppm");
00053   io::ppm::save(ima, "load-out.ppm");
00054   image2d<rgb8> ima2 = duplicate(ima);
00055 
00056 
00057   ima2(point2d(0,0)) = literal::green;
00058   io::ppm::save(ima2, "load-out.ppm");
00059 
00060   util::array<std::string> files(2);
00061   files[0] = MLN_IMG_DIR "/fly.ppm";
00062   files[1] = "load-out.ppm";
00063 
00064   image3d<rgb8> ima3d;
00065   io::ppms::load(ima3d, files);
00066 
00067   mln_assertion(ima3d.nslis() == 2);
00068   mln_assertion(slice(ima3d, 0) == ima);
00069   mln_assertion(slice(ima3d, 1) == ima2);
00070 }