Fast Image Manipulation?



I thought I'd clarify my previous question. These are the thoughts that occur to
me.

asically, right now I have a drawing area widget onscreen and a gdk pixmap
offscreen. I want to blast item images onto the offscreen pixmap, then blast the
offscreen pixmap onto the onscreen drawing area, many times per second.

The item images are in a gdk_imlib image. Successive frames run horizontally,
while different types run vertically. As items move around the screen, they also
animate. So from one frame to the next, I may be drawing another section of the
items image onto the offscreen pixmap in a slightly different position.

Now, if I were drawing straight to the screen, I could keep my items image as a
gdk pixmap and do a simple gdk_draw_pixmap to blast the appropriate section.

If I use gdk_imlib_paste_image, I don't get to choose a section, it just scales
the image to fit. I'd have to do a gdk_imlib_crop_and_clone_image first, which
is too slow (I assume). Or, I'd have to do that at the beginning, and keep many
smaller item images, which takes up more memory (I assume). That's not good
because I may have many item types and frames.

What I need is an equivalent of bitblt (Win32 function) to just copy bits of one
image to another. But I don't see one offhand. Presumably I could manually play
with the bits. Is that what this will come to?

Or are there any other good suggestions?


-- 
SEGV    http://www.cgocable.net/~mlepage/



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