TuttleOFX  1
Move2DPluginFactory.cpp
Go to the documentation of this file.
00001 #include "Move2DPluginFactory.hpp"
00002 #include "Move2DPlugin.hpp"
00003 #include "Move2DDefinitions.hpp"
00004 
00005 #include <limits>
00006 
00007 namespace tuttle {
00008 namespace plugin {
00009 namespace move2D {
00010 
00011 static const bool kSupportTiles = true;
00012 
00013 
00014 /**
00015  * @brief Function called to describe the plugin main features.
00016  * @param[in, out] desc Effect descriptor
00017  */
00018 void Move2DPluginFactory::describe( OFX::ImageEffectDescriptor& desc )
00019 {
00020         desc.setLabels(
00021                 "TuttleMove2D",
00022                 "Move2D",
00023                 "Move2D"
00024                 );
00025         desc.setPluginGrouping( "tuttle/image/process/geometry" );
00026 
00027         // add the supported contexts, only filter at the moment
00028         desc.addSupportedContext( OFX::eContextFilter );
00029         desc.addSupportedContext( OFX::eContextGeneral );
00030 
00031         // add supported pixel depths
00032         desc.addSupportedBitDepth( OFX::eBitDepthUByte );
00033         desc.addSupportedBitDepth( OFX::eBitDepthUShort );
00034         desc.addSupportedBitDepth( OFX::eBitDepthFloat );
00035 
00036         // plugin flags
00037         desc.setSupportsTiles( kSupportTiles );
00038         desc.setRenderThreadSafety( OFX::eRenderFullySafe );
00039 }
00040 
00041 /**
00042  * @brief Function called to describe the plugin controls and features.
00043  * @param[in, out]   desc       Effect descriptor
00044  * @param[in]        context    Application context
00045  */
00046 void Move2DPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
00047                                                   OFX::EContext context )
00048 {
00049         OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName );
00050         srcClip->addSupportedComponent( OFX::ePixelComponentRGBA );
00051         srcClip->addSupportedComponent( OFX::ePixelComponentRGB );
00052         srcClip->addSupportedComponent( OFX::ePixelComponentAlpha );
00053         srcClip->setSupportsTiles( kSupportTiles );
00054 
00055         // Create the mandated output clip
00056         OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName );
00057         dstClip->addSupportedComponent( OFX::ePixelComponentRGBA );
00058         dstClip->addSupportedComponent( OFX::ePixelComponentRGB );
00059         dstClip->addSupportedComponent( OFX::ePixelComponentAlpha );
00060         dstClip->setSupportsTiles( kSupportTiles );
00061 
00062         OFX::Double2DParamDescriptor* translation = desc.defineDouble2DParam( kParamTranslation );
00063         translation->setLabel( "Translation" );
00064         translation->setDefault( 0, 0 );
00065 
00066 }
00067 
00068 /**
00069  * @brief Function called to create a plugin effect instance
00070  * @param[in] handle  Effect handle
00071  * @param[in] context Application context
00072  * @return  plugin instance
00073  */
00074 OFX::ImageEffect* Move2DPluginFactory::createInstance( OfxImageEffectHandle handle,
00075                                                             OFX::EContext context )
00076 {
00077         return new Move2DPlugin( handle );
00078 }
00079 
00080 }
00081 }
00082 }
00083