TuttleOFX
1
|
00001 #include "DebugImageEffectApiPluginFactory.hpp" 00002 #include "DebugImageEffectApiPlugin.hpp" 00003 #include "DebugImageEffectApiDefinitions.hpp" 00004 00005 #include <tuttle/plugin/ImageGilProcessor.hpp> 00006 00007 namespace tuttle { 00008 namespace plugin { 00009 namespace debugImageEffectApi { 00010 00011 /** 00012 * @brief Function called to describe the plugin main features. 00013 * @param[in, out] desc Effect descriptor 00014 */ 00015 void DebugImageEffectApiPluginFactory::describe( OFX::ImageEffectDescriptor& desc ) 00016 { 00017 desc.setLabels( "TuttleDebugImageEffectApi", "DebugImageEffectApi", 00018 "Plugin which displays informations about the host and all plugin inputs." ); 00019 desc.setPluginGrouping( "tuttle/param/debug" ); 00020 00021 // add the supported contexts 00022 desc.addSupportedContext( OFX::eContextGeneral ); 00023 00024 // add supported pixel depths 00025 desc.addSupportedBitDepth( OFX::eBitDepthUByte ); 00026 desc.addSupportedBitDepth( OFX::eBitDepthUShort ); 00027 desc.addSupportedBitDepth( OFX::eBitDepthFloat ); 00028 00029 // plugin flags 00030 desc.setSingleInstance( false ); 00031 desc.setHostFrameThreading( true ); 00032 desc.setSupportsMultiResolution( false ); 00033 desc.setSupportsTiles( kSupportTiles ); 00034 desc.setTemporalClipAccess( kSupportTemporalClipAccess ); 00035 desc.setRenderTwiceAlways( false ); 00036 desc.setSupportsMultipleClipPARs( false ); 00037 } 00038 00039 /** 00040 * @brief Function called to describe the plugin controls and features. 00041 * @param[in, out] desc Effect descriptor 00042 * @param[in] context Application context 00043 */ 00044 void DebugImageEffectApiPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc, 00045 OFX::EContext context ) 00046 { 00047 OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName ); 00048 00049 srcClip->addSupportedComponent( OFX::ePixelComponentRGBA ); 00050 srcClip->addSupportedComponent( OFX::ePixelComponentAlpha ); 00051 srcClip->setSupportsTiles( kSupportTiles ); 00052 00053 // Create the mandated output clip 00054 OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName ); 00055 dstClip->addSupportedComponent( OFX::ePixelComponentRGBA ); 00056 dstClip->addSupportedComponent( OFX::ePixelComponentAlpha ); 00057 dstClip->setSupportsTiles( kSupportTiles ); 00058 00059 OFX::StringParamDescriptor* hostInfos = desc.defineStringParam( kHostInfos ); 00060 hostInfos->setLabel( "Host infos" ); 00061 hostInfos->setStringType( OFX::eStringTypeMultiLine ); 00062 hostInfos->setEvaluateOnChange( false ); 00063 00064 OFX::DoubleParamDescriptor* currentTime = desc.defineDoubleParam( kCurrentTime ); 00065 currentTime->setLabel( "Current time" ); 00066 currentTime->setDefault( 0 ); 00067 currentTime->setEvaluateOnChange( false ); 00068 00069 OFX::DoubleParamDescriptor* beginTime = desc.defineDoubleParam( kBeginTime ); 00070 beginTime->setLabel( "Begin time" ); 00071 beginTime->setDefault( 0 ); 00072 beginTime->setEvaluateOnChange( false ); 00073 00074 OFX::DoubleParamDescriptor* endTime = desc.defineDoubleParam( kEndTime ); 00075 endTime->setLabel( "End time" ); 00076 endTime->setDefault( 0 ); 00077 endTime->setEvaluateOnChange( false ); 00078 00079 OFX::PushButtonParamDescriptor* goTo = desc.definePushButtonParam( kGoTo ); 00080 goTo->setLabel( "Go to" ); 00081 00082 OFX::PushButtonParamDescriptor* update = desc.definePushButtonParam( kUpdate ); 00083 update->setLabel( "Update" ); 00084 } 00085 00086 /** 00087 * @brief Function called to create a plugin effect instance 00088 * @param[in] handle effect handle 00089 * @param[in] context Application context 00090 * @return plugin instance 00091 */ 00092 OFX::ImageEffect* DebugImageEffectApiPluginFactory::createInstance( OfxImageEffectHandle handle, 00093 OFX::EContext context ) 00094 { 00095 return new DebugImageEffectApiPlugin( handle ); 00096 } 00097 00098 } 00099 } 00100 }