mirror of
https://github.com/PDP-10/its.git
synced 2026-01-13 15:27:28 +00:00
101 lines
3.5 KiB
Plaintext
101 lines
3.5 KiB
Plaintext
Date: 1 July 1980 14:57-EDT
|
||
From: George J. Carrette <GJC at MIT-MC>
|
||
To: "(FILE [GJC;GRAPHS USAGE])" at MIT-MC
|
||
|
||
Date: 1 July 1980 14:53-EDT
|
||
From: George J. Carrette <GJC at MIT-MC>
|
||
To: MEM at MIT-MC, JGA at MIT-MC
|
||
cc: "(FILE [FILE GJC;GRAPHS USAGE])" at MIT-MC
|
||
|
||
|
||
The generic functions are
|
||
|
||
set-pen, move-pen, vector-pen, draw-point, draw-line.
|
||
|
||
set-window, set-viewport, get-window, get-viewport.
|
||
|
||
The first argument to these functions is always a graphic object.
|
||
The rest of the arguments are always paired X,Y. e.g.
|
||
(set-pen foo x y) and (draw-line foo x1 y1 x2 y2).
|
||
The coordinate arguments can either be numbers, arrays of numbers,
|
||
or lists of numbers.
|
||
|
||
(make-ards-stream) makes you an ards-object.
|
||
(make-graphics-stream <ards-object>) takes an ards-object and returns
|
||
a flonum-scaling graphics stream.
|
||
|
||
Other operations are conviently accessed with the CALL function.
|
||
|
||
(call <stream> 'cursorpos 'c)
|
||
(call <stream> 'which-operations)
|
||
(call <stream> 'open 'tty)
|
||
(call <stream> 'open 'dsk '((foo) bar >))
|
||
(call <stream> 'close)
|
||
|
||
No compile-time considerations are needed when using the generic operators.
|
||
However, users of call should do (or (get 'closure 'version) (load '((gjc)close)))
|
||
at eval and compile times.
|
||
|
||
|
||
|
||
A graphics stream is a special object which these generic functions
|
||
can operate on. These objects keep an internal state, such as
|
||
the position of the last point plotted, and the values of the
|
||
scaling factors.
|
||
|
||
Loading GJC;GRAPHS FASL will make the the relevant functions
|
||
autoloading. Functions for hardware specific objects are in
|
||
different files.
|
||
|
||
See GRAPHZ DEMO for example usage.
|
||
|
||
(MAKE-ARDS-STREAM) returns an object which takes fixnum arguments
|
||
and outputs ARDs graphics codes to file or TTY objects which it
|
||
stores internaly. This is a primitive stream.
|
||
|
||
(MAKE-TEK-STREAM) is not yet implemented.
|
||
|
||
(MAKE-GRAPHICS-STREAM <OUTPUT-STREAM>) takes a primitive stream
|
||
as argument and returns a stream which can do floating point
|
||
scaling and clipping, and setting of windows and viewports.
|
||
|
||
(GRAPHICS-STREAM-OPEN <STREAM> <MODE> &OPTIONAL <ARG>)
|
||
<mode> is 'TTY or 'DSK. <arg> is the file name when opened
|
||
in 'DSK mode.
|
||
|
||
(GRAPHICS-STREAM-CLOSE <STREAM>) closes any DSK file.
|
||
|
||
(SET-PEN <GRAPHICS-STREAM> X Y)
|
||
|
||
(MOVE-PEN <GRAPHICS-STREAM> X Y)
|
||
draws a line from the last point the new point.
|
||
|
||
(VECTOR-PEN <GRAPHICS-STREAM> X Y) does a relative move of the pen.
|
||
|
||
(DRAW-POINT <GRAPHICS-STREAM> X Y) draws a line of length 0.
|
||
|
||
(GRAPHICS-STREAM-TYO <STREAM> <ARG>) presently does a character
|
||
TYO. Does not try and enforce clipping. #\CR may cause lossage.
|
||
Line-drawing of characters and scaling may be supported in the
|
||
future.
|
||
|
||
The following are not supported in primitive graphic streams.
|
||
|
||
(SET-WINDOW <GRAPHIC-STREAM> X0 X1 Y0 Y1)
|
||
the window is the apparent flonum size.
|
||
|
||
(SET-VIEWPORT <GRAPHIC-STREAM> X0 X1 Y0 Y1)
|
||
The viewport is set in "hardware" or rather, primitive stream
|
||
dependant, fixnums.
|
||
The default values for these are usually reasonable, by definition.
|
||
|
||
(MAKE-GRAPHICS-SFA <GRAPHICS-STREAM>) takes a graphics stream
|
||
and returns and SFA which may be used as an argument to
|
||
PRINT, FORMAT, etc.
|
||
|
||
(MAKE-TRACED-FUNCTOR <FUNCTOR>) takes a functor (a graphics stream is
|
||
a functor) and returns a functor which is traced. Trace information
|
||
is output to the value of TRACED-FUNCTOR-MSGFILE which should NOT be
|
||
a stream which calls any traced functors! The returned functor is
|
||
not equal to the argument, i.e. the argument is not side effected.
|