[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Image file loading



Adrian Ratnapala wrote:

>> to do very much with this. The archive code has to handle the file
>> opening/reading while libjpeg & co handle the decoding. At least libpnm
>> fits neatly into this scheme.
>
>As does libjpeg.  They already have an abstract data source/sink, for justthis
>kind of emergency.  I still think we can use imlib.

The problem with imlib is this one (again from the tutorial): 

---------------------
ImlibData *Imlib_init(Display *disp);
void gdk_imlib_init();

This function inititalised Imlib. It must be called early in the program
BEFORE any other Imlib functions are called. You must call it AFTER you call
XOpenDisplay or gdk_init. The Xlib version needs to have the display
variable passed to it. The Xlib version is capable of running on multiple
displays - you just init Imlib per display variable. 
<p>
This function causes Imlib to investigate properties of your XServer - ie,
is the shared memory extension available? - if so, use it. The depth(s) of
the visual(s) and choosing the best visual, initializing the caches to be
empty, load a default palette (if in 8bpp) and set up a dither matrix etc.
---------------------

IMHO imlib is so closely tied to Xlib/Gdk that adapting it for PPlay would
require a major redesign of some of its central parts. Itīs a pity, but I
currently donīt see a viable way to use it.

However we surely can use some imlib code for us...

Cu
	Christian