Vertex source vertex sources are passed directly to the scanline rasterizer effect

Source: Internet
Author: User

Agg contains a number of vertex sources that we can call directly, and they include:

Agg::p Ath_storage

Agg::arc

Agg::rounded_rect

Agg::ellipse

Agg::curve3

Agg::curve4 ...

1) for agg::p ath_storage


Now try to view agg::p ath_storage The effect that is passed directly to Scanline rasterizer:

Now we're trying to portray a line segment, here's a question not passing through Agg::conv_stroke, how

Sets the width of the segment, and the default value is not

Nothing, can not draw the line, it seems still need to pass to Agg::conv_stroke??

Agg::p ath_storage PS1;

Ps1.move_to (130,130);

Ps1.line_to (140,140);

Ras.add_path (PS1);

Agg::render_scanlines_aa_solid (Ras,sl,renb,agg::rgba8 (255,0,0));

Ras.reset ();


Can not be directly depicted, or we portray the wrong way!!

If you add a line segment again, you can now create a closed interval, and how to:

Agg::p ath_storage PS1;

Ps1.move_to (130,130);

Ps1.line_to (140,140);

Ps1.line_to (150,130);

Ras.add_path (PS1);

Agg::render_scanlines_aa_solid (Ras,sl,renb,agg::rgba8 (255,0,0));

Ras.reset ();

Come out, finally come out, this is a solid triangle, the fill color is red.

Simple conclusion: When we do not pass through the agg::conv_stroke, in fact these vertex source may not have the direction, impossible Ah!! What the hell is line_to?!

2) for Agg::ellipse


For example, the following two copies of the Code:

1)

Agg::ellipse Ellipse (250, 125, 125, 125);

Ras.reset ();

Ras.add_path (ellipse);

Solid Circle

2)

Agg::ellipse Ellipse (250, 125, 125, 125);

agg::conv_stroke<agg::ellipse> Stroke (ellipse);

Ras.reset ();

Ras.add_path (stroke);

Hollow Circle


So we finally know that when we pass the vertex source to the stroke is the draw line, if the direct Add_path actually

is to render a shape, and now assume that when Agg::ellipse is passed to Agg::conv_stroke, actually

All the vertices of the circle are passed to the segment container, the segment container, and this time the segment container is, of course, the arc of the circle.

The endpoint is connected, but the color is not filled because it is considered a line segment

But when passed directly to RAS, it is a series of vertices, and scanline rasterizer can transform the vertex data into

A set of horizontal scan lines, which consist of a set of segments (Span), which, in fact, is the same horizontal line

A scan connection was made between two points.


Summary: If a vertex source can form a closed interval, it can be completely passed to RAS, depicting an entity, if not,

Nothing will be rendered when passed to Ras via Agg::conv_stroke, which depicts a line segment.

/*

Two different schemes, one is to be a flag instead of a filled entity, above a hollow


Of

Triangle, and the following is a filled triangle. Here you can describe in detail: any multilateral


Shapes are available

Using triangles to split, so

*/

Agg::conv_stroke<agg::p ath_storage> Stroke (PS);

Ras.add_path (stroke);

Agg::render_scanlines_aa_solid (Ras,sl,renb,agg::rgba8 (0,0,0));


Because of the need to draw Taiji figure, I need to do a round fill, GDI provides the pie function, and Agg does not provide any functions

A proposal is therefore proposed:

Fill the color, fill the circle with color, really very troublesome, no interface provided, and can not find any

The information I intend to provide is two points for each line of the circle, and then the way to draw a straight line fills. After the discussion above

Finally found a solution.





Vertex source vertex sources are passed directly to the scanline rasterizer effect

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.