TuttleOFX
1
|
00001 #ifndef _TUTTLE_PLUGIN_OPENIMAGEIO_READER_PROCESS_HPP_ 00002 #define _TUTTLE_PLUGIN_OPENIMAGEIO_READER_PROCESS_HPP_ 00003 00004 #include <tuttle/plugin/ImageGilProcessor.hpp> 00005 00006 #include <terry/globals.hpp> 00007 00008 #include <boost/scoped_ptr.hpp> 00009 #include <boost/filesystem/fstream.hpp> 00010 00011 #include <imageio.h> 00012 00013 namespace tuttle { 00014 namespace plugin { 00015 namespace openImageIO { 00016 namespace reader { 00017 00018 /** 00019 * 00020 */ 00021 template<class View> 00022 class OpenImageIOReaderProcess : public ImageGilProcessor<View> 00023 { 00024 typedef OpenImageIOReaderProcess<View> This; 00025 public: 00026 typedef typename terry::image_from_view<View>::type Image; 00027 typedef typename View::value_type Pixel; 00028 typedef typename boost::gil::channel_type<View>::type Channel; 00029 typedef typename View::point_t Point; 00030 typedef typename View::coord_t Coord; 00031 00032 protected: 00033 OpenImageIOReaderPlugin& _plugin; ///< Rendering plugin 00034 00035 public: 00036 OpenImageIOReaderProcess( OpenImageIOReaderPlugin& instance ); 00037 00038 void multiThreadProcessImages( const OfxRectI& procWindowRoW ); 00039 00040 template<typename bitDepth, typename layout, typename fileView> 00041 View& readImage( View& dst, boost::scoped_ptr<OpenImageIO::ImageInput>& img, int pixelSize ); 00042 00043 static bool progressCallback( void *opaque_data, float portion_done ) 00044 { 00045 This* this_ptr = reinterpret_cast<This*>(opaque_data); 00046 return this_ptr->progressUpdate( portion_done ); 00047 } 00048 }; 00049 00050 } 00051 } 00052 } 00053 } 00054 00055 #include "OpenImageIOReaderProcess.tcc" 00056 00057 #endif