Re: Efficient image drawing



Murray Cumming wrote:

On Thu, 2006-04-27 at 05:20 -0500, Paul Davis wrote:
Howdy,

I'm developing a video playback app and I'm a bit curious to see if there's a better way to render images to the screen. As it is now I'm using the Gtkmm objects and copying images from my non-standard format in a GdkPixbuf and then drawing to a GtkDrawingArea using gdk_draw_rgb_image_dithalign.
[snip]

This documentation suggests that GdkPixbuf doesn't need to copy the
data:
http://developer.gnome.org/doc/API/2.0/gdk-pixbuf/gdk-pixbuf-creating.html#gdk-pixbuf-new-from-data
Definitely noticed this a few hours ago and removed an image copy operation. Not to mention the (assumed) malloc/free calls when each pixbuf is created/destroyed.

As it is now, I load a frame, and copy it directly into the pixbuf array, expanding to 24bpp as I do.

What I'm mostly wondering about is if its possible to dig deeper into X so that I'm bypassing the whole gdk_draw_rgb_image_dithalign call or for that matter if any of the gdk_draw_rgb_image_* methods are faster.

Maybe if you implemented a GdkPixbuf backend for your custom format, you
could save on some slow memory copying.

I have to expand the 8bpp image to 24bpp anyway because of other requirements, so the one copy operation is necessary anyway. But that is an idea I hadn't thought of. I'll take a deeper look into Pixbuf and its drawing in a couple hours and hopefully refine my question.




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