Re: BGR vs. RGB in GTK/GDK



Hi Mike,

On 2/21/07, Mike Melanson <mike multimedia cx> wrote:
facilities. I'm trying to convert it to use GTK/GDK. This app has always
rendered bitmaps in blue-green-red (BGR) pixel order which, per my
understanding, is the native order that the hardware expects. Now, I am
using gdk_draw_rgb_image()/gdk_draw_rgb_32_image() which clearly states
that it wants data in RGB order.

Is there a facility I am overlooking for rendering the BGR bitmap?

X11 (via the Visual) tells you what order your hardware expects, and
it's up to you to provide it. I guess it was done this way for
performance reasons. The downside is that it's extra effort for every
program to provide images in every possible format, and no one could
test their code properly.

gdk has a very fast RGB->anything system and everything goes through
that. It can be a little slower, but it's much more portable, much
less effort, and actually tested.

John



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