00001 #ifndef IMAGE_OUTPUT_H 00002 #define IMAGE_OUTPUT_H 00003 00004 #include "image.h" 00005 00006 namespace mimas { 00007 00032 template< typename T > 00033 class image_output: public object 00034 { 00035 public: 00037 image_output(void): state(true) {} 00041 virtual void write( const const_image_ref< T > &image ) = 0; 00043 operator bool(void) const { return state; } 00045 bool operator!(void) const { return !state; } 00046 protected: 00048 bool state; 00049 }; 00050 00052 template< typename T, typename TPtr > 00053 inline image_output< T > &operator<<( image_output< T > &output, 00054 const const_image_ref< T, TPtr > &image ) 00055 { output.write( image ); return output; } 00056 00058 00060 00061 }; 00062 00063 #endif