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_UTIL_GREATER_PSITE_HH
00027 # define MLN_UTIL_GREATER_PSITE_HH
00028 
00029 # include <mln/core/concept/image.hh>
00030 
00031 
00032 namespace mln {
00033 
00034   namespace util {
00035 
00041     template <typename I>
00042     class greater_psite
00043     {
00044     public:
00045       typedef mln_psite(I) psite;
00046 
00047       greater_psite(const Image<I>& ima);
00048 
00050       bool operator()(const psite& x, const psite& y);
00051 
00052     private:
00053       const I& ima_;
00054     };
00055 
00056 
00058     
00059     template <typename I>
00060     greater_psite<I>
00061     make_greater_psite(const Image<I>& ima);
00062 
00063 
00064 # ifndef MLN_INCLUDE_ONLY
00065 
00066     template <typename I>
00067     greater_psite<I>::greater_psite(const Image<I>& ima)
00068       : ima_ (exact(ima))
00069     {
00070     }
00071 
00072     template <typename I>
00073     bool
00074     greater_psite<I>::operator()(const psite& x, const psite& y)
00075     {
00076       return ima_(x) > ima_(y);
00077     }
00078 
00079 
00080     template <typename I>
00081     greater_psite<I>
00082     make_greater_psite(const Image<I>& ima)
00083     {
00084       return greater_psite<I>(ima);
00085     }
00086 
00087 # endif // ! MLN_INCLUDE_ONLY
00088 
00089   } 
00090 
00091 } 
00092 
00093 #endif // ! MLN_UTIL_GREATER_PSITE_HH