TuttleOFX  1
TuttleOFX/libraries/tuttle/src/tuttle/plugin/context/ReaderPluginFactory.hpp
Go to the documentation of this file.
00001 #ifndef _TUTTLE_PLUGIN_READERPLUGINFACTORY_HPP_
00002 #define _TUTTLE_PLUGIN_READERPLUGINFACTORY_HPP_
00003 
00004 #include "ReaderDefinition.hpp"
00005 
00006 #include <tuttle/plugin/exceptions.hpp>
00007 
00008 #include <ofxsImageEffect.h>
00009 #include <ofxsMultiThread.h>
00010 
00011 namespace tuttle {
00012 namespace plugin {
00013 
00014 void describeReaderParamsInContext( OFX::ImageEffectDescriptor& desc,
00015                                     OFX::EContext               context )
00016 {
00017         OFX::StringParamDescriptor* filename = desc.defineStringParam( kTuttlePluginFilename );
00018         filename->setLabel( kTuttlePluginFilenameLabel );
00019         filename->setStringType( OFX::eStringTypeFilePath );
00020         filename->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
00021         desc.addClipPreferencesSlaveParam( *filename );
00022 
00023         OFX::ChoiceParamDescriptor* component = desc.defineChoiceParam( kTuttlePluginChannel );
00024         component->appendOption( kTuttlePluginChannelAuto );
00025         component->appendOption( kTuttlePluginChannelGray );
00026         component->appendOption( kTuttlePluginChannelRGB );
00027         component->appendOption( kTuttlePluginChannelRGBA );
00028 
00029         component->setLabel( kTuttlePluginChannelLabel );
00030         component->setDefault( eParamReaderChannelAuto );
00031         desc.addClipPreferencesSlaveParam( *component );
00032 
00033         
00034         OFX::ChoiceParamDescriptor* explicitConversion = desc.defineChoiceParam( kTuttlePluginBitDepth );
00035         explicitConversion->setLabel( kTuttlePluginBitDepthLabel );
00036         explicitConversion->appendOption( kTuttlePluginBitDepthAuto );
00037         explicitConversion->appendOption( kTuttlePluginBitDepth8 );
00038         explicitConversion->appendOption( kTuttlePluginBitDepth16 );
00039         explicitConversion->appendOption( kTuttlePluginBitDepth32f );
00040         explicitConversion->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
00041         explicitConversion->setAnimates( false );
00042         desc.addClipPreferencesSlaveParam( *explicitConversion );
00043 
00044         if( OFX::getImageEffectHostDescription()->supportsMultipleClipDepths )
00045         {
00046                 explicitConversion->setDefault( 0 );
00047         }
00048         else
00049         {
00050                 explicitConversion->setIsSecret( true );
00051                 explicitConversion->setDefault( static_cast<int>( OFX::getImageEffectHostDescription()->getDefaultPixelDepth() ) );
00052         }
00053 }
00054 
00055 }
00056 }
00057 
00058 
00059 #endif
00060