TuttleOFX
1
|
00001 #include "ColorCubePluginFactory.hpp" 00002 #include "ColorCubePlugin.hpp" 00003 #include "ColorCubeDefinitions.hpp" 00004 #include "ofxsImageEffect.h" 00005 00006 #include <limits> 00007 00008 #include <tuttle/plugin/context/GeneratorPluginFactory.hpp> 00009 00010 namespace tuttle { 00011 namespace plugin { 00012 namespace colorCube { 00013 00014 static const bool kSupportTiles = false; 00015 00016 00017 /** 00018 * @brief Function called to describe the plugin main features. 00019 * @param[in, out] desc Effect descriptor 00020 */ 00021 void ColorCubePluginFactory::describe( OFX::ImageEffectDescriptor& desc ) 00022 { 00023 desc.setLabels( 00024 "TuttleColorCube", 00025 "ColorCube", 00026 "ColorCube" ); 00027 desc.setPluginGrouping( "tuttle/image/generator" ); 00028 00029 desc.setDescription( "Color Cube generator." ); 00030 00031 // add the supported contexts 00032 desc.addSupportedContext( OFX::eContextGenerator ); 00033 desc.addSupportedContext( OFX::eContextGeneral ); 00034 00035 // add supported pixel depths 00036 desc.addSupportedBitDepth( OFX::eBitDepthUByte ); 00037 desc.addSupportedBitDepth( OFX::eBitDepthUShort ); 00038 desc.addSupportedBitDepth( OFX::eBitDepthFloat ); 00039 00040 // plugin flags 00041 desc.setRenderThreadSafety( OFX::eRenderFullySafe ); 00042 desc.setHostFrameThreading( false ); 00043 desc.setSupportsMultiResolution( false ); 00044 desc.setSupportsMultipleClipDepths( true ); 00045 desc.setSupportsTiles( kSupportTiles ); 00046 } 00047 00048 /** 00049 * @brief Function called to describe the plugin controls and features. 00050 * @param[in, out] desc Effect descriptor 00051 * @param[in] context Application context 00052 */ 00053 void ColorCubePluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc, 00054 OFX::EContext context ) 00055 { 00056 describeGeneratorParamsInContext( desc, context ); 00057 00058 OFX::ChoiceParamDescriptor* step = desc.defineChoiceParam( kColorCubeStep ); 00059 step->setLabel( "Cubes" ); 00060 step->setHint( "Select cubes on the main Color Cube." ); 00061 step->appendOption( "4" ); 00062 step->appendOption( "8" ); 00063 step->appendOption( "16" ); 00064 step->appendOption( "32" ); 00065 step->appendOption( "64" ); 00066 step->appendOption( "128" ); 00067 step->appendOption( "256" ); 00068 step->appendOption( "512" ); 00069 step->appendOption( "1024" ); 00070 step->setDefault( 3 ); 00071 } 00072 00073 /** 00074 * @brief Function called to create a plugin effect instance 00075 * @param[in] handle Effect handle 00076 * @param[in] context Application context 00077 * @return plugin instance 00078 */ 00079 OFX::ImageEffect* ColorCubePluginFactory::createInstance( OfxImageEffectHandle handle, 00080 OFX::EContext context ) 00081 { 00082 return new ColorCubePlugin( handle ); 00083 } 00084 00085 } 00086 } 00087 } 00088