TuttleOFX
1
|
00001 #include "DummyPluginFactory.hpp" 00002 #include "DummyPlugin.hpp" 00003 #include "DummyDefinitions.hpp" 00004 #include "ofxsImageEffect.h" 00005 00006 #include <limits> 00007 00008 namespace tuttle { 00009 namespace plugin { 00010 namespace dummy { 00011 00012 static const bool kSupportTiles = false; 00013 00014 00015 /** 00016 * @brief Function called to describe the plugin main features. 00017 * @param[in, out] desc Effect descriptor 00018 */ 00019 void DummyPluginFactory::describe( OFX::ImageEffectDescriptor& desc ) 00020 { 00021 desc.setLabels( 00022 "TuttleDummy", 00023 "Dummy", 00024 "Tuttle Dummy Node" ); 00025 desc.setPluginGrouping( "tuttle/image/tool" ); 00026 00027 desc.setDescription( "Dummy node." ); 00028 00029 // add the supported contexts, only filter at the moment 00030 desc.addSupportedContext( OFX::eContextGeneral ); 00031 00032 // add supported pixel depths 00033 desc.addSupportedBitDepth( OFX::eBitDepthUByte ); 00034 desc.addSupportedBitDepth( OFX::eBitDepthUShort ); 00035 desc.addSupportedBitDepth( OFX::eBitDepthFloat ); 00036 00037 // plugin flags 00038 desc.setSupportsTiles( kSupportTiles ); 00039 desc.setRenderThreadSafety( OFX::eRenderFullySafe ); 00040 } 00041 00042 /** 00043 * @brief Function called to describe the plugin controls and features. 00044 * @param[in, out] desc Effect descriptor 00045 * @param[in] context Application context 00046 */ 00047 void DummyPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc, 00048 OFX::EContext context ) 00049 { 00050 OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName ); 00051 srcClip->addSupportedComponent( OFX::ePixelComponentRGBA ); 00052 srcClip->addSupportedComponent( OFX::ePixelComponentRGB ); 00053 srcClip->addSupportedComponent( OFX::ePixelComponentAlpha ); 00054 srcClip->setSupportsTiles( kSupportTiles ); 00055 00056 // Create the mandated output clip 00057 OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName ); 00058 dstClip->addSupportedComponent( OFX::ePixelComponentRGBA ); 00059 dstClip->addSupportedComponent( OFX::ePixelComponentRGB ); 00060 dstClip->addSupportedComponent( OFX::ePixelComponentAlpha ); 00061 dstClip->setSupportsTiles( kSupportTiles ); 00062 00063 OFX::StringParamDescriptor* orginalNode = desc.defineStringParam( "originalnode" ); 00064 orginalNode->setLabel( "Original Node Name" ); 00065 00066 OFX::StringParamDescriptor* expression = desc.defineStringParam( "expression" ); 00067 expression->setLabel( "Expression" ); 00068 } 00069 00070 /** 00071 * @brief Function called to create a plugin effect instance 00072 * @param[in] handle Effect handle 00073 * @param[in] context Application context 00074 * @return plugin instance 00075 */ 00076 OFX::ImageEffect* DummyPluginFactory::createInstance( OfxImageEffectHandle handle, 00077 OFX::EContext context ) 00078 { 00079 return new DummyPlugin( handle ); 00080 } 00081 00082 } 00083 } 00084 } 00085