TuttleOFX
1
|
00001 #ifndef _TUTTLE_PLUGIN_CONTEXT_GENERATORPLUGIN_HPP_ 00002 #define _TUTTLE_PLUGIN_CONTEXT_GENERATORPLUGIN_HPP_ 00003 00004 #include "GeneratorDefinition.hpp" 00005 00006 #include <tuttle/plugin/ImageEffectGilPlugin.hpp> 00007 #include <tuttle/plugin/exceptions.hpp> 00008 00009 namespace tuttle { 00010 namespace plugin { 00011 00012 class GeneratorPlugin : public OFX::ImageEffect 00013 { 00014 public: 00015 GeneratorPlugin( OfxImageEffectHandle handle ); 00016 virtual ~GeneratorPlugin() = 0; 00017 00018 public: 00019 virtual void changedParam( const OFX::InstanceChangedArgs& args, const std::string& paramName ); 00020 virtual bool getRegionOfDefinition( const OFX::RegionOfDefinitionArguments& args, OfxRectD& rod ); 00021 virtual void getClipPreferences( OFX::ClipPreferencesSetter& clipPreferences ); 00022 virtual bool getTimeDomain( OfxRangeD& range ); 00023 00024 public: 00025 00026 EParamGeneratorExplicitConversion getExplicitConversion() const 00027 { 00028 return static_cast<EParamGeneratorExplicitConversion>( _paramExplicitConv->getValue() ); 00029 } 00030 00031 OFX::EBitDepth getOfxExplicitConversion() const 00032 { 00033 switch( getExplicitConversion() ) 00034 { 00035 case eParamGeneratorExplicitConversionByte: 00036 return OFX::eBitDepthUByte; 00037 case eParamGeneratorExplicitConversionShort: 00038 return OFX::eBitDepthUShort; 00039 case eParamGeneratorExplicitConversionFloat: 00040 return OFX::eBitDepthFloat; 00041 case eParamGeneratorExplicitConversionAuto: 00042 BOOST_THROW_EXCEPTION( exception::Value() ); 00043 } 00044 return OFX::eBitDepthNone; 00045 } 00046 00047 protected: 00048 void updateVisibleTools(); 00049 00050 public: 00051 OFX::Clip* _clipSrc; ///< Input image clip 00052 OFX::Clip* _clipDst; ///< Destination image clip 00053 /// @name user parameters 00054 /// @{ 00055 OFX::ChoiceParam* _paramExplicitConv; ///< Explicit conversion 00056 OFX::ChoiceParam* _paramComponents; 00057 00058 OFX::ChoiceParam* _paramMode; 00059 00060 OFX::ChoiceParam* _paramFormat; 00061 00062 OFX::Int2DParam* _paramSize; 00063 OFX::IntParam* _paramSizeWidth; 00064 OFX::IntParam* _paramSizeHeight; 00065 OFX::BooleanParam* _paramSizeSpecificRatio; 00066 OFX::DoubleParam* _paramSizeRatioValue; 00067 OFX::ChoiceParam* _paramSizeOrientation; 00068 /// @} 00069 }; 00070 00071 } 00072 } 00073 00074 #endif 00075