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 #ifndef MLN_WORLD_INTER_PIXEL_FULL2IMAGE_HH
00027 # define MLN_WORLD_INTER_PIXEL_FULL2IMAGE_HH
00028 
00032 
00033 # include <mln/core/concept/image.hh>
00034 # include <mln/data/paste_without_localization.hh>
00035 # include <mln/geom/nsites.hh>
00036 # include <mln/world/inter_pixel/is_pixel.hh>
00037 
00038 
00039 namespace mln
00040 {
00041 
00042   namespace world
00043   {
00044 
00045     namespace inter_pixel
00046     {
00047 
00053       
00054       template <typename I>
00055       mln_concrete(I)
00056       full2image(const Image<I>& input);
00057 
00058 
00059 # ifndef MLN_INCLUDE_ONLY
00060 
00061 
00062       template <typename I>
00063       mln_concrete(I)
00064       full2image(const Image<I>& input_)
00065       {
00066         trace::entering("world::inter_pixel::full2image");
00067 
00068         mlc_is_a(mln_domain(I), Box)::check();
00069 
00070         const I& input = exact(input_);
00071         mln_precondition(input.is_valid());
00072 
00073         mln_domain(I) b(input.domain().pmin() / 2,
00074                         input.domain().pmax() / 2);
00075         mln_concrete(I) output(b);
00076         mln_assertion(geom::nsites(output) == geom::nsites(input | is_pixel()));
00077 
00078         data::paste_without_localization(input | is_pixel(), output);
00079 
00080         trace::exiting("world::inter_pixel::full2image");
00081         return output;
00082       }
00083 
00084 
00085 # endif // ! MLN_INCLUDE_ONLY
00086 
00087 
00088     } 
00089 
00090   } 
00091 
00092 } 
00093 
00094 #endif // ! MLN_WORLD_INTER_PIXEL_FULL2IMAGE_HH