[cairo] Where are the stroking (and filling) guts?

Lutz Gehlen lrg_ml at gmx.net
Thu Jul 1 13:09:59 PDT 2010


Hello Nigel,
thank you for your reply. I have had a quick look at the
visualization of the algorithm, it's quite helpful. I'm looking
forward to also look at your code as soon as I can find the time. It
will be fun to see some Go code, so far I haven't had a reason to
get into it.

Cheers,
Lutz

On Thu, Jul 01, 2010 at 11:39:24AM +1000, Nigel Tao wrote:
> On 30 June 2010 11:22, Lutz Gehlen <lrg_ml at gmx.net> wrote:
> > I would like to learn a bit more about stroking and filling is done
> > in modern graphics software, mainly out of academic interest. I am
> > particularly interested in thick stroking including antialiasing,
> > but also in filling.
> 
> It's not cairo, but I recently ported [0] the freetype rasterizer to
> the Go programming language [1]. It's an all-software scanline
> rasterizer (and IIUC the same algorithm that is used by the anti-grain
> library) and a Lisp programmer has written a nice visualization of
> that algorithm [2].
> 
> The freetype-go rasterizer code is relatively small (it's only 1370
> lines of code), including some stroking code I added this week (it
> does stroke-to-path), so it should be relatively easy to understand (I
> also haven't done any performance work, stress testing or corner-case
> QA'ing yet). I haven't got my head around Bentley&Ottmann yet but if
> you understand the cubic Bézier approximation to the quarter-circle
> then you should be able to follow the math in the stroking algorithm.
> 
> I'd be curious to know how it compares with other rasterization
> algorithms (in quality as well as performance) whether from research
> literature or from other graphics libraries.
> 
> [0] http://code.google.com/p/freetype-go/
> [1] http://golang.org/
> [2] http://projects.tuxee.net/cl-vectors/section-the-cl-aa-algorithm
> 
> cheers,
> Nigel.
> --
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo


More information about the cairo mailing list