Thanks for the note on Linux.
I noticed that too, but I wanted a clean case first.
It turns out Linux represents color not
in ints (as glpixels does: ARGB, where B=256|c), 
but in 4-element arrays of bytes, always RGBA, R=c[0].

http://developer.gnome.org/doc/API/2.0/gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.html#image-data
(See example, array setting.)

So we have to exchange places of R and B for linux.

rgba2bgra=: ,@(_4&(2 1 0 3&{\))&.(2&(3!:4))"1  NB. little-endian 32-bit color


The format of Platform Image returns the
color in integer format ARGB, such that
B = 256|c  or  (A,R,G,B) = (4#256) #: c

   ~.,readimg jpath '~profile/jicon.gif'
_1 _65536
   (4#256) #:_1 _65536   NB. White, Red
255 255 255 255
255 255   0   0


BTW, "viewrgb" from viewmat does not correctly
show the color, and always inverts R and B.


--- bill lam <[EMAIL PROTECTED]> wrote:

> I look at the oleg's sample image for linux uploaded, it seems the color is
> incorrect, blue become orange. I guess this is related to RGB convection for
> glpixels.
> 
> windows: RGB is an integer with R in the LSB
> 
> I'm also interested to know if R or B being in the LSB for cases
> Linux:
> Mac:
> Mac Intel:
> 
> is the alpha component also supported by glpixels?
> 
> btw does gtk+ expect B in LSB so that the color is wrong for Oleg's image?
> 
> -- 
> regards,
> bill
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to