TuttleOFX
1
|
00001 #include "DebugImageEffectApiPlugin.hpp" 00002 #include "DebugImageEffectApiProcess.hpp" 00003 #include "DebugImageEffectApiDefinitions.hpp" 00004 00005 #include <boost/gil/gil_all.hpp> 00006 00007 #include <sstream> 00008 00009 namespace tuttle { 00010 namespace plugin { 00011 namespace debugImageEffectApi { 00012 00013 DebugImageEffectApiPlugin::DebugImageEffectApiPlugin( OfxImageEffectHandle handle ) 00014 : ImageEffectGilPlugin( handle ) 00015 { 00016 _hostInfos = fetchStringParam( kHostInfos ); 00017 _currentTime = fetchDoubleParam( kCurrentTime ); 00018 _beginTime = fetchDoubleParam( kBeginTime ); 00019 _endTime = fetchDoubleParam( kEndTime ); 00020 } 00021 00022 DebugImageEffectApiParams DebugImageEffectApiPlugin::getParams() const 00023 { 00024 DebugImageEffectApiParams params; 00025 00026 return params; 00027 } 00028 00029 /** 00030 * @brief The overridden render function 00031 * @param[in] args Rendering parameters 00032 */ 00033 void DebugImageEffectApiPlugin::render( const OFX::RenderArguments& args ) 00034 { 00035 doGilRender<DebugImageEffectApiProcess>( *this, args ); 00036 } 00037 00038 void DebugImageEffectApiPlugin::changedParam( const OFX::InstanceChangedArgs& args, const std::string& paramName ) 00039 { 00040 if( paramName == kGoTo ) 00041 { 00042 this->timeLineGotoTime( args.time - 2 ); 00043 } 00044 else if( paramName == kUpdate ) 00045 { 00046 this->_currentTime->setValue( args.time ); 00047 00048 OFX::ImageEffectHostDescription* desc = OFX::getImageEffectHostDescription(); 00049 std::ostringstream description; 00050 description << "hostName: " << desc->hostName << std::endl; 00051 description << "hostLabel: " << desc->hostLabel << std::endl; 00052 description << "hostIsBackground: " << desc->hostIsBackground << std::endl; 00053 description << "supportsOverlays: " << desc->supportsOverlays << std::endl; 00054 description << "supportsMultiResolution: " << desc->supportsMultiResolution << std::endl; 00055 description << "supportsTiles: " << desc->supportsTiles << std::endl; 00056 description << "temporalClipAccess: " << desc->temporalClipAccess << std::endl; 00057 description << "supportsMultipleClipDepths: " << desc->supportsMultipleClipDepths << std::endl; 00058 description << "supportsMultipleClipPARs: " << desc->supportsMultipleClipPARs << std::endl; 00059 description << "supportsSetableFrameRate: " << desc->supportsSetableFrameRate << std::endl; 00060 description << "supportsSetableFielding: " << desc->supportsSetableFielding << std::endl; 00061 description << "supportsStringAnimation: " << desc->supportsStringAnimation << std::endl; 00062 description << "supportsCustomInteract: " << desc->supportsCustomInteract << std::endl; 00063 description << "supportsChoiceAnimation: " << desc->supportsChoiceAnimation << std::endl; 00064 description << "supportsBooleanAnimation: " << desc->supportsBooleanAnimation << std::endl; 00065 description << "supportsCustomAnimation: " << desc->supportsCustomAnimation << std::endl; 00066 description << "maxParameters: " << desc->maxParameters << std::endl; 00067 description << "maxPages: " << desc->maxPages << std::endl; 00068 description << "pageRowCount: " << desc->pageRowCount << std::endl; 00069 description << "pageColumnCount: " << desc->pageColumnCount << std::endl; 00070 description << "_supportedComponents: "; 00071 for( OFX::ImageEffectHostDescription::PixelComponentArray::const_iterator it = desc->_supportedComponents.begin(), itEnd = desc->_supportedComponents.end(); 00072 it != itEnd; 00073 ++it ) 00074 description << OFX::mapPixelComponentEnumToString( *it ) << ", "; 00075 description << std::endl; 00076 description << "_supportedContexts: "; 00077 for( OFX::ImageEffectHostDescription::ContextArray::const_iterator it = desc->_supportedContexts.begin(), itEnd = desc->_supportedContexts.end(); 00078 it != itEnd; 00079 ++it ) 00080 description << OFX::mapContextEnumToString( *it ) << ", "; 00081 description << std::endl; 00082 description << "_supportedPixelDepths: "; 00083 for( OFX::ImageEffectHostDescription::BitDepthArray::const_iterator it = desc->_supportedPixelDepths.begin(), itEnd = desc->_supportedPixelDepths.end(); 00084 it != itEnd; 00085 ++it ) 00086 description << OFX::mapBitDepthEnumToString( *it ) << ", "; 00087 description << std::endl; 00088 description << "supportsProgressSuite: " << desc->supportsProgressSuite << std::endl; 00089 description << "supportsTimeLineSuite: " << desc->supportsTimeLineSuite << std::endl; 00090 00091 description << "this->timeLineGetTime(): " << this->timeLineGetTime() << std::endl; 00092 double t1 = 0, t2 = 0; 00093 this->timeLineGetBounds( t1, t2 ); 00094 description << "this->timeLineGetBounds: " << t1 << ", " << t2 << std::endl; 00095 this->_beginTime->setValue( t1 ); 00096 this->_endTime->setValue( t2 ); 00097 // description << ": " << desc-> << std::endl; 00098 /* 00099 std::string hostName; 00100 bool hostIsBackground; 00101 bool supportsOverlays; 00102 bool supportsMultiResolution; 00103 bool supportsTiles; 00104 bool temporalClipAccess; 00105 bool supportsMultipleClipDepths; 00106 bool supportsMultipleClipPARs; 00107 bool supportsSetableFrameRate; 00108 bool supportsSetableFielding; 00109 bool supportsStringAnimation; 00110 bool supportsCustomInteract; 00111 bool supportsChoiceAnimation; 00112 bool supportsBooleanAnimation; 00113 bool supportsCustomAnimation; 00114 int maxParameters; 00115 int maxPages; 00116 int pageRowCount; 00117 int pageColumnCount; 00118 typedef std::vector<EPixelComponent> PixelComponentArray; 00119 PixelComponentArray _supportedComponents; 00120 typedef std::vector<EContext> ContextArray; 00121 ContextArray _supportedContexts; 00122 typedef std::vector<EBitDepth> PixelDepthArray; 00123 PixelDepthArray _supportedPixelDepths; 00124 bool supportsProgressSuite; 00125 bool supportsTimeLineSuite; 00126 */ 00127 this->_hostInfos->setValue( description.str() ); 00128 } 00129 } 00130 00131 } 00132 } 00133 }