[comp.sys.next] Fast Pixel Plotting

sagar@jove.cs.pdx.edu (Sagar) (07/12/89)

Hi,
	i can't seem to plot points on the NeXT as fast as i would like.  i
started out by using:
	setgray newpath moveto lineto stroke,
then found that
	setgray xx yy 1.0 1.0 rectfill
was a bit better. However, there *must* be a better and acceptable(i.e. NeXT
police tolerant) way to do it.  i need to do it for image-processing, so speed
is neccessary.  While i'm at it, how do i crank out maximum raw power from the
68882? sigh.
sagar@psu-cs

ali@polya.Stanford.EDU (Ali T. Ozer) (07/12/89)

In article <1476@psueea.UUCP> sagar@jove.cs.pdx.edu (Sagar) writes:
>	i can't seem to plot points on the NeXT as fast as i would like.  i
>started out by using:
>	setgray newpath moveto lineto stroke,
>then found that
>	setgray xx yy 1.0 1.0 rectfill
>was a bit better. However, there *must* be a better and acceptable(i.e. NeXT
>police tolerant) way to do it. 

Check out user paths. User paths allow you to hand PostScript an array
of x, y values, an array of operations (such a moveto, curveto,
lineto, etc), specified by a single byte each, and a final user path
operator (such as ustroke or ufill).  If you can group together a large
number of lines and curves with the same gray/linewidth values, you can 
transfer them down with one userpath command. This cuts down on both
communications time and on the time PostScript spends parsing/interpreting
your data.

The Lines example in the Examples directory uses user paths; for more
information refer to the Display PostScript docs in the Appendices section
of the hard copy technical documentation.

Ali Ozer, NeXT Developer Support
aozer@NeXT.com