00001 #ifndef IMAGE_INPUT_H 00002 #define IMAGE_INPUT_H 00003 00004 #include "mimasexception.h" 00005 #include "image.h" 00006 00007 namespace mimas { 00008 00035 template< typename T > 00036 class image_input: public object 00037 { 00038 public: 00041 image_input(void): state( true ) {} 00046 virtual void read( image< T > &img ) throw (mimasexception) = 0; 00048 operator bool(void) const { return state; } 00050 bool operator!(void) const { return !state; } 00051 protected: 00053 bool state; 00054 }; 00055 00057 template< typename T > 00058 inline image_input< T > &operator>>( image_input< T > &input, 00059 image< T > &img ) 00060 { input.read( img ); return input; } 00061 00063 00065 00066 }; 00067 00068 #endif