Re: Equivalent to gdk_draw_rgb_image that scales output?



Hi Havoc,

> Is there an equivalent function to gdk_draw_rgb_image that can do
> simple decimation and expansion, so that (for instance) I can display
> a 1536x1024 image at fullscreen size on a 1024x768 display surface?

We don't have the code to do on-the-fly scaling without creating the
temporary RGB buffer. It's really painful to write because there are
so many formats for the hardware image data (GdkImage).

Hmm. I guess I will try benchmarking my own code against the pixmap functions. Thanks for the direction.

Just in case you happen to have a great idea for me to poke into - Given that I'm stuck with XFree86 3.3.6 (my hardware isn't supported under 4.x), and also given that my source images are at sizes that will usually be out of my control, what's the fastest drawing strategy you can think of? At the moment I have a single window with a drawing area inside it, covering the entire screen. I decode my image data into an external buffer at whatever size it arrived at (I can't decimate it at that point - I need to leave it fullsize, because the user might request a zoom or an orientation change, and decoding the image to RGB 8:8:8 is a very time-consuming operation - I want to do it just once at full resolution, cache the decoded copy, and work from that). I then have to use my own decimation code to get the data into a screen-sized RGB buffer, then gdk_draw_rgb_image to get it into the window. All of those operations are pretty slow and ugly.

BTW, thanks also for your earlier response on hiding mouse cursor, it worked :) However the unref functions don't appear to be present in the version of gtk I'm using - not an issue for me, just an fyi.


-- Lewin A.R.W. Edwards
Embedded Engineer, Digi-Frame Inc.
Work: http://www.digi-frame.com/
Tel (914) 937-4090 9am-6:30pm M-F ET
Personal: http://www.larwe.com/ http://www.zws.com/





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