当前位置: 首页>>代码示例>>C++>>正文


C++ ViewDst::x_at方法代码示例

本文整理汇总了C++中ViewDst::x_at方法的典型用法代码示例。如果您正苦于以下问题:C++ ViewDst::x_at方法的具体用法?C++ ViewDst::x_at怎么用?C++ ViewDst::x_at使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ViewDst的用法示例。


在下文中一共展示了ViewDst::x_at方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: transform_pixels_locator

GIL_FORCEINLINE F transform_pixels_locator(const View1& src1, const Rect<std::ptrdiff_t>& src1Rod, const View2& src2,
                                           const Rect<std::ptrdiff_t>& src2Rod, const View2& src3,
                                           const Rect<std::ptrdiff_t>& src3Rod, const ViewDst& dst,
                                           const Rect<std::ptrdiff_t>& dstRod, const Rect<std::ptrdiff_t>& renderWin,
                                           const F& fun)
{
    const std::ptrdiff_t renderWidth = renderWin.x2 - renderWin.x1;
    typename View1::xy_locator s1loc = src1.xy_at(renderWin.x1 - src1Rod.x1, renderWin.y1 - src1Rod.y1);
    typename View2::xy_locator s2loc = src2.xy_at(renderWin.x1 - src2Rod.x1, renderWin.y1 - src2Rod.y1);
    typename View3::xy_locator s3loc = src3.xy_at(renderWin.x1 - src3Rod.x1, renderWin.y1 - src3Rod.y1);
    for(std::ptrdiff_t y = renderWin.y1; y < renderWin.y2; ++y)
    {
        typename ViewDst::x_iterator dstIt = dst.x_at(dstRod.x1, y - dstRod.y1);
        for(std::ptrdiff_t x = renderWin.x1; x < renderWin.x2; ++x, ++s1loc.x(), ++s2loc.x(), ++s3loc.x(), ++dstIt)
        {
            *dstIt = fun(s1loc, s2loc, s3loc);
        }
        s1loc.x() -= renderWidth;
        ++s1loc.y();
        s2loc.x() -= renderWidth;
        ++s2loc.y();
        s3loc.x() -= renderWidth;
        ++s3loc.y();
    }
    return fun;
}
开发者ID:aoblet,项目名称:TuttleOFX,代码行数:26,代码来源:transform_pixels.hpp

示例2: transform_pixels_locator_progress

GIL_FORCEINLINE
F transform_pixels_locator_progress( const View1& src1, const OfxRectI& src1Rod,
									 const View2& src2, const OfxRectI& src2Rod,
									 const ViewDst& dst, const OfxRectI& dstRod,
									 const OfxRectI& renderWin, const F& fun, IProgress& p )
{
	const std::ptrdiff_t renderWidth = renderWin.x2 - renderWin.x1;
	typename View1::xy_locator s1loc = src1.xy_at( renderWin.x1-src1Rod.x1, renderWin.y1-src1Rod.y1 );
	typename View2::xy_locator s2loc = src2.xy_at( renderWin.x1-src2Rod.x1, renderWin.y1-src2Rod.y1 );
	for( std::ptrdiff_t y = renderWin.y1; y < renderWin.y2; ++y )
	{
		typename ViewDst::x_iterator dstIt = dst.x_at( dstRod.x1, y-dstRod.y1 );
		for( std::ptrdiff_t x = renderWin.x1;
		     x < renderWin.x2;
		     ++x, ++s1loc.x(), ++s2loc.x(), ++dstIt )
		{
			*dstIt = fun( s1loc, s2loc );
		}
		s1loc.x() -= renderWidth; ++s1loc.y();
		s2loc.x() -= renderWidth; ++s2loc.y();
		if( p.progressForward( renderWidth ) )
			return fun;
	}
	return fun;
}
开发者ID:morphimac,项目名称:TuttleOFX,代码行数:25,代码来源:algorithm.hpp


注:本文中的ViewDst::x_at方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。