Briefly comment on the rendering algorithm of Adobe Flash Player-continued 1

Source: Internet
Author: User

In the scanline algorithm, the core is to compute the intersection of the scanning line and each side, and fill two intersections with specific rules to draw a scanning line, and we can abstract the understanding in 2D vector graphics engine, all object/shape, or even a simple straight line (straight line because of the endpoint ----- different strokes) can be understood as polygon filling, so why is it called the fill rule );

The traditional 2D vector graphics engine (openvg/gingkovg) supports two filling rules: the parity filling rule and the non-Zero Filling rule:

L parity filling rule (even/odd fill rule): The Core Algorithm of the parity filling rule is to confirm the number of times the Scan Line and each side intersect-whether it is an odd or even number to determine whether to fill; in general, when the number of intersections between the scanning line and the side is an odd number, the filling starts and the even number ends. In the parity filling rule, each side has no direction;

L non-zero fill rule (non-zero fill rule): The Core Algorithm of the non-zero fill rule is to determine whether to fill the rule based on the number of scanned lines and directed edges, and assume that the upward side is a positive side, the downward side is a negative side, the scanning line and the positive side intersection and Add 1, and the negative side intersection and minus 1, based on this value, we determine whether to fill: if this value is a non-zero value and starts to fill, it ends to fill;

L edge-edge fil rule: we can simply understand the parity filling rule with two different coloring algorithms;

Therefore, the following two different filling rules should be well understood:

 

In Flash Player, different colors are allowed on different sides of a shape-a place that is often confusing;

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.