picairo - Pike bindings for Cairo
With picairo, you have access to most of the public API of cairo 1.0.x, directly from Pike.
This is the first release.
More information is at: http://hack.davve.net/hack/picairo-site
Sweet. That reminds me that image objects really should be able to contain an alpha channel....
They could really do with a rewrite from scratch too, so they could be in different modes than 8x3 bit rgb. For instance 4x32 bit float rgba.
I started once but I got waylaid and never finished...
My idea was to more or less merge Image and Layer objects, with some lazy components to save memory for opaque images.
Your solution is cooler though, but it's not something I will find time to do.
The layer objects could support a lot more operations. That would be a good start. They already support (or should, anyway) cropping.
For now there is Cairo.GTK2Context which can be created from a drawable, like GTK2.DrawingArea. So something like this:
{ ... drawing_area->signal_connect("expose-event", handle_expose); ... }
void handle_expose(GTK2.Widget widget, ...) { Cairo.Context ctx = Cairo.GTK2Context(widget); /* draw using ctx */ }
lets you paint to it.
Don't know. What I use is the function 'gdk_cairo_create', and in case of a GTK version older than 2.7.x I have included it with the distribution (prior the function doesn't exist). That version does most certainly not work with win32 since it uses cairo_xlib_surface_create.
pike-devel@lists.lysator.liu.se