[cairo] Path Gradients

Bill Spitzak spitzak at thefoundry.co.uk
Tue Jan 22 23:29:09 PST 2008

That looks like a much nicer result, I was told this is called a "level 
set". The color is the distance from the nearest point on the edge.

Unfortunatly that is not what Windows is doing, it is doing the distance 
along a straight line from a fixed point to the edge. This produces 
sharp points all the way to the center. Not as nice but it would have to 
be replicated. My guess is that AGG could do this pretty easily.

Otherwise I have to say that those demos are f**king impressive! Can 
Cairo be made to do all this?

Milan Marusinec wrote:
> Hello Bobby,
>> However, there is one situation (that is my main interest in the path gradient) that I cannot figure out how to map to these "Type 6" gradient meshes. This situation is where you have a path, and you want to make a gradient from an abitrary "center point" out to the edges, with color stops along the way. Can you think of an easy way to use a "Type 6" gradient mesh to reproduce the gradients seen in these images:
>> http://www.bobpowell.net/pgb.ht4.jpg
>> http://www.bobpowell.net/pgb.ht6.jpg
> I think, I have recently implemented the thing you want.
> Have a look at:
> http://www.aggpas.org/aggpas-demo.htm#ContourGradient
> It is done for different library than cairo and it is
> in Pascal, but the alghorithm (which could be ported
> to cairo) is there and it's licence allows you to do so.
> Basically, the whole thing is about firstly computing
> the so called Distance Transform (DT) from any arbitrary
> shape, which then further serves as a source of color
> transition levels. It's also pretty fast. You can also
> download a compiled executable demo and play with it a little.
> Cheers
> Milano
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo

More information about the cairo mailing list