TuttleOFX  1
ColorWheelPluginFactory.cpp
Go to the documentation of this file.
00001 #include "ColorWheelPluginFactory.hpp"
00002 #include "ColorWheelPlugin.hpp"
00003 #include "ColorWheelDefinitions.hpp"
00004 #include "ofxsImageEffect.h"
00005 
00006 #include <tuttle/plugin/context/GeneratorPluginFactory.hpp>
00007 
00008 namespace tuttle {
00009 namespace plugin {
00010 namespace colorWheel {
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 ColorWheelPluginFactory::describe( OFX::ImageEffectDescriptor& desc )
00020 {
00021         desc.setLabels(
00022                 "TuttleColorWheel",
00023                 "ColorWheel",
00024                 "ColorWheel" );
00025         desc.setPluginGrouping( "tuttle/image/generator" );
00026 
00027         desc.setDescription( "Color Wheel generator." );
00028 
00029         // add the supported contexts, only filter at the moment
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 ColorWheelPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
00052                                                   OFX::EContext context )
00053 {
00054         describeGeneratorParamsInContext( desc, context );
00055 
00056     OFX::ChoiceParamDescriptor* mode = desc.defineChoiceParam( kColorWheelMode );
00057     mode->setLabel( "Type" );
00058     mode->setHint( "Select mode for the color wheel." );
00059     mode->appendOption( kColorWheelModeWhite );
00060     mode->appendOption( kColorWheelModeBlack );
00061     mode->appendOption( kColorWheelModeRainbow );
00062     mode->setDefault( 0 );
00063 }
00064 
00065 /**
00066  * @brief Function called to create a plugin effect instance
00067  * @param[in] handle  Effect handle
00068  * @param[in] context Application context
00069  * @return  plugin instance
00070  */
00071 OFX::ImageEffect* ColorWheelPluginFactory::createInstance( OfxImageEffectHandle handle,
00072                                                             OFX::EContext context )
00073 {
00074         return new ColorWheelPlugin( handle );
00075 }
00076 
00077 }
00078 }
00079 }
00080