TuttleOFX  1
DebugImageEffectApiProcess.tcc
Go to the documentation of this file.
00001 namespace tuttle {
00002 namespace plugin {
00003 namespace debugImageEffectApi {
00004 
00005 template<class View>
00006 DebugImageEffectApiProcess<View>::DebugImageEffectApiProcess( DebugImageEffectApiPlugin& instance )
00007         : ImageGilFilterProcessor<View>( instance, eImageOrientationIndependant )
00008         , _plugin( instance )
00009 {}
00010 
00011 template<class View>
00012 void DebugImageEffectApiProcess<View>::setup( const OFX::RenderArguments& args )
00013 {
00014         ImageGilFilterProcessor<View>::setup( args );
00015         _plugin._currentTime->setValue( args.time );
00016 }
00017 
00018 /**
00019  * @brief Function called by rendering thread each time a process must be done.
00020  * @param[in] procWindowRoW  Processing window in RoW
00021  */
00022 template<class View>
00023 void DebugImageEffectApiProcess<View>::multiThreadProcessImages( const OfxRectI& procWindowRoW )
00024 {
00025         using namespace boost::gil;
00026         OfxRectI procWindowOutput = this->translateRoWToOutputClipCoordinates( procWindowRoW );
00027         OfxPointI procWindowSize  = {
00028                 procWindowRoW.x2 - procWindowRoW.x1,
00029                 procWindowRoW.y2 - procWindowRoW.y1
00030         };
00031 
00032         View src = subimage_view( this->_srcView, procWindowOutput.x1, procWindowOutput.y1,
00033                                   procWindowSize.x,
00034                                   procWindowSize.y );
00035         View dst = subimage_view( this->_dstView, procWindowOutput.x1, procWindowOutput.y1,
00036                                   procWindowSize.x,
00037                                   procWindowSize.y );
00038 
00039         copy_pixels( src, dst );
00040 }
00041 
00042 }
00043 }
00044 }