TuttleOFX  1
PngReaderPluginFactory.cpp
Go to the documentation of this file.
00001 #include "PngReaderPluginFactory.hpp"
00002 #include "PngReaderDefinitions.hpp"
00003 #include "PngReaderPlugin.hpp"
00004 
00005 #include <tuttle/plugin/context/ReaderPluginFactory.hpp>
00006 
00007 namespace tuttle {
00008 namespace plugin {
00009 namespace png {
00010 namespace reader {
00011 
00012 /**
00013  * @brief Function called to describe the plugin main features.
00014  * @param[in, out]   desc     Effect descriptor
00015  */
00016 void PngReaderPluginFactory::describe( OFX::ImageEffectDescriptor& desc )
00017 {
00018     desc.setLabels( "TuttlePngReader", "PngReader",
00019                     "Png file reader" );
00020     desc.setPluginGrouping( "tuttle/image/io" );
00021 
00022     desc.setDescription( "PNG File reader\n"
00023                          "Plugin is used to read png files.\n\n"
00024                          "supported extensions:\n"
00025                          "png" );
00026 
00027     // add the supported contexts
00028     desc.addSupportedContext( OFX::eContextReader );
00029     desc.addSupportedContext( OFX::eContextGeneral );
00030 
00031     // add supported pixel depths
00032     desc.addSupportedBitDepth( OFX::eBitDepthUByte );
00033     desc.addSupportedBitDepth( OFX::eBitDepthUShort );
00034     desc.addSupportedBitDepth( OFX::eBitDepthFloat );
00035 
00036     // add supported extensions
00037     desc.addSupportedExtension( "png" );
00038 
00039     // plugin flags
00040     desc.setRenderThreadSafety( OFX::eRenderFullySafe );
00041     desc.setHostFrameThreading( false );
00042     desc.setSupportsMultiResolution( false );
00043     desc.setSupportsMultipleClipDepths( true );
00044     desc.setSupportsTiles( kSupportTiles );
00045 }
00046 
00047 /**
00048  * @brief Function called to describe the plugin controls and features.
00049  * @param[in, out]   desc       Effect descriptor
00050  * @param[in]        context    Application context
00051  */
00052 void PngReaderPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
00053                                                 OFX::EContext               context )
00054 {
00055     // Create the mandated output clip
00056     OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName );
00057     dstClip->addSupportedComponent( OFX::ePixelComponentRGBA );
00058     dstClip->addSupportedComponent( OFX::ePixelComponentRGB );
00059     dstClip->addSupportedComponent( OFX::ePixelComponentAlpha );
00060     dstClip->setSupportsTiles( kSupportTiles );
00061 
00062     describeReaderParamsInContext( desc, context );
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* PngReaderPluginFactory::createInstance( OfxImageEffectHandle handle,
00072                                                           OFX::EContext        context )
00073 {
00074     return new PngReaderPlugin( handle );
00075 }
00076 
00077 }
00078 }
00079 }
00080 }