The bug in displaying toucan.bmp can either fixed by amending readbmp or
glpixels, but not both.  Not sure what should be done, in little endian,

    hfd 256 #. 255 0 0
ff0000

so that the high byte is 255, and reverse for big endian.

also in windows, RGB is a macro
#define RGB(r,g,b) \
((COLORREF)((BYTE)(r) | ((BYTE)(g) << 8) | ((BYTE)(b) << 16)))

that is r in the lowest byte

Apparently J601 does not use this convention.

Чтв, 12 Май 2011, L.Tomei писал(а):
> 
> When I try to view a bmp image, I get wrong colors.
> It seems that red and blu are swapped.
> 
>    load 'viewmat'
>    viewbmp jpath '~addons/graphics/bmp/toucan.bmp'
> 
> Similar behaviour with viewrgb:
> 
>    viewrgb 100 100 $ 256  #. 255 0 0 NB. should be red, I get blu
>    viewrgb 100 100 $ 256  #. 0 255 0 NB. ok, I get green
>    viewrgb 100 100 $ 256  #. 0 0 255 NB. should be blu, I get red
> 
> It works correctly in J601.
> 
> Lorenzo
> -- 
> View this message in context: 
> http://old.nabble.com/graphics-viewmat-tp31600727s24193p31600727.html
> Sent from the J Programming mailing list archive at Nabble.com.
> 
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm

-- 
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to