TuttleOFX
1
|
00001 #include "Jpeg2000ReaderPluginFactory.hpp" 00002 #include "Jpeg2000ReaderPlugin.hpp" 00003 #include "Jpeg2000ReaderDefinitions.hpp" 00004 00005 #include <tuttle/plugin/context/ReaderPluginFactory.hpp> 00006 00007 namespace tuttle { 00008 namespace plugin { 00009 namespace jpeg2000 { 00010 namespace reader { 00011 00012 00013 /** 00014 * @brief Function called to describe the plugin main features. 00015 * @param[in, out] desc Effect descriptor 00016 */ 00017 void Jpeg2000ReaderPluginFactory::describe( OFX::ImageEffectDescriptor &desc ) 00018 { 00019 desc.setLabels( 00020 "TuttleJpeg2000Reader", 00021 "Jpeg2000Reader", 00022 "Jpeg2000 image reader" ); 00023 desc.setPluginGrouping( "tuttle/image/io" ); 00024 00025 desc.setDescription( 00026 "Jpeg2000 io.\n" 00027 "Plugin is used to read jpeg 2000 files." 00028 ); 00029 00030 // add the supported contexts 00031 desc.addSupportedContext( OFX::eContextReader ); 00032 desc.addSupportedContext( OFX::eContextGeneral ); 00033 00034 // add supported pixel depths 00035 desc.addSupportedBitDepth( OFX::eBitDepthUByte ); 00036 desc.addSupportedBitDepth( OFX::eBitDepthUShort ); 00037 desc.addSupportedBitDepth( OFX::eBitDepthFloat ); 00038 00039 // add supported extensions 00040 desc.addSupportedExtension( "j2k" ); 00041 //desc.addSupportedExtension( "jp2" ); 00042 //desc.addSupportedExtension( "j2c" ); 00043 00044 // plugin flags 00045 desc.setRenderThreadSafety( OFX::eRenderFullySafe ); 00046 desc.setHostFrameThreading( false ); 00047 desc.setSupportsMultiResolution( false ); 00048 desc.setSupportsMultipleClipDepths( true ); 00049 desc.setSupportsTiles( kSupportTiles ); 00050 } 00051 00052 /** 00053 * @brief Function called to describe the plugin controls and features. 00054 * @param[in, out] desc Effect descriptor 00055 * @param[in] context Application context 00056 */ 00057 void Jpeg2000ReaderPluginFactory::describeInContext( OFX::ImageEffectDescriptor &desc, 00058 OFX::EContext context ) 00059 { 00060 OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName ); 00061 dstClip->addSupportedComponent( OFX::ePixelComponentRGBA ); 00062 dstClip->addSupportedComponent( OFX::ePixelComponentRGB ); 00063 dstClip->addSupportedComponent( OFX::ePixelComponentAlpha ); 00064 dstClip->setSupportsTiles( kSupportTiles ); 00065 00066 describeReaderParamsInContext( desc, context ); 00067 } 00068 00069 /** 00070 * @brief Function called to create a plugin effect instance 00071 * @param[in] handle effect handle 00072 * @param[in] context Application context 00073 * @return plugin instance 00074 */ 00075 OFX::ImageEffect* Jpeg2000ReaderPluginFactory::createInstance( OfxImageEffectHandle handle, 00076 OFX::EContext context ) 00077 { 00078 return new Jpeg2000ReaderPlugin(handle); 00079 } 00080 00081 } 00082 } 00083 } 00084 }