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
00028
00029 #include <mln/core/image/image1d.hh>
00030 #include <mln/core/image/image2d.hh>
00031 #include <mln/core/image/dmorph/extended.hh>
00032 #include <mln/debug/iota.hh>
00033 #include <mln/border/mirror.hh>
00034 #include <mln/opt/element.hh>
00035 #include <mln/data/paste_without_localization.hh>
00036 #include <mln/data/compare.hh>
00037
00038 using namespace mln;
00039
00040 int
00041 main (void)
00042 {
00043 {
00044 image1d<int> ima(2, 3);
00045 debug::iota(ima);
00046 border::mirror(ima);
00047 mln_assertion(opt::element(ima, 0) == 2);
00048 mln_assertion(opt::element(ima, 1) == 2);
00049 mln_assertion(opt::element(ima, 2) == 1);
00050 mln_assertion(opt::element(ima, 3) == 1);
00051 mln_assertion(opt::element(ima, 4) == 2);
00052 mln_assertion(opt::element(ima, 5) == 2);
00053 mln_assertion(opt::element(ima, 6) == 1);
00054 mln_assertion(opt::element(ima, 7) == 1);
00055 }
00056
00057
00058
00059 {
00060 unsigned ref_data[6][7] = {
00061 { 1, 1, 4, 5, 6, 3, 3 },
00062 { 1, 1, 1, 2, 3, 3, 3 },
00063 { 2, 1, 1, 2, 3, 3, 2 },
00064 { 5, 4, 4, 5, 6, 6, 5 },
00065 { 4, 4, 4, 5, 6, 6, 6 },
00066 { 4, 4, 1, 2, 3, 6, 6 }
00067 };
00068
00069
00070 image2d<unsigned> ref = make::image(ref_data);
00071 image2d<unsigned> input(2, 3, 2);
00072 image2d<unsigned> res(6, 7, 0);
00073 debug::iota(input, 0);
00074 border::mirror(input);
00075
00076 data::paste_without_localization(extended_to(input, input.vbbox()), res);
00077
00078 mln_assertion(res == ref);
00079 }
00080 }