TuttleOFX
1
|
00001 #ifndef _TUTTLE_PLUGIN_PUSHPIXELPLUGIN_HPP_ 00002 #define _TUTTLE_PLUGIN_PUSHPIXELPLUGIN_HPP_ 00003 00004 #include "PushPixelDefinitions.hpp" 00005 #include <ofxsImageEffect.h> 00006 #include <tuttle/common/utils/global.hpp> 00007 00008 #include <boost/gil/gil_all.hpp> 00009 #include <terry/filter/convolve.hpp> 00010 00011 namespace tuttle { 00012 namespace plugin { 00013 namespace pushPixel { 00014 00015 template<typename Scalar> 00016 struct PushPixelProcessParams 00017 { 00018 EParamOutput _output; 00019 double _intensity; 00020 double _angle; 00021 double _size; 00022 EParamInterpolation _interpolation; 00023 00024 EParamBorder _border; 00025 terry::filter::convolve_boundary_option _boundary_option; 00026 00027 terry::filter::kernel_1d<Scalar> _kernelGaussianDerivative; 00028 terry::filter::kernel_1d<Scalar> _kernelGaussian; 00029 }; 00030 00031 00032 /** 00033 * @brief PushPixel plugin 00034 */ 00035 class PushPixelPlugin : public OFX::ImageEffect 00036 { 00037 public: 00038 typedef float Scalar; 00039 public: 00040 PushPixelPlugin( OfxImageEffectHandle handle ); 00041 00042 public: 00043 PushPixelProcessParams<Scalar> getProcessParams( const OfxPointD& renderScale = OFX::kNoRenderScale ) const; 00044 00045 bool isIdentity( const OFX::RenderArguments& args, OFX::Clip*& identityClip, double& identityTime ); 00046 00047 void getRegionsOfInterest( const OFX::RegionsOfInterestArguments& args, OFX::RegionOfInterestSetter& rois ); 00048 00049 void render( const OFX::RenderArguments& args ); 00050 00051 public: 00052 // do not need to delete these, the ImageEffect is managing them for us 00053 OFX::Clip* _clipSrc; ///< Source image clip 00054 OFX::Clip* _clipMask; ///< Mask clip 00055 OFX::Clip* _clipDst; ///< Destination image clip 00056 00057 OFX::ChoiceParam* _paramOutput; 00058 OFX::DoubleParam* _paramSize; 00059 OFX::BooleanParam* _paramNormalizedKernel; 00060 OFX::DoubleParam* _paramIntensity; 00061 OFX::DoubleParam* _paramAngle; 00062 OFX::ChoiceParam* _paramInterpolation; ///< interpolation method 00063 OFX::ChoiceParam* _paramBorder; 00064 00065 }; 00066 00067 } 00068 } 00069 } 00070 00071 #endif