Re: shader program in cairo graphics?
Simon Sapin <[email protected]>
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Message-ID | <[email protected]> |
Le 28/05/2013 14:16, Jeong-Joon Yoo a écrit : > Hi all, > I have a question whether there is, in cairo graphics, a function like a > shader program shown in 3D graphics. > I hope to fill a polygon with some colors, and I hope to define the > color as a function depending on the (x, y) position. > Is there any cairo API or data structure related with this > functionality? or any examples? Any comment will be appreciated. Hi, In cairo, filling uses a *pattern* as a source. Look at the different pattern types, in particular gradient and mesh patterns: http://cairographics.org/manual/cairo-cairo-pattern-t.html Of course, these can not encode any arbitrary function of (x, y) to color. Are you looking for something more specific? Cheers, -- Simon Sapin -- cairo mailing list [email protected] http://lists.cairographics.org/mailman/listinfo/cairo