Fix centre convention

This commit is contained in:
Kleis Auke Wolthuizen 2020-10-19 17:03:24 +02:00
parent fdc140e8e9
commit 4533375f63
2 changed files with 4 additions and 4 deletions

View File

@ -480,7 +480,7 @@ vips_reduceh_build( VipsObject *object )
* by half that distance so that we discard pixels equally
* from left and right.
*/
reduceh->hoffset = (1 + extra_pixels) / 2.0;
reduceh->hoffset = (1 + extra_pixels) / 2.0 - 1;
/* Build the tables of pre-computed coefficients.
*/
@ -518,7 +518,7 @@ vips_reduceh_build( VipsObject *object )
/* Add new pixels around the input so we can interpolate at the edges.
*/
if( vips_embed( in, &t[1],
reduceh->n_point / 2 - 1, 0,
VIPS_CEIL( reduceh->n_point / 2.0 ) - 1, 0,
in->Xsize + reduceh->n_point, in->Ysize,
"extend", VIPS_EXTEND_COPY,
(void *) NULL ) )

View File

@ -853,7 +853,7 @@ vips_reducev_build( VipsObject *object )
* by half that distance so that we discard pixels equally
* from left and right.
*/
reducev->voffset = (1 + extra_pixels) / 2.0;
reducev->voffset = (1 + extra_pixels) / 2.0 - 1;
/* Build the tables of pre-computed coefficients.
*/
@ -891,7 +891,7 @@ vips_reducev_build( VipsObject *object )
/* Add new pixels around the input so we can interpolate at the edges.
*/
if( vips_embed( in, &t[1],
0, reducev->n_point / 2 - 1,
0, VIPS_CEIL( reducev->n_point / 2.0 ) - 1,
in->Xsize, in->Ysize + reducev->n_point,
"extend", VIPS_EXTEND_COPY,
(void *) NULL ) )