Re: Gamma correction using GDK/directly accessing pixmap pixels



Hongl Lai <hongli telekabel nl> writes:
I am writing a 2D game using GTK and GDK, and I need to implement gamma
correction to do things such as a screen that goes black slowly.
Is it possible directly access a GdkPixmap's pixels?

No, the GdkPixmap is server-side. Many X servers support shared memory
pixmaps, but GDK doesn't provide a way to access that feature, so
you'd have to use plain X.

Closest thing in GDK is to use a GdkImage, then copy that to a pixmap.

Note that for both shared pixmaps and GdkImage there are around 20
different image formats you have to deal with, depending on the user's
hardware, unless you can control the hardware that will be used.

The reason for GdkPixbuf is to avoid writing each image manipulation
function 20 times, once for each format, obviously at the expense of
some efficiency.

Havoc



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