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_IMMERSE_HH
00027 # define MLN_WORLD_INTER_PIXEL_IMMERSE_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 
00052       
00053       template <typename I>
00054       image_if<mln_concrete(I), is_pixel>
00055       immerse(const Image<I>& input);
00056 
00057 
00058 
00059 # ifndef MLN_INCLUDE_ONLY
00060 
00061       template <typename I>
00062       inline
00063       image_if<mln_concrete(I), is_pixel>
00064       immerse(const Image<I>& input_)
00065       {
00066         trace::entering("world::inter_pixel::immerse");
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(2 * input.domain().pmin(),
00074                         2 * input.domain().pmax());
00075         mln_concrete(I) output(b);
00076         mln_assertion(geom::nsites(output | is_pixel()) == input.domain().nsites());
00077 
00078         data::paste_without_localization(input, (output | is_pixel()).rw());
00079 
00080         trace::exiting("world::inter_pixel::immerse");
00081         return output | is_pixel();
00082       }
00083 
00084 # endif // ! MLN_INCLUDE_ONLY
00085 
00086     } 
00087 
00088   } 
00089 
00090 } 
00091 
00092 #endif // ! MLN_WORLD_INTER_PIXEL_IMMERSE_HH