Re: [GD-DEVEL] An algorithm for rendering antialiased polygons

[email protected] ("Kiia Kallio")
Newsgroups php.gd.devel
Message-ID <[email protected]>
> I fully agree, I made similar experiments using the edges
> supersampling (2-32x), some results are visible here:
> 
> http://pierre.libgd.org/polygons/
> 
> I did not commit the code yet as I like to clean it up before (I
> focused on the results more than on the code readability :). However,
> I really like your implementation. I think it makes sense to use it
> instead of mine. The license being BSD, I don't see any problem to
> merge it into libgd.
> 
> I have a couple of questions (warning: I did not try intensively yet):
> 
> - does it support polygon with holes? Like the first two examples in
> my link (it is a simple rectangle, but it works with custom polygon as
> well)

It supports self-intersection and polygons with holes. Also two fill rules to determine
the "insideness" are supported (even-odd and non-zero winding). Basically it supports
everything SVG, PDF or PS rasterization would require.

> - does it depend on agg for the rendering or do you use agg only for the demo?

There is no dependency to AGG, it's just used in the performance comparisons.

> - Are you interested to port it to C and/or to gd?

I need to think about it. :) Separating the algorithm from the test framework and
converting to stand-alone C library should be fairly straightforward, as C++ features
are used very sparingly. However, I don't have much spare time for doing this, so
I can't really commit to any tight schedule...

> As shown in your demo and in my 3rd example, the gd arc and ellipse
> functions (as well as the curves functions) can and will use it
> (except for filled ellipse or circle, it may be much faster to use
> another implementation).
> 
> Cheers,
> --Pierre

Kiia
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.