* X11 pixel value on bigendian PPC
@ 2000-01-13 19:01 Robert Roebling
2000-01-14 15:51 ` Kevin Buettner
0 siblings, 1 reply; 2+ messages in thread
From: Robert Roebling @ 2000-01-13 19:01 UTC (permalink / raw)
To: linuxppc-dev
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/
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: X11 pixel value on bigendian PPC
2000-01-13 19:01 X11 pixel value on bigendian PPC Robert Roebling
@ 2000-01-14 15:51 ` Kevin Buettner
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Buettner @ 2000-01-14 15:51 UTC (permalink / raw)
To: Robert Roebling, linuxppc-dev
On Jan 13, 7:01pm, Robert Roebling wrote:
> 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?
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
--
Kevin Buettner
kev@primenet.com, kevinb@cygnus.com
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2000-01-14 15:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-01-13 19:01 X11 pixel value on bigendian PPC Robert Roebling
2000-01-14 15:51 ` Kevin Buettner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).