Re: [gtk-list] Imlib 1.9.0 question
- From: Andreas Tille <tille physik uni-halle de>
- To: raster redhat com
- cc: gtk-list redhat com
- Subject: Re: [gtk-list] Imlib 1.9.0 question
- Date: Wed, 20 Jan 1999 16:48:33 +0100 (MET)
On Wed, 20 Jan 1999 raster@redhat.com 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:
main()
{
GdkImlibImage *im;
gdk_imlib_init();
im = gdk_imlib_load_image("my_file.png");
gdk_imlib_crop_image(im, 42, 42, 42, 42);
gdk_imlib_flip_image_horizontally(im);
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);
free(im->rgb_data);
im->rgb_data = buf;
gdk_imlib_changed_image(im);
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
functions?
Kind regards
Andreas.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]