[cairo] Observations from a newb

Behdad Esfahbod behdad at behdad.org
Thu Nov 8 10:00:50 PST 2007

On Thu, 2007-11-08 at 12:01 -0500, Dirk Schönberger wrote:
> >> I don't quite understand that. Coming from the "Cairo draws stuff" pov
> >> again:
> >> images *are* stuff.
> >
> > Sure. And cairo has a notion of them with cairo_image_surface_t and it
> > can definitely draw them. The "problem" only comes when you talk about
> > the dozens of different file formats that exist for storing images and
> > how to load those into a cairo_image_surface_t. That's definitely a
> > big task that's outside the scope of cairo itself.
> >
> Oh, then I seem to miss something. I am not quite up to date with the
> actual code, but I consulted the API documentation at cairographics.org.
> While I found a way to render _to_ ciro image surfaces, I have found no
> way to render a image surface or a RGBA buffer using cairo functionality
> I.e. something like
> cairo_t *cr;
> cairo_matrix_t *ctx;
> cairo_image_t *img;
> cairo_render_image (cr, img, ctx);

It's the combination of cairo_set_source_surface() and cairo_paint()
that does that.

> Creating the cairo_image_t (or more generically a device independent
> image, aka a RGBA buffer) would be left to other parties.

Did you read the tutorial:


> Regards
> Dirk


"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759

More information about the cairo mailing list