[cairo] high-fidelity anti-aliasing in Cairo/libpixman?

Leon Woestenberg leonw at mailcan.com
Fri Nov 5 17:19:03 PST 2004


Hello all,

found the answer myself, but it was not satisfactory :-)

Leon Woestenberg wrote:

> I tried to see how Cairo and libpixman cope with the problem of 
> calculating pixel
> alpha values, but could not derive an algorithm out of the C code.
>
> I assume the stuff sits in "libpixman/ictrap.c/IcRasterizeTrapezoid() 
> and PixelAlpha()"
> for most of it.
>
I think I found the algorithm being described in ictrap.c, line 921
("Pixel coverage") and indeed it looks like the box-filter approach
(aka unweighted area sampling) which is considered sub-optimal by
modern computer graphics papers.

I think in order to enhance Cairo's output even further, it should
deploy weighted area sampling (optimally, where the weighing function
is target dependent - for example, CRTs have different pixels than
TFT's do - this can be exploited by the weighting function.)

Optimized weighted area sampling has been optimized (discretized and
quasi-linearized) by Corthout, Pol and Jonkers ("point containment
approach").

See pages 11 and 12 about research projects coached by Forrest
on high-fidelity anti-aliasing:

http://www.sys.uea.ac.uk/research/pdfs/Vision/Graphics%203.0.pdf

The next very short texts give an example of the "point containment
approach" which seems a valid approach for the problem.

The Group for Computer Graphics, Sao Paolo University, Brasil

http://www.ime.usp.br/~aef/
http://www.ime.usp.br/~aef/grupo/

Especially these small texts give quick insight in ongoing work:

http://cgcap.ime.usp.br/highquality.html
http://cgcap.ime.usp.br/appliedcg.html

I especially like the concept of directly drawing weighed pixel
alpha values directly from dissection a Bezier curve without
the intermediate steps.

Sorry for the ranting, and sorry for not giving more references
for now. I will publish an annotated bibliography soon from where
I found what.

Regards,

Leon Woestenberg.



More information about the cairo mailing list