DirectXTex: Fixed slight image shift in custom Cubic filtering

This commit is contained in:
walbourn_cp 2013-06-12 19:54:17 -07:00
parent 98699f90f9
commit 7c5c9addf8

View File

@ -173,7 +173,7 @@ inline void _CreateCubicFilter( _In_ size_t source, _In_ size_t dest, _In_ bool
for( size_t u = 0; u < dest; ++u )
{
float srcB = ( float(u) + 0.5f ) * scale + 0.5f;
float srcB = ( float(u) + 0.5f ) * scale - 0.5f;
ptrdiff_t isrcB = bounduvw( ptrdiff_t(srcB), source - 1, wrap, mirror );
ptrdiff_t isrcA = bounduvw( isrcB - 1, source - 1, wrap, mirror );
@ -191,7 +191,6 @@ inline void _CreateCubicFilter( _In_ size_t source, _In_ size_t dest, _In_ bool
}
}
// Bicubic B-Spline
#define CUBIC_INTERPOLATE( res, dx, p0, p1, p2, p3 ) \
{ \
XMVECTOR a0 = (p1); \