[cairo] How to load a BMP/JPG/TGA to a Surface?
adrianlopezroche at gmail.com
Tue Jun 1 13:09:56 PDT 2010
On Tue, Jun 1, 2010 at 12:35 AM, Mj Mendoza IV
<mjmendoza at konsolscript.org>wrote:
> Is there any way that I could load BMP/JPG/TGA without being tied to a
> specific library to avoid bloat? Is there a minimalist reusable 'standalone'
> function that directly loads a BMP/JPG/TGA into the memory which cairo could
I load images into memory using DevIL  and copy them from memory onto a
Cairo image surface, translating from DevIL's IL_RGBA format to Cairo's
CAIRO_FORMAT_ARGB32 . Cairo has no built-in support for most image
formats, so your only options are to use a third party library like DevIL or
write your own image loading routines.
 Something to look out for if you decide to do this: While the order of
pixel components in Cairo's image format is affected by endianness, the
order of components in DevIL is not. Thus, on x86 systems it turns out that
while DevIL's format looks like (R, G, B, A), Cairo's format actually looks
like (B, G, R, A).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cairo