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_BORDER_GET_HH
00027 # define MLN_BORDER_GET_HH
00028 
00032 
00033 # include <mln/trait/images.hh>
00034 # include <mln/trace/all.hh>
00035 
00036 namespace mln
00037 {
00038 
00039   namespace border
00040   {
00041 
00049     template <typename I>
00050     unsigned get(const Image<I>& ima);
00051 
00052 
00053 # ifndef MLN_INCLUDE_ONLY
00054 
00055     namespace impl
00056     {
00057 
00058       template <typename I>
00059       inline
00060       unsigned get_(trait::image::ext_domain::some, trait::image::category::primary,
00061                     const I& ima)
00062       {
00063         return ima.border();
00064       }
00065 
00066       template <typename I>
00067       inline
00068       unsigned get_(trait::image::ext_domain::some, trait::image::category::morpher,
00069                     const I& ima)
00070       {
00071         return border::get(*ima.delegatee_());
00072       }
00073 
00074 
00075       template <typename I>
00076       inline
00077       unsigned get_(trait::image::ext_domain::none, trait::image::category::any,
00078                     const I&)
00079       {
00080         return 0;
00081       }
00082 
00083     } 
00084 
00085 
00086     
00087 
00088     template <typename I>
00089     inline
00090     unsigned get(const Image<I>& ima)
00091     {
00092       trace::entering("border::get");
00093 
00094       mln_precondition(exact(ima).is_valid());
00095       unsigned res = border::impl::get_(mln_trait_image_ext_domain(I)(),
00096                                         mln_trait_image_category(I)(),
00097                                         exact(ima));
00098 
00099       trace::exiting("border::get");
00100       return res;
00101     }
00102 
00103 # endif // ! MLN_INCLUDE_ONLY
00104 
00105   } 
00106 
00107 } 
00108 
00109 
00110 #endif // ! MLN_BORDER_GET_HH