From c918ca550423ce00aaf6da12be609793f5954490 Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Wed, 16 Jul 2014 21:42:22 +0200 Subject: [PATCH] Remove out-of-bounds check for tiled images. Since tiles have an overlap, if the absolute point is inside the source image, we can interpolate. --- rotation.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/rotation.cpp b/rotation.cpp index 8c97fc1..6682605 100644 --- a/rotation.cpp +++ b/rotation.cpp @@ -726,11 +726,6 @@ void rotate_pixel(TiledImage const& src, pvalue_t const* src_index_1 = src.access_pixel(src_x, src_y); pvalue_t const* src_index_3 = src_index_1 + (W + 1) * PIXEL_SIZE; - pvalue_t const* src_index_4 = src_index_3 + PIXEL_SIZE; - - // FIXME: deal with image border - if (!src_index_4) - return; unsigned int x_delta = src_rotated_point.x & 0x07;; unsigned int y_delta = src_rotated_point.y & 0x07; @@ -740,6 +735,7 @@ void rotate_pixel(TiledImage const& src, #ifndef SIMD pvalue_t const* src_index_2 = src_index_1 + PIXEL_SIZE; + pvalue_t const* src_index_4 = src_index_3 + PIXEL_SIZE; rot_tile[0] = ((src_index_1[0] * inv_x + src_index_2[0] * x_delta) * inv_y + (src_index_3[0] * inv_x + src_index_4[0] * x_delta) * y_delta) >> 6;