00001 #ifndef vnl_identity_h_ 00002 #define vnl_identity_h_ 00003 // This is vxl/vnl/vnl_identity.h 00004 00005 //: \file 00006 // \author Andrew W. Fitzgibbon, Oxford RRG, 07 Dec 98 00007 00008 // Modification 00009 // LSB (Manchester) 23/1/01 Tidied documentation 00010 //----------------------------------------------------------------------------- 00011 00012 #include <vnl/vnl_unary_function.h> 00013 00014 template <class T> 00015 class vnl_identity : public vnl_unary_function<T,T> { 00016 public: 00017 vnl_unary_function<T,T>* Copy() const { 00018 vnl_identity<T>* copy = new vnl_identity<T>; 00019 *copy = *this; 00020 return copy; 00021 } 00022 00023 T f(T const& x) { 00024 return x; 00025 } 00026 }; 00027 00028 #endif // vnl_identity_h_