TuttleOFX  1
ResizePlugin.hpp
Go to the documentation of this file.
00001 #ifndef _TUTTLE_PLUGIN_RESIZE_PLUGIN_HPP_
00002 #define _TUTTLE_PLUGIN_RESIZE_PLUGIN_HPP_
00003 
00004 #include "ResizeDefinitions.hpp"
00005 
00006 #include <tuttle/plugin/ImageEffectGilPlugin.hpp>
00007 #include <tuttle/plugin/context/SamplerPlugin.hpp>
00008 
00009 namespace tuttle {
00010 namespace plugin {
00011 namespace resize {
00012 
00013 template<typename Scalar>
00014 struct ResizeProcessParams
00015 {
00016         bool                                       _changeCenter;
00017         boost::gil::point2<Scalar>                 _centerPoint;
00018 
00019         SamplerProcessParams                       _samplerProcessParams;
00020 };
00021 
00022 /**
00023  * @brief Resize plugin
00024  */
00025 class ResizePlugin : public SamplerPlugin
00026 {
00027 public:
00028         typedef float Scalar;
00029         typedef boost::gil::point2<double> Point2;
00030 
00031 public:
00032         ResizePlugin( OfxImageEffectHandle handle );
00033 
00034 public:
00035         ResizeProcessParams<Scalar> getProcessParams( const OfxPointD& renderScale = OFX::kNoRenderScale ) const;
00036 
00037         void updateVisibleTools();
00038 
00039         void changedParam          ( const OFX::InstanceChangedArgs &args, const std::string &paramName );
00040 
00041         bool getRegionOfDefinition ( const OFX::RegionOfDefinitionArguments& args, OfxRectD& rod );
00042         void getRegionsOfInterest  ( const OFX::RegionsOfInterestArguments& args, OFX::RegionOfInterestSetter& rois );
00043         bool isIdentity            ( const OFX::RenderArguments& args, OFX::Clip*& identityClip, double& identityTime );
00044 
00045         void render                ( const OFX::RenderArguments &args );
00046 
00047 public:
00048         OFX::ChoiceParam*       _paramMode;
00049 
00050         OFX::ChoiceParam*       _paramFormat;
00051 
00052         OFX::Int2DParam*        _paramSize;
00053         OFX::IntParam*          _paramSizeWidth;
00054         OFX::IntParam*          _paramSizeHeight;
00055         OFX::BooleanParam*      _paramSizeKeepRatio;
00056         OFX::ChoiceParam*       _paramSizeOrientation;
00057         
00058         OFX::Double2DParam*     _paramScale;
00059 
00060         OFX::BooleanParam*      _paramCenter;
00061         OFX::Double2DParam*     _paramCenterPoint;
00062 };
00063 
00064 }
00065 }
00066 }
00067 
00068 #endif