Agg::conv_contour cannot be applied to self-intersection closed graphs

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.