TuttleOFX
1
|
00001 #include "ColorBarsPluginFactory.hpp" 00002 #include "ColorBarsPlugin.hpp" 00003 #include "ColorBarsDefinitions.hpp" 00004 #include "ofxsImageEffect.h" 00005 00006 #include <tuttle/plugin/context/GeneratorPluginFactory.hpp> 00007 00008 namespace tuttle { 00009 namespace plugin { 00010 namespace colorBars { 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 ColorBarsPluginFactory::describe( OFX::ImageEffectDescriptor& desc ) 00020 { 00021 desc.setLabels( 00022 "TuttleColorBars", 00023 "ColorBars", 00024 "ColorBars" ); 00025 desc.setPluginGrouping( "tuttle/image/generator" ); 00026 00027 desc.setDescription( "Color Bars generator." ); 00028 00029 // add the supported contexts 00030 desc.addSupportedContext( OFX::eContextGenerator ); 00031 desc.addSupportedContext( OFX::eContextGeneral ); 00032 00033 // add supported pixel depths 00034 desc.addSupportedBitDepth( OFX::eBitDepthUByte ); 00035 desc.addSupportedBitDepth( OFX::eBitDepthUShort ); 00036 desc.addSupportedBitDepth( OFX::eBitDepthFloat ); 00037 00038 // plugin flags 00039 desc.setRenderThreadSafety( OFX::eRenderFullySafe ); 00040 desc.setHostFrameThreading( false ); 00041 desc.setSupportsMultiResolution( false ); 00042 desc.setSupportsMultipleClipDepths( true ); 00043 desc.setSupportsTiles( kSupportTiles ); 00044 } 00045 00046 /** 00047 * @brief Function called to describe the plugin controls and features. 00048 * @param[in, out] desc Effect descriptor 00049 * @param[in] context Application context 00050 */ 00051 void ColorBarsPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc, 00052 OFX::EContext context ) 00053 { 00054 describeGeneratorParamsInContext( desc, context ); 00055 00056 OFX::ChoiceParamDescriptor* levels = desc.defineChoiceParam( kColorBarsLevels ); 00057 levels->setLabel( "Levels" ); 00058 levels->appendOption( kColorBarsLevels100 ); 00059 levels->appendOption( kColorBarsLevels75 ); 00060 levels->setDefault( eColorBarsLevels75 ); 00061 00062 } 00063 00064 /** 00065 * @brief Function called to create a plugin effect instance 00066 * @param[in] handle Effect handle 00067 * @param[in] context Application context 00068 * @return plugin instance 00069 */ 00070 OFX::ImageEffect* ColorBarsPluginFactory::createInstance( OfxImageEffectHandle handle, 00071 OFX::EContext context ) 00072 { 00073 return new ColorBarsPlugin( handle ); 00074 } 00075 00076 } 00077 } 00078 } 00079