TuttleOFX
1
|
00001 #ifndef _EXRWRITER_PROCESS_HPP_ 00002 #define _EXRWRITER_PROCESS_HPP_ 00003 00004 #include <tuttle/plugin/ImageGilFilterProcessor.hpp> 00005 #include <tuttle/plugin/exceptions.hpp> 00006 00007 #include <terry/openexr/half.hpp> 00008 #include <terry/globals.hpp> 00009 00010 #include <ImfOutputFile.h> 00011 #include <ImfRgba.h> 00012 #include <ImfChannelList.h> 00013 #include <ImfArray.h> 00014 #include <ImathVec.h> 00015 00016 #include <boost/scoped_ptr.hpp> 00017 00018 namespace tuttle { 00019 namespace plugin { 00020 namespace exr { 00021 namespace writer { 00022 00023 /** 00024 * @brief Exr writer 00025 */ 00026 template<class View> 00027 class EXRWriterProcess : public ImageGilFilterProcessor<View> 00028 { 00029 public: 00030 typedef typename View::value_type Pixel; 00031 00032 public: 00033 EXRWriterProcess( EXRWriterPlugin& instance ); 00034 00035 void setup( const OFX::RenderArguments& args ); 00036 void multiThreadProcessImages( const OfxRectI& procWindowRoW ); 00037 00038 protected: 00039 EXRWriterPlugin& _plugin; ///< Rendering plugin 00040 EXRWriterProcessParams _params; 00041 00042 template<class WPixel> 00043 void writeGrayImage( View& src, std::string& filepath, Imf::PixelType pixType ); 00044 00045 template<class WPixel> 00046 void writeImage( View& src, std::string& filepath, Imf::PixelType pixType ); 00047 00048 }; 00049 00050 } 00051 } 00052 } 00053 } 00054 00055 #include "EXRWriterProcess.tcc" 00056 00057 #endif