best approach to fast display of images?



Hi,

I have to quickly display an image which gets brighter and brighter,
then darker and darker (breathing effect). The image is grey and has no
alpha channel right now. Time consuming is not the recalculation of the
image's data but displaying it:

This worked -- but is way too slow:
----------------------------------

* created a gtkimage

* loaded image once from file into a pixbuf and got a pointer to the
  data with gdk_pixbuf_get_pixels

* then a loop doing:

  * change data of pixbuf (consumes ~30% of time)

  * gtk_image_set_from_pixbuf(): drawing into the window of the gtkimage

  * gdk_window_process_updates() (consumes ~70% of time!)



This is quicker but still not enough:
-------------------------------------

* a loop doing:

  * change data of pixbuf

  * gdk_draw_pixbuf(): drawing into the window of the gtkimage


This is still not fast enough and also has the negative side effect that
the image isn't drawn into the gtkimage but in the upper left corner of
the gtk *main* window itself.

Does anyone have a better solution to that?

Thank You
 Felix



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