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_CORE_ROUTINE_INIT_HH
00027 # define MLN_CORE_ROUTINE_INIT_HH
00028 
00033 
00034 # include <mln/tag/init.hh>
00035 # include <mln/geom/bbox.hh>
00036 # include <mln/border/find.hh>
00037 
00038 # include <mln/core/routine/init.hxx>
00039 
00040 
00041 namespace mln
00042 {
00043 
00044 
00045   
00046 
00047   template <typename Subject, typename T, typename M>
00048   void init_(Subject, T& target, const Object<M>& model);
00049 
00050   
00051 
00052   template <typename B, typename I>
00053   void init_(tag::bbox_t, B& b, const Image<I>& ima);
00054 
00055   template <typename I>
00056   void init_(tag::border_t, unsigned& bdr, const Image<I>& ima);
00057 
00058   template <typename I>
00059   void init_(tag::domain_t, mln_domain(I)& pset, const Image<I>& ima);
00060 
00061 
00062 
00063 # ifndef MLN_INCLUDE_ONLY
00064 
00065 
00066   template <typename Subject, typename T, typename M>
00067   inline
00068   void init_(Subject, T&, const Object<M>&)
00069   {
00070     struct ERROR err_; 
00071   }
00072 
00073   
00074 
00075   template <typename B, typename I>
00076   inline
00077   void init_(tag::bbox_t, B& b, const Image<I>& ima)
00078   {
00079     b = geom::bbox(exact(ima).domain());
00080   }
00081 
00082   template <typename I>
00083   inline
00084   void init_(tag::border_t, unsigned& bdr, const Image<I>& ima)
00085   {
00086     
00087     
00088     
00089     bdr = border::find(ima);
00090   }
00091 
00092   template <typename I>
00093   inline
00094   void init_(tag::domain_t, mln_domain(I)& pset, const Image<I>& ima)
00095   {
00096     pset = exact(ima).domain();
00097   }
00098 
00099 
00100 # endif // ! MLN_INCLUDE_ONLY
00101 
00102 } 
00103 
00104 
00105 #endif // ! MLN_CORE_ROUTINE_INIT_HH