[sane-devel] Patches for SANE 1.0.9 be/fe compiled on IRIX

Henning Meier-Geinitz henning at meier-geinitz.de
Thu Jan 9 13:13:38 GMT 2003


Hi,

On Tue, Jan 07, 2003 at 12:46:32AM +0100, Andrea Suatoni wrote:
> > > diff -ruN sane-frontends-1.0.9/src/xcam.c sane-frontends-1.0.9-patched/src/xcam.c
> > > --- sane-frontends-1.0.9/src/xcam.c   Sat Jun  9 14:52:05 2001
> > > +++ sane-frontends-1.0.9-patched/src/xcam.c   Fri Dec 13 00:41:42 2002
> 
> > That one doesn't work on Linux/X11/i386. The colors are wrong. The old
> > code was correct (at least for 24 bit, 4 bytes per pixel, little
> > endian). Well, at least it worked here :-)
> 
> Using the SGI X server in 24 bit (SGI boxes are big endian), the red and blue
> channels are swapped without the change. You may enclose the changes I've
> applied using #ifdef __sgi (this will be valid only on SGI machines, using
> either GCC or the SGI compiler).

Ok, but I'd rather try to understand what's up here. Basically, you
are chnaging the rules for the order of colors in memory with your
patch. While it was rgb for big-endian and bgr for little-endian your
patch swaps it to make it the other way round.

First I thought the test for little/big endian may not work but as
this is done in two different ways, I don't think so.

So it looks like (at least on your system) the color order is bgr
despite it's big-endian. Could you test all the cases (24/4, 24/3, and
32)?

Does 32 exist at all?

Bye,
  Henning



More information about the sane-devel mailing list