@@ -158,11 +158,7 @@ class RendererAgg
158158 void draw_image (GCAgg &gc,
159159 double x,
160160 double y,
161- ImageArray &image,
162- double w,
163- double h,
164- agg::trans_affine trans,
165- bool resize);
161+ ImageArray &image);
166162
167163 template <class PathGenerator ,
168164 class TransformArray ,
@@ -832,11 +828,7 @@ template <class ImageArray>
832828inline void RendererAgg::draw_image (GCAgg &gc,
833829 double x,
834830 double y,
835- ImageArray &image,
836- double w,
837- double h,
838- agg::trans_affine trans,
839- bool resize)
831+ ImageArray &image)
840832{
841833 double alpha = gc.alpha ;
842834
@@ -850,21 +842,11 @@ inline void RendererAgg::draw_image(GCAgg &gc,
850842 image.data (), (unsigned )image.dim (1 ), (unsigned )image.dim (0 ), -(int )image.dim (1 ) * 4 );
851843 pixfmt pixf (buffer);
852844
853- if (resize | has_clippath) {
845+ if (has_clippath) {
854846 agg::trans_affine mtx;
855847 agg::path_storage rect;
856848
857- if (resize) {
858- mtx *= agg::trans_affine_scaling (1 , -1 );
859- mtx *= agg::trans_affine_translation (0 , image.dim (0 ));
860- mtx *= agg::trans_affine_scaling (w / (image.dim (1 )), h / (image.dim (0 )));
861- mtx *= agg::trans_affine_translation (x, y);
862- mtx *= trans;
863- mtx *= agg::trans_affine_scaling (1.0 , -1.0 );
864- mtx *= agg::trans_affine_translation (0.0 , (double )height);
865- } else {
866- mtx *= agg::trans_affine_translation ((int )x, (int )(height - (y + image.dim (0 ))));
867- }
849+ mtx *= agg::trans_affine_translation ((int )x, (int )(height - (y + image.dim (0 ))));
868850
869851 rect.move_to (0 , 0 );
870852 rect.line_to (image.dim (1 ), 0 );
@@ -891,30 +873,17 @@ inline void RendererAgg::draw_image(GCAgg &gc,
891873 span_conv_alpha conv_alpha (alpha);
892874 span_conv spans (image_span_generator, conv_alpha);
893875
894- if (has_clippath) {
895- typedef agg::pixfmt_amask_adaptor<pixfmt, alpha_mask_type> pixfmt_amask_type;
896- typedef agg::renderer_base<pixfmt_amask_type> amask_ren_type;
897- typedef agg::renderer_scanline_aa<amask_ren_type, color_span_alloc_type, span_conv>
876+ typedef agg::pixfmt_amask_adaptor<pixfmt, alpha_mask_type> pixfmt_amask_type;
877+ typedef agg::renderer_base<pixfmt_amask_type> amask_ren_type;
878+ typedef agg::renderer_scanline_aa<amask_ren_type, color_span_alloc_type, span_conv>
898879 renderer_type_alpha;
899880
900- pixfmt_amask_type pfa (pixFmt, alphaMask);
901- amask_ren_type r (pfa);
902- renderer_type_alpha ri (r, sa, spans);
903-
904- theRasterizer.add_path (rect2);
905- agg::render_scanlines (theRasterizer, scanlineAlphaMask, ri);
906- } else {
907- typedef agg::renderer_base<pixfmt> ren_type;
908- typedef agg::renderer_scanline_aa<ren_type, color_span_alloc_type, span_conv>
909- renderer_type;
910-
911- ren_type r (pixFmt);
912- renderer_type ri (r, sa, spans);
913-
914- theRasterizer.add_path (rect2);
915- agg::render_scanlines (theRasterizer, slineP8, ri);
916- }
881+ pixfmt_amask_type pfa (pixFmt, alphaMask);
882+ amask_ren_type r (pfa);
883+ renderer_type_alpha ri (r, sa, spans);
917884
885+ theRasterizer.add_path (rect2);
886+ agg::render_scanlines (theRasterizer, scanlineAlphaMask, ri);
918887 } else {
919888 set_clipbox (gc.cliprect , rendererBase);
920889 rendererBase.blend_from (
0 commit comments