Re: [gtk-list] GdkImage vs. pixmaps, speed.
- From: Havoc Pennington <hp redhat com>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] GdkImage vs. pixmaps, speed.
- Date: Tue, 23 Nov 1999 18:26:30 -0500 (EST)
On Tue, 23 Nov 1999, John C Atkeson wrote:
>
> Does this mean that if I plot 100,000 lines to a GdkImage (then load
> the finished raster) it will be significantly faster than plotting them
> straight to a pixmap?
It will be faster to draw. However, you have two remaining issues:
- what routines will you use to draw? there's no gdk_draw_line()
for GdkImage
- you have to copy the image onto the server for rendering, so this
can be slow (but not as slow as 60,000 draw calls).
The best way to do this is to use GdkRGB (gdk/gdkrgb.h). Draw into this
RGB buffer, then call the GdkRGB functions to copy to a drawable (window
or pixmap). Internally, GdkRGB is using GdkImage, but an RGB buffer is
more convenient to deal with than a GdkImage.
You still need drawing routines if you want to draw anything other than
single pixels though. You might look at the Guppi source code; Guppi
probably won't compile right now, but it contains the "mi" scan conversion
library. guppi2/src/libguppi/rgbdraw.h in CVS should be interesting to
you.
GNU Plotutils is another interesting library for this. libart (comes with
gnome-libs) works too but is optimized for quality over speed.
Havoc
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]