Test code:
void Drawintersectcontour ()
{
Agg::rendering_buffer &rbuf = Rbuf_window ();
Agg::p ixfmt_bgr24 pixf (RBUF);
typedef agg::renderer_base<agg::p ixfmt_bgr24> renderer_base_type;
Renderer_base_type Renb (PIXF);
typedef agg::renderer_scanline_aa_solid<renderer_base_type> RENDERDER_SCANLINE_TYPE;
Renderder_scanline_type Rensl (RENB);
Agg::rasterizer_scanline_aa<> RAS;
AGG::SCANLINE_U8 SL;
Ras.reset ();
AGG::p ath_storage PS;
Ps.move_to (200,400);
Ps.line_to (500,500);
Ps.line_to (200,500);
Ps.line_to (500,400);
Ps.line_to (200,400);
Agg::conv_contour<agg::p ath_storage> Contour (PS);
Agg::conv_stroke<agg::conv_contour<agg::p ath_storage> > Stroke (contour);
Ras.add_path (stroke);
Agg::conv_stroke<agg::p ath_storage> stroke1 (PS);
Ras.add_path (STROKE1);
Agg::render_scanlines_aa_solid (Ras,sl,renb,agg::rgba8 (0,255,0));
}
Result analysis: Try to draw a triangular funnel, but by extending the contour module, it is found that it is not closed and can be viewed in detail by canceling the comment.
The following is the author's description:
You can use the Conv_contour in your vector pipeline. See
Examples/conv_contour.cpp for details. The only problem are it won ' twork for
Self-intersecting contours, because the direction of the polygons is
Essential, but we can ' t talk about the polygon direction if itintersects
itself.
Agg::conv_contour cannot be applied to self-intersection closed graphs