diff --git a/rotation.cpp b/rotation.cpp index f854934..e912f07 100644 --- a/rotation.cpp +++ b/rotation.cpp @@ -694,9 +694,9 @@ Image* rotate(Image const& src, double angle) // template -void rotate_pixel(TiledImage const& src, TiledImage& rotated, +void rotate_pixel(TiledImage const& src, DPoint const& src_rotated_point, - unsigned int rot_tile_index, unsigned int rot_index) + uint8_t* rot_tile, unsigned int rot_index) { uint8_t const* src_index_1 = src.access_pixel((int) src_rotated_point.x, (int) src_rotated_point.y); @@ -708,7 +708,6 @@ void rotate_pixel(TiledImage const& src, TiledImage& rotated, // special case if we can directly map the src to the dest if (x_delta == 0 && y_delta == 0) { - uint8_t* rot_tile = rotated.tiles[rot_tile_index]; memcpy(&rot_tile[rot_index], src_index_1, 3 * sizeof (uint8_t)); return; } @@ -743,7 +742,6 @@ void rotate_pixel(TiledImage const& src, TiledImage& rotated, top_left = _mm_add_ps(top_left, bottom_left); // convert float values to uint8_t - uint8_t* rot_tile = rotated.tiles[rot_tile_index]; rot_tile[rot_index] = top_left[3]; rot_tile[rot_index + 1] = top_left[2]; rot_tile[rot_index + 2] = top_left[1]; @@ -797,9 +795,9 @@ rotate(TiledImage const& src, double angle) || src_rotated_point.y < 0 || src_rotated_point.y > src.height) continue; - rotate_pixel(src, *rotated, + rotate_pixel(src, src_rotated_point, - rot_tile_index, rot_index); + rotated->tiles[rot_tile_index], rot_index); src_rotated_point.x += src_delta_x.x; src_rotated_point.y += src_delta_x.y;