TuttleOFX
1
|
00001 #ifndef _TUTTLE_PLUGIN_DIFF_PROCESS_HPP_ 00002 #define _TUTTLE_PLUGIN_DIFF_PROCESS_HPP_ 00003 00004 #include <terry/globals.hpp> 00005 #include <tuttle/plugin/ImageGilFilterProcessor.hpp> 00006 #include <tuttle/plugin/exceptions.hpp> 00007 00008 #include <boost/scoped_ptr.hpp> 00009 00010 namespace tuttle { 00011 namespace plugin { 00012 namespace quality { 00013 00014 /** 00015 * @brief Diff process 00016 * 00017 */ 00018 template<class View> 00019 class DiffProcess : public ImageGilProcessor<View> 00020 { 00021 typedef typename boost::gil::pixel<boost::gil::bits32f, boost::gil::layout<typename boost::gil::color_space_type<View>::type> > PixelF; 00022 00023 protected: 00024 DiffPlugin& _plugin; ///< Rendering plugin 00025 DiffProcessParams _params; ///< Rendering parameters 00026 View _srcViewA; ///< Source view A 00027 View _srcViewB; ///< Source view B 00028 boost::scoped_ptr<OFX::Image> _srcA; 00029 boost::scoped_ptr<OFX::Image> _srcB; 00030 OfxRectI _srcPixelRodA; 00031 OfxRectI _srcPixelRodB; 00032 00033 public: 00034 DiffProcess( DiffPlugin& instance ); 00035 void setup( const OFX::RenderArguments& args ); 00036 00037 // Do some processing 00038 void multiThreadProcessImages( const OfxRectI& procWindowRoW ); 00039 template<class SView> 00040 boost::gil::pixel<boost::gil::bits32f, boost::gil::layout<typename boost::gil::color_space_type<SView>::type> >mse( const SView& v1, const SView& v2, const SView& dst, bool outputIsPsnr = false ); 00041 template<class SView> 00042 boost::gil::pixel<boost::gil::bits32f, boost::gil::layout<typename boost::gil::color_space_type<SView>::type> >psnr( const SView& v1, const SView& v2, const SView& dst ); 00043 }; 00044 00045 } 00046 } 00047 } 00048 00049 #include "DiffProcess.tcc" 00050 00051 #endif