TuttleOFX  1
DummyProcess.tcc
Go to the documentation of this file.
00001 
00002 namespace tuttle {
00003 namespace plugin {
00004 namespace dummy {
00005 
00006 template<class View>
00007 DummyProcess<View>::DummyProcess( DummyPlugin &effect )
00008         : ImageGilFilterProcessor<View>( effect, eImageOrientationIndependant )
00009         , _plugin( effect )
00010 {
00011 }
00012 
00013 template<class View>
00014 void DummyProcess<View>::setup( const OFX::RenderArguments& args )
00015 {
00016         ImageGilFilterProcessor<View>::setup( args );
00017         _params = _plugin.getProcessParams( args.renderScale );
00018 
00019 }
00020 
00021 /**
00022  * @brief Function called by rendering thread each time a process must be done.
00023  * @param[in] procWindowRoW  Processing window
00024  */
00025 template<class View>
00026 void DummyProcess<View>::multiThreadProcessImages( const OfxRectI& procWindowRoW )
00027 {
00028         using namespace boost::gil;
00029         OfxRectI procWindowOutput = this->translateRoWToOutputClipCoordinates( procWindowRoW );
00030         const OfxPointI procWindowSize = {
00031                 procWindowRoW.x2 - procWindowRoW.x1,
00032                 procWindowRoW.y2 - procWindowRoW.y1
00033         };
00034         
00035         for( int y = procWindowOutput.y1;
00036                          y < procWindowOutput.y2;
00037                          ++y )
00038         {
00039                 typename View::x_iterator src_it = this->_srcView.x_at( procWindowOutput.x1, y );
00040                 typename View::x_iterator dst_it = this->_dstView.x_at( procWindowOutput.x1, y );
00041                 for( int x = procWindowOutput.x1;
00042                          x < procWindowOutput.x2;
00043                          ++x, ++src_it, ++dst_it )
00044                 {
00045                         (*dst_it) = (*src_it);
00046                 }
00047                 if( this->progressForward( procWindowSize.x ) )
00048                         return;
00049         }
00050 }
00051 
00052 }
00053 }
00054 }