TuttleOFX  1
ConstantPluginFactory.cpp
Go to the documentation of this file.
00001 #include "ConstantPluginFactory.hpp"
00002 #include "ConstantPlugin.hpp"
00003 #include "ConstantDefinitions.hpp"
00004 
00005 #include <tuttle/plugin/context/GeneratorPluginFactory.hpp>
00006 #include <tuttle/plugin/exceptions.hpp>
00007 
00008 #include <ofxsImageEffect.h>
00009 #include <ofxsMultiThread.h>
00010 
00011 namespace tuttle {
00012 namespace plugin {
00013 namespace constant {
00014 
00015 /**
00016  * @brief Function called to describe the plugin main features.
00017  * @param[in, out]   desc     Effect descriptor
00018  */
00019 void ConstantPluginFactory::describe( OFX::ImageEffectDescriptor& desc )
00020 {
00021         desc.setLabels( "TuttleConstant", "Constant",
00022                         "Constant" );
00023         desc.setPluginGrouping( "tuttle/image/generator" );
00024 
00025         desc.setDescription(
00026             "Constant"
00027             "\n"
00028             "is a simple generator of a color."
00029         );
00030 
00031         // add the supported contexts
00032         desc.addSupportedContext( OFX::eContextGenerator );
00033         desc.addSupportedContext( OFX::eContextGeneral );
00034 
00035         // add supported pixel depths
00036         desc.addSupportedBitDepth( OFX::eBitDepthUByte );
00037         desc.addSupportedBitDepth( OFX::eBitDepthUShort );
00038         desc.addSupportedBitDepth( OFX::eBitDepthFloat );
00039 
00040         // plugin flags
00041         desc.setRenderThreadSafety( OFX::eRenderFullySafe );
00042         desc.setHostFrameThreading( false );
00043         desc.setSupportsMultiResolution( false );
00044         desc.setSupportsMultipleClipDepths( true );
00045         desc.setSupportsTiles( kSupportTiles );
00046 }
00047 
00048 /**
00049  * @brief Function called to describe the plugin controls and features.
00050  * @param[in, out]   desc       Effect descriptor
00051  * @param[in]        context    Application context
00052  */
00053 void ConstantPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
00054                                                OFX::EContext               context )
00055 {
00056         describeGeneratorParamsInContext( desc, context );
00057 
00058         OFX::RGBAParamDescriptor* color1 = desc.defineRGBAParam( kConstantColor );
00059         color1->setDefault( 0, 0, 0, 1 );
00060         color1->setLabel( "Color" );
00061 }
00062 
00063 /**
00064  * @brief Function called to create a plugin effect instance
00065  * @param[in] handle  effect handle
00066  * @param[in] context    Application context
00067  * @return  plugin instance
00068  */
00069 OFX::ImageEffect* ConstantPluginFactory::createInstance( OfxImageEffectHandle handle,
00070                                                          OFX::EContext        context )
00071 {
00072         return new ConstantPlugin( handle );
00073 }
00074 
00075 }
00076 }
00077 }