GdkPixBuf - Byte Order



Hello,

We are facing some problem with the byte ordering of the GdkPixbuf.

In our application, we are using gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE,
depth, width, height) for getting a GdkPixBuf * and from the pixbuf we are
getting the the guchar * picturebuf. We store our image data in the
picturebuf in the following order:
  picturebuf +  = blue;
  picturebuf + 1 = green;
  picturebuf + 2 = Red;
  picutrebuf + 3 = alpha;

But, from the documentation we found that GdkPixBuf uses
  picturebuf +  = red;
  picturebuf + 1 = green;
  picturebuf + 2 = blue;
  picturebuf + 3 = alpha;

Because of the mismatch in the byte ordering, ie GTK using LSB and our
application layer using MSB, we are required to swap byte  and byte 2. Our
system is based on Little Endian and GTK version 2.4

Is there a way to configure the byte ordering in GTK/GDK ? Since I am new
to gtk environment, request you to guide me.

Thanks and Regards
Calvin










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