Permalink
Browse files

Be more conservative when selecting pixels that may be in the filter'…

…s domain

This is mostly for the benefit of box filters, in which pixels at the edges of
the filter's domain are very significant.
  • Loading branch information...
1 parent 1d0c38c commit dea09d1676ccb599da64dce3948f798f8ced0a66 @jsummers committed Sep 19, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/imagew-resize.c
View
@@ -264,8 +264,8 @@ static void iw_create_weightlist_std(struct iw_context *ctx, struct iw_rr_ctx *r
// There are up to radius*reduction_factor source pixels on each side
// of the target pixel that we need to look at.
- first_input_pixel = (int)ceil(pos_in_inpix - rrctx->radius*reduction_factor);
- last_input_pixel = (int)floor(pos_in_inpix + rrctx->radius*reduction_factor);
+ first_input_pixel = (int)ceil(pos_in_inpix - rrctx->radius*reduction_factor -0.0001);
+ last_input_pixel = (int)floor(pos_in_inpix + rrctx->radius*reduction_factor +0.0001);
// Remember which item in the weightlist was the first one for this
// target sample.

0 comments on commit dea09d1

Please sign in to comment.