Re: [gtk-list] Imlib 1.9.0 question

On Wed, 20 Jan 1999 wrote:

> these changes are not 100% finalised - 1.9.2 is imminent - ned to clean
> this up - notice all the loaders are now .so's - but there isn't a
> "pluggable" api to them - i don't expect a program por user-level
> plugin system till 2.0 - this changed merely to save memory.
But wouldn't it be a nice idea to support user plugins.  There has to
be a void *data pointer to ship, which the user could fill with data.
Please think about that because the current state of Imlib would only
need a small change I think.

> Imlib 2.0's design currently has all the code delayed - ie all init's
> and loads are delayed till the last possible second (for example - whne
> loading images it gives you an opaque (now opaque) handle but only
> loads the image header, if the plugin allows this, so it just detects
> width, height, image format and depth etc.. but does nto decode the
> image data - the image data is decoded in a second pass just before the
> data is actually needed by rendering or exporting of the data). the
> same can be done for display initialisation.
Do I understand this right that it is possible to do for instance:

   GdkImlibImage *im;

   im = gdk_imlib_load_image("my_file.png");
   gdk_imlib_crop_image(im, 42, 42, 42, 42);
   gdk_imlib_save_image(im, "my_new_file.png", NULL);
   return 0;

Would this save a section of my_file.png which was mirrored before saving?
I think these manipulations of RGB-Data did not require any DISPLAY.
But Gdk isn't initialized yet and the documentation says it has to.
How avoid this or is there a way to initialize Gdk partially and avoid
checking for a valid display?

> did you change the rgb_data pointer? if you did you most certainly will
> have done some nasties - yes i know - it  should be opaque. i'm fixing
> all this in 2.0
> ->     Was there any change in the internal Imlib structure???
> you may chang the datat rgb_data points to but not the pointer... :)
I've done up to version 1.8.1 the following

   im->rgb_width = w;
   im->rgb_height = h;
   buf = malloc(w*h*3);
   im->rgb_data = buf;

This worked well and is what I understand from the HTML-doc.

If this is not supposed to do how should I crop an image or rotate
an rectangular image at 90 degree?  Do I have to relay on the Imlib

Kind regards


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