[cairo] Path as a resource

Bill Spitzak spitzak at d2.com
Fri Nov 10 12:07:59 PST 2006


If there is a path object, it should be in device space. The 
transformation must be applied at the moment a point is added to the 
path. Extracting a path and then putting it back should have the 
appearance of removing the CTM when you get it and applying the 
(possibly different) CTM when you set it. If speed is a problem it may 
be a good idea to put the CTM into the path object so that it can apply 
the transforms at the same time when the path is set.

Any operation on paths should replace the current path with the new one.
Besides stroke and flatten, you might want to transform the path, and I 
could imagine erode/swell type operations being very popular too.

Making the path be a surface is interesting. I would think a path would 
act just like a surface which is opaque white inside the path and 
transparent black outside it.

To be consistent, you should be able to use a surface as the current 
path, which would ignore the color and treat the alpha channel of the 
surface as an indication of how much inside the path a pixel is. By far 
the biggest advantage of this is that it would allow the clip to be set 
to an image's alpha channel.

This would complicate Cairo, however, as the compositing would have to 
allow a path or image to be used at any location in the math. Also if 
there is an operations such as stroke, should it do the edge detection 
necessary for any image used as the current path?

Mike Emmel wrote:
> I've been thinking about the concept of having paths as resource like
> patterns or fonts.


More information about the cairo mailing list