Re: [GD-DEVEL] An algorithm for rendering antialiased polygons
| From: | Kiia Kallio | Date: | Mon, 30 Jul 2007 19:06:08 +0000 |
| Subject: | Re: [GD-DEVEL] An algorithm for rendering antialiased polygons | ||
| Groups: | php.gd.devel | ||
| Request: | Send a blank email to php-gd-devel+get-236@lists.php.net to get a copy of this message | ||
> 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