@@ -260,7 +260,7 @@ void RendererAgg::create_alpha_buffers() {
260260 alphaMask = new alpha_mask_type (*alphaMaskRenderingBuffer);
261261
262262 pixfmtAlphaMask = new agg::pixfmt_gray8 (*alphaMaskRenderingBuffer);
263- rendererBaseAlphaMask = new renderer_base_alpha_mask_type (*pixfmtAlphaMask);
263+ rendererBaseAlphaMask = new renderer_base_alpha_mask_type (*pixfmtAlphaMask);
264264 rendererAlphaMask = new renderer_alpha_mask_type (*rendererBaseAlphaMask);
265265 scanlineAlphaMask = new agg::scanline_p8 ();
266266 }
@@ -424,7 +424,6 @@ RendererAgg::restore_region(const Py::Tuple& args) {
424424 return Py::Object ();
425425 // throw Py::ValueError("Cannot restore_region from NULL data");
426426
427-
428427 agg::rendering_buffer rbuf;
429428 rbuf.attach (region->data ,
430429 region->width ,
@@ -1434,14 +1433,14 @@ RendererAgg::write_png(const Py::Tuple& args)
14341433 png_write_image (png_ptr, row_pointers);
14351434 png_write_end (png_ptr, info_ptr);
14361435
1437- /* Changed calls to png_destroy_write_struct to follow
1438- http://www.libpng.org/pub/png/libpng-manual.txt.
1439- This ensures the info_ptr memory is released.
1440- */
14411436
14421437 } catch (...) {
14431438 if (fp && close_file) fclose (fp);
14441439 delete [] row_pointers;
1440+ /* Changed calls to png_destroy_write_struct to follow
1441+ http://www.libpng.org/pub/png/libpng-manual.txt.
1442+ This ensures the info_ptr memory is released.
1443+ */
14451444 if (png_ptr && info_ptr) png_destroy_write_struct (&png_ptr, &info_ptr);
14461445 throw ;
14471446 }
@@ -1477,9 +1476,7 @@ RendererAgg::tostring_rgb(const Py::Tuple& args) {
14771476
14781477
14791478 // todo: how to do this with native CXX
1480- PyObject* o = Py_BuildValue (" s#" ,
1481- buf_tmp,
1482- row_len * height);
1479+ PyObject* o = Py_BuildValue (" s#" , buf_tmp, row_len * height);
14831480 delete [] buf_tmp;
14841481 return Py::asObject (o);
14851482}
@@ -1499,18 +1496,13 @@ RendererAgg::tostring_argb(const Py::Tuple& args) {
14991496 throw Py::MemoryError (" RendererAgg::tostring_argb could not allocate memory" );
15001497 }
15011498 agg::rendering_buffer renderingBufferTmp;
1502- renderingBufferTmp.attach (buf_tmp,
1503- width,
1504- height,
1505- row_len);
1499+ renderingBufferTmp.attach (buf_tmp, width, height, row_len);
15061500
15071501 agg::color_conv (&renderingBufferTmp, renderingBuffer, agg::color_conv_rgba32_to_argb32 ());
15081502
15091503
15101504 // todo: how to do this with native CXX
1511- PyObject* o = Py_BuildValue (" s#" ,
1512- buf_tmp,
1513- row_len * height);
1505+ PyObject* o = Py_BuildValue (" s#" , buf_tmp, row_len * height);
15141506 delete [] buf_tmp;
15151507 return Py::asObject (o);
15161508}
0 commit comments