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); - } } }