Re: Gamma correction using GDK/directly accessing pixmap pixels



Hongl Lai <hongli telekabel nl> writes:
On Fri, 2001-11-30 at 23:01, Havoc Pennington wrote:

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

So there is no other way to do gamma correction?
Or a fast algorithm that uses Gdk-pixbuf?

Not that I'm aware of. If you copy data into a canonical format such
as GdkPixbuf, then you inherently and unavoidably add the overhead of
one copy into that format and one copy back out of it into display
format. If you don't copy data, you inherently have the problem of 20
different display formats. This is totally unavoidable, because
computer hardware has different display formats.

So the question you have to answer is whether you can afford the two
extra copies.

Havoc




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