Thanks Kobchenko,  it works.

On 5/7/06, Oleg Kobchenko <[EMAIL PROTECTED]> wrote:

Pixeldata is raveled matrix of RGB pixels.
A pixel is an integer 256#.R,G,B (each 0..255).

   load'viewmat'
   coinsert 'jgl2'

   '`R G B'=: (256*256*])`(256*])`]
   lt=: >/~i.8 8
   ut=: </~i.8
   di=: =/~i.8
   ut;lt;di
+---------------+---------------+---------------+
|0 1 1 1 1 1 1 1|0 0 0 0 0 0 0 0|1 0 0 0 0 0 0 0|
|0 0 1 1 1 1 1 1|1 0 0 0 0 0 0 0|0 1 0 0 0 0 0 0|
|0 0 0 1 1 1 1 1|1 1 0 0 0 0 0 0|0 0 1 0 0 0 0 0|
|0 0 0 0 1 1 1 1|1 1 1 0 0 0 0 0|0 0 0 1 0 0 0 0|
|0 0 0 0 0 1 1 1|1 1 1 1 0 0 0 0|0 0 0 0 1 0 0 0|
|0 0 0 0 0 0 1 1|1 1 1 1 1 0 0 0|0 0 0 0 0 1 0 0|
|0 0 0 0 0 0 0 1|1 1 1 1 1 1 0 0|0 0 0 0 0 0 1 0|
|0 0 0 0 0 0 0 0|1 1 1 1 1 1 1 0|0 0 0 0 0 0 0 1|
+---------------+---------------+---------------+
   c=: 255 <[EMAIL PROTECTED] *
   0":(R 0.5 c ut)+(G 1 c lt)+(B 0.5 c di)
  127 8323072 8323072 8323072 8323072 8323072 8323072 8323072
65280     127 8323072 8323072 8323072 8323072 8323072 8323072
65280   65280     127 8323072 8323072 8323072 8323072 8323072
65280   65280   65280     127 8323072 8323072 8323072 8323072
65280   65280   65280   65280     127 8323072 8323072 8323072
65280   65280   65280   65280   65280     127 8323072 8323072
65280   65280   65280   65280   65280   65280     127 8323072
65280   65280   65280   65280   65280   65280   65280     127
   scale=: [ #"1 #
   2 scale i.2 2
0 0 1 1
0 0 1 1
2 2 3 3
2 2 3 3
   NB. viewmat is BGR, for some reason
   viewrgb P=: 10 scale (R 0.5 c ut)+(G 1 c lt)+(B 0.5 c di)
   $P
80 80
   wd 'pc f closeok;xywh 0 0 40 40; cc g isigraph;pas 0 0;pshow;'
   glpaintx glpixels 0 0,(|:$P),,P



--- dai rui <[EMAIL PROTECTED]> wrote:

> HI,
>
> I am not sure how to use glpixels for drawing a pic with RGB data. The
help
> file give me none practical info. What exactly the pixeldata is ???
>
> Regards!


__________________________________________________
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

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

Reply via email to