support setting opacity on bitmaps in render_marker - refs #1364

This commit is contained in:
Dane Springmeyer 2012-08-02 10:52:09 -07:00
parent 56e11423ef
commit c2c006f9c2

View File

@ -379,15 +379,18 @@ void agg_renderer<T>::render_marker(pixel_position const& pos, marker const& mar
src.height(),
src.width()*4);
agg::pixfmt_rgba32_pre pixf(marker_buf);
typedef agg::image_accessor_clone<agg::pixfmt_rgba32_pre> img_accessor_type;
typedef agg::span_interpolator_linear<agg::trans_affine> interpolator_type;
typedef agg::span_image_filter_rgba_2x2<img_accessor_type,
interpolator_type> span_gen_type;
typedef agg::renderer_scanline_aa_alpha<renderer_base,
agg::span_allocator<agg::rgba8>,
span_gen_type> renderer_type;
img_accessor_type ia(pixf);
interpolator_type interpolator(agg::trans_affine(p, 0, 0, width, height) );
span_gen_type sg(ia, interpolator, filter);
agg::render_scanlines_aa(*ras_ptr, sl, renb, sa, sg);
renderer_type rp(renb,sa, sg, unsigned(opacity*255));
agg::render_scanlines(*ras_ptr, sl, rp);
}
}
}