[comp.sys.sgi] rectwrite on 70G series machines...

root@MCIRPS2.MED.NYU.EDU (07/29/90)

Does it work ?

I am using a 70G machine, which was never very fast for pixel operations.

I can not seem to get a patch of pixels to write from

rectwrite(0,XSIZE,0,YSIZE,Image);

The pixels are in an array of shorts.

static Colorindex Image[XSIZE][YSIZE];


I can get the pixels out by doing a

ortho2(-0.5,float(XSIZE)-0.5,-0.5,float(YSIZE-0.5));

for(i=0;i<XSIZE;i++)for(j=0;j<YSIZE;j++)
                {
                color(Image[i][j]);
                pnt2i(i,j);
                }



dan.
+-----------------------------------------------------------------------------+
| karron@nyu.edu                          Dan Karron                          |
| . . . . . . . . . . . . . .             New York University Medical Center  |
| 560 First Avenue           \ \    Pager <1> (212) 397 9330                  |
| New York, New York 10016    \**\        <2> 10896   <3> <your-number-here>  |
| (212) 340 5210               \**\__________________________________________ |
+-----------------------------------------------------------------------------+

kurt@cashew.asd.sgi.com (Kurt Akeley) (07/31/90)

In article <9007291150.AA09984@mcirps2.med.nyu.edu>,
root@MCIRPS2.MED.NYU.EDU writes:
|> 
|> Does it work ?
|> 
|> I am using a 70G machine, which was never very fast for pixel operations.
|> 
|> I can not seem to get a patch of pixels to write from
|> 
|> rectwrite(0,XSIZE,0,YSIZE,Image);
|> 
|> The pixels are in an array of shorts.
|> 
|> static Colorindex Image[XSIZE][YSIZE];
|> 
|> 
|> I can get the pixels out by doing a
|> 
|> ortho2(-0.5,float(XSIZE)-0.5,-0.5,float(YSIZE-0.5));
|> 
|> for(i=0;i<XSIZE;i++)for(j=0;j<YSIZE;j++)
|>                 {
|>                 color(Image[i][j]);
|>                 pnt2i(i,j);
|>                 }
|> 
|> 
|> 
|> dan.

my direct response to dan bounced, so i'll respond on the net.

rectwrite was added to the GL when the GT was released.  it was
not ported to the 70G at that time (i think release 3.0).  at
some later release, probably 3.1, it was ported to the 70G.
it is definitely supported on 70G in the 3.3 release, almost
certainly in the 3.2 release.

perhaps someone else knows exactly which release added rectwrite
to the 70G?

-- kurt

jindak@surfside.sgi.com (Chris Schoeneman) (07/31/90)

In article <11144@odin.corp.sgi.com> kurt@cashew.asd.sgi.com (Kurt Akeley) writes:
>In article <9007291150.AA09984@mcirps2.med.nyu.edu>,
>root@MCIRPS2.MED.NYU.EDU writes:
>|> I can not seem to get a patch of pixels to write from
>|> 
>|> rectwrite(0,XSIZE,0,YSIZE,Image);
>|> 
>
>my direct response to dan bounced, so i'll respond on the net.

My mail bounced, too.

     You might have made a typo, so I just wanted to be sure that you
knew the correct order for the parameters.

  long    rectread(Screencoord x1, Screencoord y1,
                   Screencoord x2, Screencoord y2, Colorindex parray[]);
  long    lrectread(Screencoord x1, Screencoord y1,
                    Screencoord x2, Screencoord y2, unsigned long parray[]);

  void    rectwrite(Screencoord x1, Screencoord y1,
                    Screencoord x2, Screencoord y2, Colorindex parray[]);
  void    lrectwrite(Screencoord x1, Screencoord y1,
                     Screencoord x2, Screencoord y2, unsigned long parray[]);

You've got (x1,x2,y1,y2) not (x1,y1,x2,y2).  While this is different from,
say, ortho2(), viewport(), and scrmask(),  it is the same as rect().

-Chris Schoeneman

	       Chris Schoeneman | I was neat, clean, shaved and sober,
    jindak@surfside.esd.sgi.com | and I didn't care who knew it.
	 Silicon Graphics, Inc. |		-Raymond Chandler
	      Mountain View, CA |		 (The Big Sleep)