TuttleOFX
1
|
00001 #ifndef OPENIMAGEIO_WRITER_PROCESS_HPP 00002 #define OPENIMAGEIO_WRITER_PROCESS_HPP 00003 00004 #include <tuttle/plugin/global.hpp> 00005 #include <tuttle/plugin/ImageGilFilterProcessor.hpp> 00006 00007 #include <terry/globals.hpp> 00008 00009 namespace tuttle { 00010 namespace plugin { 00011 namespace openImageIO { 00012 namespace writer { 00013 00014 /** 00015 * @brief Base class for the denoising processor 00016 * 00017 */ 00018 template<class View> 00019 class OpenImageIOWriterProcess : public ImageGilFilterProcessor<View> 00020 { 00021 typedef OpenImageIOWriterProcess<View> This; 00022 00023 OpenImageIOWriterProcessParams params; 00024 00025 ETuttlePluginBitDepth getDefaultBitDepth(const std::string& filepath, const ETuttlePluginBitDepth &bitDepth); 00026 00027 public: 00028 typedef typename terry::image_from_view<View>::type Image; 00029 typedef typename View::value_type Pixel; 00030 typedef typename View::point_t Point; 00031 typedef typename View::coord_t Coord; 00032 00033 protected: 00034 OpenImageIOWriterPlugin& _plugin; ///< Rendering plugin 00035 00036 public: 00037 OpenImageIOWriterProcess( OpenImageIOWriterPlugin& instance ); 00038 00039 void multiThreadProcessImages( const OfxRectI& procWindowRoW ); 00040 00041 template<class WImage> 00042 void writeImage( View& src, const std::string& filepath, const ETuttlePluginBitDepth& bitDepth ); 00043 00044 static bool progressCallback( void *opaque_data, float portion_done ) 00045 { 00046 This* this_ptr = reinterpret_cast<This*>(opaque_data); 00047 return this_ptr->progressUpdate( portion_done ); 00048 } 00049 }; 00050 00051 } 00052 } 00053 } 00054 } 00055 00056 #include "OpenImageIOWriterProcess.tcc" 00057 00058 #endif