[cairo] cairo+DevIL ?

Vladimir Vukicevic vladimir at pobox.com
Sat Aug 18 01:08:54 PDT 2007


John Ellson wrote:
> In a January 2007 posting
>     <http://lists.cairographics.org/archives/cairo/2007-January/009198.html>
> Vlad suggested that DevIL
>     <http://openil.sourceforge.net/>
> would make a good backend for rendering other bitmap formats (gif, jpeg, 
> tga, ...) from cairo.
> 
> Is this still the best-practice recommendation?   Is there any sample 
> code out there?
> 
> I've made an initial attempt to bind the two together.  The problem I'm 
> having at the moment
> is that the in-memory data formats seem to be incompatible:
>     CAIRO_FORMAT_ARGB32   v.  IL_RGBA
> 
> Do I really have to byte-twiddle the image data just to transfer between 
> these two fine libraries?

I'm not sure if there is a single best-practice recommendation; I've 
certainly had good experience using DevIL in the past, though I have 
never used it with cairo.  It's interesting that DevIL only provides 
IL_RGBA and IL_BGRA; the documentation annoyingly states that these 
formats are "self explanatory", which they are not.  Maybe IL_BGRA 
happens to be compatible, if they're talking about byte order?

     - Vlad


More information about the cairo mailing list