Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

AGG lesson 40 three pipes used by SVG

2025-03-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

The current version of SVG contains 3 pipelines:

Simple polygons:

Path_storage->

Conv_curve->

Conv_transform->

Conv_clip

Strokes:

Path_storage->

Conv_curve->

Conv_stroke->

Conv_transform->

Conv_clip

Contoured polygons:

Path_storage->

Conv_curve->

Conv_contour->

Conv_transform->

Conv_clip

> And is it doubly calculated for

> filling, then stroking (in

> case both apply)?

It is. Otherwise you would have to store the

Intermediate result somewhere. But the good news is

That conv_curve works pretty fast, at least stroking

And clipping are much more time consuming tasks.

The only obvious case when we can approximate the

Curves in the last step is drawing text. But again

When it's without stroking/outlining/contouring.

> Also what exactly does conv_contour do?

Exactly half of the work conv_stroke does. : -) It

Dilates or erodes polygons depending on the sign of

The width. I used it to eliminate the defects when

Joining anti-aliased polygons: https://cache.yisu.com/upload/information/20200311/29/188328.jpg> I hope you dont mind all these questions:)

Of course I don't. Afterall I myself started cooking

This porridge: -)

> If so, doesnt this give the same result each time

> as its done before the

> conv_transform?

Yes, it does, at least seems to do: -)

But the reality is more complex. Here's a

Contadiction. Yes, we could transform paths before

Approximating them with line segments. But conv_stroke

And conv_contour require already decomposed path. So

The only case we can use this order (conv_transform->

Conv_curve) is a simple filled polygon without a

"border". But the situation is even worse. I use

Conv_clip that performs polygonal clipping. Such kind

Of a "vectorial" clipping can work with line segments

Only, so, the curves must be decomposed before

Clipping. Ideally it would be fine to decompose curves

As late as possible, but if the order of the

Conversions is different solid and stroked paths will

Be inconsistent: https://cache.yisu.com/upload/information/20200311/29/188345.jpgEventually I decided to set my jaw and to convert the

Curves in the first pipeline step. Well, this is the

Whole idea of the custom pipelines-in certain cases

You can use different conversion order for the sake of

Performance.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report