TuttleOFX
1
|
00001 #include "ViewerPluginFactory.hpp" 00002 #include "ViewerPlugin.hpp" 00003 #include "ViewerDefinitions.hpp" 00004 #include "ofxsImageEffect.h" 00005 00006 #include <limits> 00007 00008 namespace tuttle { 00009 namespace plugin { 00010 namespace viewer { 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 ViewerPluginFactory::describe( OFX::ImageEffectDescriptor& desc ) 00020 { 00021 desc.setLabels( "TuttleViewer", "Viewer", "Viewer" ); 00022 desc.setPluginGrouping( "tuttle/image/display" ); 00023 00024 desc.setDescription( kViewerHelp ); 00025 00026 // add the supported contexts, only filter at the moment 00027 desc.addSupportedContext( OFX::eContextFilter ); 00028 desc.addSupportedContext( OFX::eContextGeneral ); 00029 00030 // add supported pixel depths 00031 desc.addSupportedBitDepth( OFX::eBitDepthUByte ); 00032 desc.addSupportedBitDepth( OFX::eBitDepthUShort ); 00033 desc.addSupportedBitDepth( OFX::eBitDepthFloat ); 00034 00035 // plugin flags 00036 desc.setSupportsTiles( kSupportTiles ); 00037 desc.setRenderThreadSafety( OFX::eRenderFullySafe ); 00038 } 00039 00040 /** 00041 * @brief Function called to describe the plugin controls and features. 00042 * @param[in, out] desc Effect descriptor 00043 * @param[in] context Application context 00044 */ 00045 void ViewerPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc, 00046 OFX::EContext context ) 00047 { 00048 OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName ); 00049 srcClip->addSupportedComponent( OFX::ePixelComponentRGBA ); 00050 srcClip->addSupportedComponent( OFX::ePixelComponentRGB ); 00051 srcClip->addSupportedComponent( OFX::ePixelComponentAlpha ); 00052 srcClip->setSupportsTiles( kSupportTiles ); 00053 00054 // Create the mandated output clip 00055 OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName ); 00056 dstClip->addSupportedComponent( OFX::ePixelComponentRGBA ); 00057 dstClip->addSupportedComponent( OFX::ePixelComponentRGB ); 00058 dstClip->addSupportedComponent( OFX::ePixelComponentAlpha ); 00059 dstClip->setSupportsTiles( kSupportTiles ); 00060 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* ViewerPluginFactory::createInstance( OfxImageEffectHandle handle, 00070 OFX::EContext context ) 00071 { 00072 return new ViewerPlugin( handle ); 00073 } 00074 00075 } 00076 } 00077 } 00078