TuttleOFX
1
|
00001 #include "PngWriterPluginFactory.hpp" 00002 #include "PngWriterDefinitions.hpp" 00003 #include "PngWriterPlugin.hpp" 00004 00005 #include <tuttle/plugin/context/WriterPluginFactory.hpp> 00006 00007 namespace tuttle { 00008 namespace plugin { 00009 namespace png { 00010 namespace writer { 00011 00012 /** 00013 * @brief Function called to describe the plugin main features. 00014 * @param[in, out] desc Effect descriptor 00015 */ 00016 void PngWriterPluginFactory::describe( OFX::ImageEffectDescriptor& desc ) 00017 { 00018 desc.setLabels( "TuttlePngWriter", "PngWriter", 00019 "Png file writer" ); 00020 desc.setPluginGrouping( "tuttle/image/io" ); 00021 desc.setDescription( "PNG File writer\n" 00022 "Plugin is used to read png files.\n\n" 00023 "supported extensions:\n" 00024 "png" ); 00025 00026 // add the supported contexts 00027 desc.addSupportedContext( OFX::eContextWriter ); 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 // add supported extensions 00036 desc.addSupportedExtension( "png" ); 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 PngWriterPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc, 00052 OFX::EContext context ) 00053 { 00054 OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName ); 00055 00056 srcClip->addSupportedComponent( OFX::ePixelComponentRGBA ); 00057 srcClip->addSupportedComponent( OFX::ePixelComponentRGB ); 00058 srcClip->addSupportedComponent( OFX::ePixelComponentAlpha ); 00059 srcClip->setSupportsTiles( kSupportTiles ); 00060 00061 OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName ); 00062 dstClip->addSupportedComponent( OFX::ePixelComponentRGBA ); 00063 dstClip->addSupportedComponent( OFX::ePixelComponentRGB ); 00064 dstClip->addSupportedComponent( OFX::ePixelComponentAlpha ); 00065 dstClip->setSupportsTiles( kSupportTiles ); 00066 00067 describeWriterParamsInContext( desc, context ); 00068 } 00069 00070 /** 00071 * @brief Function called to create a plugin effect instance 00072 * @param[in] handle effect handle 00073 * @param[in] context Application context 00074 * @return plugin instance 00075 */ 00076 OFX::ImageEffect* PngWriterPluginFactory::createInstance( OfxImageEffectHandle handle, 00077 OFX::EContext context ) 00078 { 00079 return new PngWriterPlugin( handle ); 00080 } 00081 00082 } 00083 } 00084 } 00085 }