[cairo] Mac Tiger Core Image

Carl Worth cworth at cworth.org
Thu Mar 17 11:45:28 PST 2005


On Thu, 10 Mar 2005 17:07:54 -0500,  wrote:
> Conversely, with or without antialiasing, Cairo should handle
> boundaries between interior triangles just fine already as there is
> not an intervening compositing step.

Actually, that's not true for cairo. The cairo implementation does use
intermediate compositing to combine the simple trapezoids into the
mask for the object shape. And it does use antialiasing there, (the
rasterizer never knows which trapezoid edges are interior or
exterior).

This works because the rasterization is expressly specified so that
the following property is always true:

	For any pixel, the sum of the alpha values for any set of
	trapezoids that tessellate the pixel must be 1.0.

This guarantees that there are no internal seams due to cairo's
tessellation of complex shapes into trapezoids.

> The difficulty is that for my use cases the polygons may have to be
> composited separately; there is no way around that.
> 
> I need to have the ability to avoid any anti-aliasing until after
> all compositing is finished.

Eliminating anti-aliasing is not the only solution to this problem. If
you know that two polygons share a common edge, you can take advantage
of the property described above to perform separate compositing
without seams. You'd want to do something similar to what cairo does
for the interior trapezoids, (ie. render to an intermediate surface
with the ADD operator, then composite the result).

This is an entirely separate issue from the desire to not have
antialiasing for high-resolution devices that don't need it. (But in
that case, there's no need for the user to have to say anything about
this --- the backend will know already).

> I think it would be more helpful if I provided a concrete example.
[snip]
> In renderers where the alpha channel is being used to simulate
> partial coverage, then there will be a faint grey curve through the
> middle of the black square -- this is assuming the renderer leaves
> no gaps.

Again, as the user, you have complete control over this. When you know
that the two shapes share edges and you want to avoid the seams on
these edges, you can first composite those two shapes onto an
intermediate surface (even with their separate source patterns), and
then composite the result onto the background.

There's no need to disable antialiasing here. Instead, as a user, you
have the ability to create whatever surfaces you need, and you can use
the alpha value independently for coverage or translucence on any
surface.

Some operations will require a mask operation which doesn't exist in
cairo now, but will once the API shakeup is complete.

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050317/eb43f012/attachment.pgp


More information about the cairo mailing list