TuttleOFX
1
|
00001 #ifndef _TUTTLE_PLUGIN_BLUR_PLUGIN_HPP_ 00002 #define _TUTTLE_PLUGIN_BLUR_PLUGIN_HPP_ 00003 00004 #include "BlurDefinitions.hpp" 00005 #include <tuttle/plugin/ImageEffectGilPlugin.hpp> 00006 00007 #include <terry/filter/convolve.hpp> 00008 00009 #include <boost/gil/gil_all.hpp> 00010 00011 namespace tuttle { 00012 namespace plugin { 00013 namespace blur { 00014 00015 template<typename Scalar> 00016 struct BlurProcessParams 00017 { 00018 typedef typename terry::filter::kernel_1d<Scalar> Kernel; 00019 terry::point2<double> _size; 00020 EParamBorder _border; 00021 terry::filter::convolve_boundary_option _boundary_option; 00022 00023 Kernel _gilKernelX; 00024 Kernel _gilKernelY; 00025 }; 00026 00027 /** 00028 * @brief Blur plugin 00029 */ 00030 class BlurPlugin : public ImageEffectGilPlugin 00031 { 00032 typedef float Scalar; 00033 00034 public: 00035 BlurPlugin( OfxImageEffectHandle handle ); 00036 00037 public: 00038 BlurProcessParams<Scalar> getProcessParams( const OfxPointD& renderScale = OFX::kNoRenderScale ) const; 00039 00040 // void changedParam( const OFX::InstanceChangedArgs &args, const std::string ¶mName ); 00041 00042 bool getRegionOfDefinition( const OFX::RegionOfDefinitionArguments& args, OfxRectD& rod ); 00043 void getRegionsOfInterest( const OFX::RegionsOfInterestArguments& args, OFX::RegionOfInterestSetter& rois ); 00044 bool isIdentity( const OFX::RenderArguments& args, OFX::Clip*& identityClip, double& identityTime ); 00045 00046 void render( const OFX::RenderArguments& args ); 00047 00048 public: 00049 OFX::Double2DParam* _paramSize; 00050 OFX::ChoiceParam* _paramBorder; 00051 OFX::BooleanParam* _paramNormalizedKernel; 00052 OFX::DoubleParam* _paramKernelEpsilon; 00053 }; 00054 00055 } 00056 } 00057 } 00058 00059 #endif