Skip to contentSkip to conversation

X11 pixel value on bigendian PPC

DISCUSSION Robert Roebling 2 participants 2 messages Jan 13, 2000 – Jan 14, 2000

lore
Share & tools
lore
#0 lore raw

Hi,

I'm the main authour of the Linux port of the wxWindows GUI library and I need help from one of you to make wxWindows work on LinuxPPC as well as elsewhere. I'm sure that 99.9% of the library will work equally as on my intel, but I have one lingering problem, and that is that PowerPC are probably bigendian. Not much of a problem in most cases, but when converting image data under X11 (or GTK for that matter) this plays a role. I had no problem to write image conversion routines for 8-bit displays (no change in big vs. little endian) and on 24-bit systems (just exchange RGB bytes), but for 15 and 16 bit visuals, I'm stuck with no machine I could test this on (the Suns I can use have either 8-bit or 24-bit) and no info either. Do you have any info on the meaning of bits on a big-endian computer in the pixel value, that is returned by an XGetPixel() call ona 16- and on a 15-bit visual? If not, maybe someone who has access to a big-endian machine with such a visual could have a look at the relevant source in wxWindow and see what happens? Just for information, wxWindows can be found here:

http://wesley.informatik.uni-freiburg.de/~wxxt

and the code that poses problem is in file

wxGTK/src/common/image.cpp

lines 1610 and following,

Regards,

Robert Roebling

I'm not subscribed to this list.

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#1 lore raw
Quoted 14 lines · Robert Roebling

I'm the main authour of the Linux port of the wxWindows GUI library and I need help from one of you to make wxWindows work on LinuxPPC as well as elsewhere. I'm sure that 99.9% of the library will work equally as on my intel, but I have one lingering problem, and that is that PowerPC are probably bigendian. Not much of a problem in most cases, but when converting image data under X11 (or GTK for that matter) this plays a role. I had no problem to write image conversion routines for 8-bit displays (no change in big vs. little endian) and on 24-bit systems (just exchange RGB bytes), but for 15 and 16 bit visuals, I'm stuck with no machine I could test

Quoted 8 lines

this on (the Suns I can use have either 8-bit or 24-bit) and no info either. Do you have any info on the meaning of bits on a big-endian computer in the pixel value, that is returned by an XGetPixel() call ona 16- and on a 15-bit visual? If not, maybe someone who has access to a big-endian machine with such a visual could have a look at the relevant source in wxWindow and see what happens?

The XVisualInfo structure gives you the information you need. (The red_mask, green_mask, and blue_mask fields should be used to tell you how to [de]compose a pixel.)

The way the pixels are laid out varies between X servers, so you definitely do not want to hard code this. I.e, I've seen some X servers which use only 5 bits per pixel and others which did 5-6-5. (And other combinations certainly are possible.)

In the past, I've found Xvnc to be a useful tool for testing this type of code. It lets you create custom visuals at different depths with different mask values for the pixels. See

http://www.uk.research.att.com/vnc/xvnc.html

for more information on VNC.

Kevin

Signature · 4 lines
Kevin Buettner
[email protected], [email protected]

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/