GIL_FORCEINLINE F transform_pixels_progress( const View1& src, const View2& dst, const F& fun, IProgress& p ) { assert( src.dimensions() == dst.dimensions() ); for( std::ptrdiff_t y = 0; y < src.height(); ++y ) { typename View1::x_iterator srcIt = src.row_begin( y ); typename View2::x_iterator dstIt = dst.row_begin( y ); for( std::ptrdiff_t x = 0; x < src.width(); ++x ) dstIt[x] = fun( srcIt[x] ); if( p.progressForward( dst.width() ) ) return fun; } return fun; }
GIL_FORCEINLINE F transform_pixels_progress( const View1& src1, const View2& src2, const View3& src3, const View4& dst, const F& fun, IProgress& p ) { assert( src1.dimensions() == dst.dimensions() ); assert( src2.dimensions() == dst.dimensions() ); assert( src3.dimensions() == dst.dimensions() ); for( std::ptrdiff_t y = 0; y < dst.height(); ++y ) { typename View1::x_iterator srcIt1 = src1.row_begin( y ); typename View2::x_iterator srcIt2 = src2.row_begin( y ); typename View3::x_iterator srcIt3 = src3.row_begin( y ); typename View4::x_iterator dstIt = dst.row_begin( y ); for( std::ptrdiff_t x = 0; x < dst.width(); ++x ) dstIt[x] = fun( srcIt1[x], srcIt2[x], srcIt3[x] ); if( p.progressForward( dst.width() ) ) return fun; } return fun; }