[Xcb] Best way to load a png/jpeg file when using XCB?

Jamey Sharp jamey at minilop.net
Mon Jul 5 01:01:22 PDT 2010


On 7/4/10, Michael Stapelberg <michael+xcb at stapelberg.de> wrote:
> Because libxpm requires xlib, I can’t use it with xcb. So I looked into
> directly using libjpeg and/or libpng, but it seems very complicated
> (multiple
> pages of code to load an image while i3lock has only ~ 250 SLOC).

I don't know, I recently used libjpeg with SDL, which is about the
same style of interface as the xcb-image utility library, and it
wasn't that much code. Unfortunately I can't dig up my code right now
(perhaps iano can help), but I'd suggest looking at that approach
again. Note that libjpeg has several interfaces with different
capabilities, so explore the documentation carefully to find the
simplest one for your needs.

Jamey


More information about the Xcb mailing list