TuttleOFX
1
|
00001 #include "DPXReaderDefinitions.hpp" 00002 #include "DPXReaderPluginFactory.hpp" 00003 #include "DPXReaderPlugin.hpp" 00004 00005 #include <tuttle/plugin/context/ReaderPluginFactory.hpp> 00006 00007 namespace tuttle { 00008 namespace plugin { 00009 namespace dpx { 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 DPXReaderPluginFactory::describe( OFX::ImageEffectDescriptor& desc ) 00017 { 00018 desc.setLabels( "TuttleDpxReader", "DpxReader", 00019 "Dpx file reader" ); 00020 desc.setPluginGrouping( "tuttle/image/io" ); 00021 00022 desc.setDescription( "Digital Picture Exchange (DPX), ANSI/SMPTE standard (268M-2003)" ); 00023 00024 // add the supported contexts 00025 desc.addSupportedContext( OFX::eContextReader ); 00026 desc.addSupportedContext( OFX::eContextGeneral ); 00027 00028 // add supported pixel depths 00029 desc.addSupportedBitDepth( OFX::eBitDepthUByte ); 00030 desc.addSupportedBitDepth( OFX::eBitDepthUShort ); 00031 desc.addSupportedBitDepth( OFX::eBitDepthFloat ); 00032 00033 // add supported extensions 00034 desc.addSupportedExtension( "dpx" ); 00035 00036 // plugin flags 00037 desc.setRenderThreadSafety( OFX::eRenderFullySafe ); 00038 desc.setHostFrameThreading( false ); 00039 desc.setSupportsMultiResolution( false ); 00040 desc.setSupportsMultipleClipDepths( true ); 00041 desc.setSupportsTiles( kSupportTiles ); 00042 } 00043 00044 /** 00045 * @brief Function called to describe the plugin controls and features. 00046 * @param[in, out] desc Effect descriptor 00047 * @param[in] context Application context 00048 */ 00049 void DPXReaderPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc, 00050 OFX::EContext context ) 00051 { 00052 OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName ); 00053 // Dpx only supports RGB(A) 00054 dstClip->addSupportedComponent( OFX::ePixelComponentRGBA ); 00055 dstClip->addSupportedComponent( OFX::ePixelComponentRGB ); 00056 dstClip->setSupportsTiles( kSupportTiles ); 00057 00058 describeReaderParamsInContext( desc, context ); 00059 00060 OFX::PushButtonParamDescriptor* displayHeader = desc.definePushButtonParam( kParamDisplayHeader ); 00061 displayHeader->setLabel( "See Header" ); 00062 displayHeader->setHint( "See the file header without formating (debug purpose only)." ); 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* DPXReaderPluginFactory::createInstance( OfxImageEffectHandle handle, 00072 OFX::EContext context ) 00073 { 00074 return new DPXReaderPlugin( handle ); 00075 } 00076 00077 } 00078 } 00079 } 00080 }