TuttleOFX
1
|
00001 00002 namespace tuttle { 00003 namespace plugin { 00004 namespace move2D { 00005 00006 template<class View> 00007 Move2DProcess<View>::Move2DProcess( Move2DPlugin &effect ) 00008 : ImageGilFilterProcessor<View>( effect, eImageOrientationFromBottomToTop ) 00009 , _plugin( effect ) 00010 { 00011 } 00012 00013 template<class View> 00014 void Move2DProcess<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 Move2DProcess<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 for( int y = procWindowOutput.y1; 00035 y < procWindowOutput.y2; 00036 ++y ) 00037 { 00038 typename View::x_iterator src_it = this->_srcView.x_at( procWindowOutput.x1, y ); 00039 typename View::x_iterator dst_it = this->_dstView.x_at( procWindowOutput.x1, y ); 00040 for( int x = procWindowOutput.x1; 00041 x < procWindowOutput.x2; 00042 ++x, ++src_it, ++dst_it ) 00043 { 00044 (*dst_it) = (*src_it); 00045 } 00046 if( this->progressForward( procWindowSize.x ) ) 00047 return; 00048 } 00049 /* 00050 const OfxRectI procWindowSrc = translateRegion( procWindowRoW, this->_srcPixelRod ); 00051 OfxPointI procWindowSize = { procWindowRoW.x2 - procWindowRoW.x1, 00052 procWindowRoW.y2 - procWindowRoW.y1 }; 00053 View src = subimage_view( this->_srcView, procWindowSrc.x1, procWindowSrc.y1, 00054 procWindowSize.x, procWindowSize.y ); 00055 View dst = subimage_view( this->_dstView, procWindowOutput.x1, procWindowOutput.y1, 00056 procWindowSize.x, procWindowSize.y ); 00057 copy_pixels( src, dst ); 00058 */ 00059 00060 } 00061 00062 } 00063 } 00064 }