From 3ab9df90dfc0482e889e91383956c49e74ef753e Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Wed, 9 Jul 2014 08:00:58 +0200 Subject: [PATCH] Remove temp buffer for non-tiled image. --- rotation.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/rotation.cpp b/rotation.cpp index c92ec1a..4fb3bea 100644 --- a/rotation.cpp +++ b/rotation.cpp @@ -687,12 +687,8 @@ Image* rotate(Image const& src, double angle) DPoint const rot_origin_in_src_grid = get_mapped_point(*rotated, Point(0, 0), -rotation); DPoint const rot_origin_in_src = convert_img_coord_precision(src, rot_origin_in_src_grid); - unsigned int const buffer_pixel_capacity = 128 / 3; - unsigned int const buffer_size = buffer_pixel_capacity * 3; unsigned int buffer_index = 0; - uint8_t buffer[buffer_size]; - memset(buffer, 0, buffer_size); - unsigned int buffer_offset = 0; + uint8_t* buffer = rotated->buffer; unsigned int const quantize = 8; int const& src_qwidth = src.width * quantize; @@ -716,15 +712,7 @@ Image* rotate(Image const& src, double angle) buffer, buffer_index * 3); } - // Flush buffer to dest ++buffer_index; - if (buffer_index == buffer_pixel_capacity) - { - memcpy(rotated->buffer + buffer_offset, buffer, buffer_size); - buffer_offset += buffer_size; - buffer_index = 0; - memset(buffer, 0, buffer_size); - } } }