TuttleOFX
1
|
00001 #include "LutPluginFactory.hpp" 00002 #include "LutPlugin.hpp" 00003 #include "LutDefinitions.hpp" 00004 00005 #include <tuttle/plugin/exceptions.hpp> 00006 00007 #include <ofxsImageEffect.h> 00008 #include <ofxsMultiThread.h> 00009 00010 namespace tuttle { 00011 namespace plugin { 00012 namespace lut { 00013 00014 /** 00015 * @brief Function called to describe the plugin main features. 00016 * @param[in, out] desc Effect descriptor 00017 */ 00018 void LutPluginFactory::describe( OFX::ImageEffectDescriptor& desc ) 00019 { 00020 desc.setLabels( "TuttleLut", "Lut", "Color transformation through CLUT file" ); 00021 desc.setPluginGrouping( "tuttle/image/process/color" ); 00022 00023 desc.setDescription( "Image Luter is used to lut components of an image." ); 00024 00025 // add the supported contexts 00026 desc.addSupportedContext( OFX::eContextGeneral ); 00027 desc.addSupportedContext( OFX::eContextFilter ); 00028 00029 // add supported pixel depths 00030 desc.addSupportedBitDepth( OFX::eBitDepthUByte ); 00031 desc.addSupportedBitDepth( OFX::eBitDepthUShort ); 00032 desc.addSupportedBitDepth( OFX::eBitDepthFloat ); 00033 00034 desc.setSupportsTiles( kSupportTiles ); 00035 //desc.setRenderThreadSafety( OFX::eRenderFullySafe ); //< @todo tuttle: remove process data from LutPlugin 00036 } 00037 00038 /** 00039 * @brief Function called to describe the plugin controls and features. 00040 * @param[in, out] desc Effect descriptor 00041 * @param[in] context Application context 00042 */ 00043 void LutPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc, OFX::EContext context ) 00044 { 00045 OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName ); 00046 srcClip->addSupportedComponent( OFX::ePixelComponentRGBA ); 00047 srcClip->addSupportedComponent( OFX::ePixelComponentRGB ); 00048 srcClip->addSupportedComponent( OFX::ePixelComponentAlpha ); 00049 srcClip->setSupportsTiles( kSupportTiles ); 00050 00051 OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName ); 00052 dstClip->addSupportedComponent( OFX::ePixelComponentRGBA ); 00053 dstClip->addSupportedComponent( OFX::ePixelComponentRGB ); 00054 dstClip->addSupportedComponent( OFX::ePixelComponentAlpha ); 00055 dstClip->setSupportsTiles( kSupportTiles ); 00056 00057 // Controls 00058 OFX::StringParamDescriptor* filename = desc.defineStringParam( kTuttlePluginFilename ); 00059 filename->setDefault( "" ); 00060 filename->setLabels( kTuttlePluginFilenameLabel, kTuttlePluginFilenameLabel, kTuttlePluginFilenameLabel ); 00061 filename->setStringType( OFX::eStringTypeFilePath ); 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* LutPluginFactory::createInstance( OfxImageEffectHandle handle, OFX::EContext context ) 00071 { 00072 return new LutPlugin( handle ); 00073 } 00074 00075 } 00076 } 00077 }