analysis of the raster-based 2d vector graphics system

12
Techr :ol nohe Analysis of the raster-based 2D vector graphics system F R BELCH An account is given of the features and theory of operation of the file traversal display. This substantially differs from earlier equipments, in being able to pan and scroll over a large coordinate system, e.g. 32k x 32k, able to hold an extensive dynamically updated diagram as a single segment. The entire diagram may be viewed at once at reduced resolution with the possibility of smooth fractional zoom, maintaining constant line width, with automatic detail addition as magnification increases. This results from the display's ability to traverse quickly a large host-loaded display file, applying 21:) transformations, clipping to a viewport, and drawing into double-buffered pixel memory at rates that allow new picture generation at up to frame rate. Keywords: display filetraversal,2D vector graphics systems, raster-based systems Raster-based 2D vector graphics systems, using display file traversal techniques combined with double-buffered pixel memories, are increasingly popular for such appli- cations as supply and distribution network monitoring (Figure 1) in the power, water and gas industries, air traffic control area surveillance (Figure 2), printed circuit track routing applications, VLSI chip design and other types of computer-aided design and manufacture. This article examines their principles of operation, illustrated with some description of the Ferranti VARS-H display system. Figure 1. VARS-H European utility network application Ferranti Computer Systems Ltd, Simonsway, Wythenshawe, Manchester M22 5LA, UK Figure 2. VARS-H air traffic control application OUTLINE OF OPERATION In typical applications, the screen of the display may be used with multiple viewports, as shown in Figure 3. The viewports may be overlapping or non- overlapping. There are a number of notable features. Pan, scroll and zoom are smooth, not stepped -- frac- tional zoom is possible. Irrespective of the zoom factor, all lines stay the same thickness -- pixel replication is not used. The diagram to be viewed may be large, drawn on a coordinate system of perhaps 32k x 32k compared with a screen resolution of 1280 x 1024. However, the whole diagram may still be viewed at once, at reduced DISPLAYS,APRIL1987 0141--9382/87/020087--11 $03.00 © 1987Butterworth &Co (Publishers)Ltd 87

Upload: fr-belch

Post on 21-Jun-2016

221 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Analysis of the raster-based 2D vector graphics system

Techr :ol nohe

Analysis of the raster-based 2D vector graphics sys tem

F R B E L C H

An account is given of the features and theory of operation of the file traversal display. This substantially differs from earlier equipments, in being able to pan and scroll over a large coordinate system, e.g. 32k x 32k, able to hold an extensive dynamically updated diagram as a single segment. The entire diagram may be v iewed at once at reduced resolution with the possibility of smooth fractional zoom, maintaining constant line width, with automatic detail addition as magnification increases. This results from the display's ability to traverse quickly a large host-loaded display file, applying 21:) transformations, clipping to a viewport, and drawing into double-buffered pixel memory at rates that allow new picture generation at up to frame rate.

Keywords: display file traversal, 2D vector graphics systems, raster-based systems

Raster-based 2D vector graphics systems, using display file traversal techniques combined with double-buffered pixel memories, are increasingly popular for such appli- cations as supply and distribution network monitoring (Figure 1) in the power, water and gas industries, air traffic control area surveillance (Figure 2), printed circuit track routing applications, VLSI chip design and other types of computer-aided design and manufacture. This article examines their principles of operation, illustrated with some description of the Ferranti VARS-H display system.

Figure 1. VARS-H European utility network application

Ferranti Computer Systems Ltd, Simonsway, Wythenshawe, Manchester M22 5LA, UK

Figure 2. VARS-H air traffic control application

OUTLINE O F O P E R A T I O N

In typical applications, the screen of the display may be used with multiple viewports, as shown in Figure 3. The viewports may be overlapping or non- overlapping. There are a number of notable features. Pan, scroll and zoom are smooth, not stepped - - frac- tional zoom is possible. Irrespective of the zoom factor, all lines stay the same thickness - - pixel replication is not used. The diagram to be viewed may be large, drawn on a coordinate system of perhaps 32k x 32k compared with a screen resolution of 1280 x 1024. However, the whole diagram may still be viewed at once, at reduced

DISPLAYS, APRIL 1987 0141--9382/87/020087--11 $03.00 © 1987 Butterworth & Co (Publishers) Ltd 87

Page 2: Analysis of the raster-based 2D vector graphics system

~ m

Page I

Page 2

Menu

I t e r n I

I tem 2 Item 3

Figure 3. Screen with multiple viewports

resolution as shown in Figure 4, with the ability to zoom in smoothly and rapidly as in Figure 5. Detail is automatically added or filtered out, depending on zoom factor.

Suppose it is desired to view a diagram within a view- port, e.g. part of a power, water or gas network, an air traffic control area or a printed circuit. The part to be viewed, the scale, orientation and level of detail need to be selected. These parameters are usually at least partly obtained by tactile feedback from a coordi- nate input device - - a tracker ball, say. It is possible to roam over a reduced-scale version of the diagram until the part of interest is reached and then apply zoom.

The system, continuously reading the input device, calcu- lates the relative positions of diagram and viewport, the required scale and orientation. How is the view through the viewport generated?

First, a description of the diagram exists largely in vector form in a system-resident display file; even characters and symbols are composed of short vector strokes. During roaming and zooming in, the display file is con- tinuously traversed at high repetition rate, /> 10 Hz. A new view is generated on each traversal and loaded into one of two identical pixel memories, which is then switched to support the screen. The other becomes avail- able to be cleared and receive the results of the next traversal. This gives the effect of smooth, continuous motion. Flicker is never present, because one pixel memory is always suporting the screen at its refresh rate, typically 60 Hz.

All vectors within the display file are subject on each traversal to three computational processes:

transformation --, clipping - , drawing

The first translates, scales and rotates component vectors according to the diagram's position relative to the view- port. The second rejects vectors which are not visible through the viewport, accepts those which are entirely visible and clips those which are only partly visible. The third draws each visible vector by calculating the address

N e t w o r k d i a g r a m

I I

0 ~ "-1 L . . . . .

I I

$

- , J ~ . - o t

* r " , L . . . . . . . . . . . . . . . . . , , - . . . . . ~ _ _ _ _ ~ :

I - " v O

I ~ ~

O . . _ ~ _ _ , , L _ _ _ _ . ~ _ ~ . . . . . . P S

• 3 2 k

/

. . J

CRT L ~1

\ ,, .,. i - 1280 - I

%. %

% % .%

. .~ j ¢

/ - ,s"

/ /

/

f J

/ , /

, / /

/

Figure 4. Diagram zoomed out

88 D I S P L A Y S , A P R I L 1987

Page 3: Analysis of the raster-based 2D vector graphics system

Technicol note

Network diagrom

__~ _~_~s S t

i

Js

~ ~ . . . .

I I I

o _ _ 4 _ _ , . L ' _ _ _ , _ . _ _

',

n I

I I II t

I ~---~--~ ,~--R--s--L~ , . . . . . . . . -~

s j

32k

CRT

I= ,28o

Figure 5. Diagram zoomed in

of every pix¢l along it and writing each pixel into the current memory. On top of this process, a host computer may also be dynamically updating the display file: in the case of a network, changing the states of switches or valves according to data received from plant scanning systems; in the case of an air traffic control area, changing the position and status of aircraft.

Figure 6 shows a VARS-H system block diagram. The supervisory processor, which supervises display file load- ing from the host into the internal memory and subse- quent traversal to generate views, is a Z8001 microprocessor. It also handles input from the local interactive devices, keyboard, tracker ball or tablet, and output to hard copy printing. The geometry processor,

Double buffered

Pixel memory

H o st i / f

Superv isory processor

Z8001

processor

Keyboard,

Disp lay f i l e

t racke r b o l l , data t a b l e t , hard copy, etc.

Figure 6. Block diagram of V,4RS-H system

G earn • t r y processor

7 7 P 2 0

processor

F l y - by mode

Drawing processor

26ARBOII ULA

Pixel memory

I

Pixe l memory

2

DISPLAYS, APRIL 1987 89

Page 4: Analysis of the raster-based 2D vector graphics system

which carries out most of the calculation on display file vectors, is a high-capacity arithmetic processor, the 77P20. The drawing processor, which subsequently draws the vectors into the pixel memory, is an uncom- mitted logic array circuit, the 26ARB011, designed speci- fically for this purpose. Typically, each of the two pixel memories may be up to eight planes deep, giving 256 possible on-screen colours, at a resolution of 1280 × 1024. For simplicity, the pixel memory scanning and video generation system is not shown.

An interesting point is that the pixel memories do not have to use video RAMs, because a memory is never called upon both to receive update information and to support the screen at the same time - - it is always one or the other. This reduces the cost and space taken by the RAM chips.

Transformation and clipping are performed by the geometry processor, drawing by the drawing processor. Each of these three processes is examined in detail below. Figure 7 shows a simple box and the following state- ments express symbolically the content of the display file describing it:

(Set colour etc.) Move to x0, y0; invisible move Draw to xl , y l ; vector Draw to x2, y2; vector Draw to x3, y3; vector Draw to x0, y0; vector

(Set new colour etc.)

Figure 8 shows the representation of the display file in memory with each statement typically occupying two 16 bit words of memory, one to hold each 15 bit coordi- nate value. At the head of the display file is a viewport definition giving its position and size on the screen, and also a transformation definition that is updated by the host as the operator uses the tracker ball and other interactive devices to roam over and zoom in on the

Y xl, yl x2,y2

xO, yO x3, y3

0,0

Figure 7. Drawing of box

X

Host update

Host or Iocol update from e.g. tracker ball

Viewport definition

Position and size

Transformation def in i t ion

Translation, scaling

and rotation

-6

.o

qt}

Set colour, etc.

Move to

xO

yO

Draw to

x l

y l

Host update > x2

y2

x3

y 3

x4

y 4

Set new colour, etc.

Figure 8. Display file detail

diagram. These provide information to the geometry processor at the start of each file traversal.

TRANSFORMATION

Translation and sc.~liTtg The process of roaming across the diagram effectively translates the diagram origin relative to the screen origin. As this occurs, the host updates transformation para-

90 DISPLAYS, APRIL 1987

Page 5: Analysis of the raster-based 2D vector graphics system

' hniml meters at the head of the display file, as Figure 8 shows. Translation, as Figure 9 shows, is a matter of translating each vector, which means adding a constant to each endpoint x and y coordinate:

x0' = x0 + Dx x l ' = xl + Dx x2' = x2 + Dx x3' = x3 + Dx

yO' = y o + Dy y l ' = y l + Dy y2' = y2 + D y y3' = y3 + D y

where Dx is the translation in the x direction and Dy that in the y direction. These quantities can be positive or negative.

Zooming-in effects scaling of the diagram. Scaling about the origin, as Figure 10 shows, is a matter of scaling each vector, which means multiplying each endpoint x and y coordinate by a constant:

x0' = x0*Sx y0' = y0*Sy x l ' = x l*Sx y l ' = y l*Sy x2' = x2*Sx y2' = y2*Sy x3' = x3*Sx y3' = y3*Sy

If the diagram is subject to translation and scaling simul- taneously, as in the present case, the separate calcu- lations on each vector can be combined. If translation is carried out first, followed by scaling, then the expression for a single endpoint is

x0' = (x0 + Dx)*Sx y0' = ty0 + Dy)*Sy

which expands to

x0' = x0*Sx + Dx*Sx y0' = y 0 * S y + Dy*Sy

Once we have decided on the translation and scaling factors, then Sx, Dx*Sx, Sy and Dy*Sy all become con- stants applicable to every vector in the diagram, needing

)"

A

V

Xl I, y l I x 2 ' , y 2 t

I I ,xo', ;,o' I

< D r >

y3"

0 , 0

Figure 9. Translation o f box

X

Y xl', yl ' x2' y 2 '

!

x l , y l I x 2 , y 2

Fk______2_ L o,.,o ' J

xO,yO x 3 , y3

A

y 3 t: Sy "~ y3

< x3" = Sx~x3 > V

0 , 0

Figure 10. Scaling o f box

X

to be calculated only once before file traversal. Usually the x and y scaling factors Sx and Sy will be the same. If G, H, I and J are the constants respectively, then

x0' = x 0 * G + H x l ' = x l * G + H x2' = x2*G + H x3' = x3*G + H

yO' = y O * I + J y l ' = y l * I + J y2' = y 2 * I + J y3' = y 3 * l + J

(1)

Rotation Rotation of an entire diagram is unusual, since diagrams are usually viewed with constant orientation, but part of a diagram representing a single component might be rotated relative to the rest. Figure 11 shows rotation of the box about the origin. The expression for rotation is fairly complex. For a rotation theta, the individual vector endpoints are transformed using the expressions

xO' = xO*cos(theta) - yO*sin(theta) x l ' = xl*cos( theta) - y l*sin( theta) x2' = x2*cos(theta) - x2*sin(theta) x3' = x3*cos(theta) - x3*sin(theta)

yO' = xO*sin(theta) + yO*cos(theta) y l ' = xl*sin( theta) + y l*cos(theta) y2' = x2*sin(theta) + y2*cos(theta) y3' = x3*sin(theta) + y3*cos(theta)

Again, if it is desired to rotate a complete component, then cos(theta) and sin(theta) need be calculated only once for that component to derive two constants J and K, say. For the box:

xO' = xO*J - yO*K x l ' = x l * J - y l * K x2' = x2*J - y 2 * K x3' = x3*J - y 3 * K

yO' = xO*J + yO*K y l ' = x l * J + y l * K y2' = x 2 * J + y 2 * K y3' = x 3 * J +. y 3 * K

(2)

DISPLAYS, APRIL 1987 91

Page 6: Analysis of the raster-based 2D vector graphics system

x21,y2 t

/ / ~ xa',y3'

thet~o~/ / 6

0,0

x2,y2

] x3, y3

X

Figure 11. Rotation of box

Just as translation and scaling can be combined into a single calculation rather than performed separately, rotation can if necessary be combined with translation and scaling in a similar way.

To summarize, during transformation the geometry pro- cessor processes vector endpoint coordinates using expressions similar to equations (1) and (2). This work is arithmetic-intensive - - no logical operations are needed. The 77P20 is effective as a geometry processor because it is able to add, subtract or multiply 16 bit numbers in a single 250 ns cycle, so the transformation of a vector takes only a few microseconds.

CLIPPING

General p r i n c i p l e s

After transformation, the geometry processor needs to determine which vectors are actually visible through the viewport. Figure 12 shows a possible situation for the transformed box. A number of different cases need con- sideration: some vectors are entirely inside the viewport and can just be drawn; other vectors are entirely outside and can be rejected; a third class is only partly inside and must be clipped so that only the visible portion is drawn.

In the example, the vector (x0', y0') to (xl ' , y l ' ) is entirely inside, since both its endpoints are. It can easily be determined that an endpoint is inside if its x coordi- nate lies within the left- and right-hand x bounds, XL and XR, of the viewport and its y coordinate lies within the bottom and top y bounds, Yr and YB. Mathemati- cally, if for both ends:

XL ~ < x < X R a n d a l s o Y B ~<y < YT

then the vector can simply be drawn. If only one end of the vector satisfies this condition, then it must be only partly inside, as exemplified by (xl ' , yl') to (x2', y2') and (x3', y3') to (x0', y0'). With these, only the

XL,YT

xl ~, yl

x2~y2" I % ~ 3: y3"

/

xO,yO

XL,YB XR, YB

Figure 12. Clipping of box: example 1

visible portion must be drawn. How this is done is discussed below.

Determining that a vector lies entirely outside the view- port is more difficult than determining that it lies entirely inside. The vector (x2', y2') to (x3', y3') lies outside, because both its endpoint y coordinates y2' and y3" lie above the top of the viewport and so the vector itself must be above the top. Three other similar situations exist for vectors that lie entirely below, entirely to the left or entirely to the right of the viewport. Mathe- matically, if for both endpoints:

x < X L or x > ~ X R or y < YB or y~> YT

then the vector can be rejected.

The most difficult situation exists if neither endpoint lies inside the viewport, that is, the first set of conditions is not true for either endpoint, but also the vector cannot be rejected, because it does not satisfy the second set of conditions either. Figures 13 and 14 show two possi- bilities for the vector (x2", y2') to (x3', y3'). In both cases the vector cannot be initially rejected, because its endpoint x coordinates lie on either side of XR, and also its y coordinates lie on either side of Yr. In the first case, however, the vector does not need to be drawn at all, because it misses the top fight-hand corner of the viewport, but in the second case some of it does need to be drawn, because it intersects that corner.

Midpoint s u b d i v i s i o n

Fortunately, there is a common solution to this and the earlier clipping problem. A uniform treatment is possible for all vectors that are not entirely in view with both endpoints inside the viewport and cannot be rejected with endpoints above, below, left of or right

92 DISPLAYS, APRIL 1987

Page 7: Analysis of the raster-based 2D vector graphics system

Techntcol note

X L , YT

x21, y2"

xl, yl ~ x 3 ' ,

xO ; .vO "

y 3 "

X L , YB XR , YB

Figure 13. Clipping of box: example 2

XL , YT x2~y2 '

Xl / 'y l /

xO t, yO'

X L , Y B X R , YB

/ / ~ 3 , y 3

Figure 14. Clipping of box: example 3

of the viewport. These vectors are divided into two as nearly as possible equal parts, which are treated as separ- ate end-to-end vectors. Each vector is then tested against the previous criteria, which may result in the vector being drawn or rejected or remaining ambiguous. If the vector remains ambiguous, then it is divided again. Figure 15 shows the process. With vectors A, B and D it is possible to dispose of one half, or in the case of D both halves, of the vector; that is, it is either drawn or rejected. In the case of C, however, both halves of the vector must be temporarily retained until each half has been further subdivided.

Dividing a vector into equal parts needs only simple arithmetic. If the two endpoint x coordinates are added and divided by 2, the midpoint x coordinate can be obtained, and similarly for the y coordinate. Dividing by 2 can be done with a simple shift right. A big advan- tage of this method is that it does not involve calculating a vector's slope and then its points of intersection with viewport edges. This would need a division function, which the 77P20 in common with similar devices does not possess and which is hard to provide at high speed. This is because although multiplication matrices based on the second-order Booth's algorithm exist which enable two numbers to be multiplied together in a single clock cycle, a corresponding mechanism does not exist

D c/jB/A Figure 15. Clipping with midpoint subdivision

for division. Hardware must therefore use either shift and add techniques or the Newton-Raphson iterative method, both of which are much slower.

DRAWING

After transformation and clipping, correctly scaled visible vectors are available, expressed in screen coordi- nates. When a vector is drawn, points along the vector are represented by pixels whose colour code must be set into the pixel memory. The coordinates of these pixels must be determined, and from these their memory addresses. This is termed scan conversion and is carried out by the drawing processor.

Scan conversion

Suppose there is a vector drawn at ~< 45* slope. Dx and Dy are given for the vector as integers, with Dy ~< Dx. A convention used is that all coordinates lie on the centres of pixels. Figure 16 shows the vector represented on a pixel matrix (shown solid) with coordi- nate lines (shown dotted). The endpoints of the vector lie on pixel centres. The scan conversion algorithm is based on choosing for each integer x value a pixel that the vector goes through most. Often, as can be seen at P and Q, there is a choice of two pixels, since the

I [ I I I I I J i

- - . . . . . . . . . . . . . . . . I-1 . . . . , , ! 1 1 " 1 I I I I I / ' 1 I I I I , . . i I I I[ I l ~ " I I I [ I I J " I I I i I t ~ " I I I I I t, iP ~/ I I I! I , I ~ I I l', i i ~/ I I Ii I

L~ I I 11 I --AL - - - - . : . . . . . . . . . . . . . . . . 4 - 4 4 ~ -4 4 -

', I I I'. I

r. A X ~1

Figure 16. Scan conversion

D I S P L A Y S , A P R I L 1 9 8 7 9 3

Page 8: Analysis of the raster-based 2D vector graphics system

vector goes through both. It has to be decided which pixel of the two contains more of the vector.

Figure 17 shows in detail how this can be done. A point on the vector is observed that is vertically in line with the pixel's centre. If this point is below the horizontal pixel boundary, then more of the vector lies in the lower pixel. I f it is above, then more lies in the upper pixel. If it lies on the boundary, then the vector is equally divided between both pixels, and a decision must be made one way or the other. Suppose the lower is always chosen.

On moving one unit to the right, the pixel x coordinate is incremented by 1. If the vector has not moved above the horizontal boundary, a pixel is chosen with the same y coordinate as the previous pixel. Otherwise a pixel is chosen with y incremented by 1. Since the vector is ~< 45 °, it is impossible to move vertically more than one pixel for each unit moved horizontally. Starting at point A (Figure 16) and moving one pixel at a time to the right, each time along the vector there is a move Dy/Dx units vertically, where Dy/Dx ~< 1. The first pixel boundary is 0.5 units above A, the next 1.5 units, the next 2.5 units and so on. It is necessary to detect when these boundaries are successively passed, because this is when the pixel y coordinate is incremented.

It would be possible to have an accumulator to which to keep adding Dy/Dx. However, testing whether Dy/Dx > 0.5 is the same as testing whether (Dy/Dx - 0.5) > 0 or, if both sides are multiplied by 2*Dx it is the same as testing whether (2*Dy - Dx) > 0. This is the test at the first pixel position to the right of A. If this test fails, it means that only x is incremented and another Dy/Dx is added. With the transformed expression, multiplied through by 2*Dx, 2*Dy must be added instead. If the test succeeds, y is incremented as well as x and the accumulation is tested against the next boundary of 1.5 units. In the transformed expression this is the same as subtracting 2*Dx from the left-hand side. But 2*Dy must also be added (equiva- lent to adding Dy/Dx) for the next test. The result is that if the test succeeds, then 2*Dy - 2*Dx is added.

The number of times this cycle is repeated is equal to

Figure 17. Choice of pixel. Line through (a) lower pixel only, (b) upper pixel only, (c) both but mostly lower, (d) both but mostly upper, (e) both equally divided

Dx, which can be decremented in a counter to indicate when to stop.

General-case vectors

The above algorithm works only in the positive x and y quadrant (for vectors of ~< 45 ° slope). The other quadrants can be handled by modifying the algorithm to work with modulus or absolute values of Dx and Dy. In this case x and y must be incremented or decre- mented according to the sign of Dx and Dy respectively. To handle > 45* slope, this case is first detected by deter- mining whether Dy > Dx and if so, the same algorithm is used with the x and y axes interchanged.

Implementation in 26A.P,.B011

The scan conversion algorithm described is implemented as a VSLI circuit in an uncommitted logic array (ULA), the Ferranti 26ARB011. Figure 18 is a simplified block diagram of the circuit.

Two latches receive IDxl and IDyl from the geometry processor. Note the use of sign and modulus rather than 2s complement values. The signs of each quantity are latched separately. A comparator compares the values and produces a signal that causes them to be exchanged if necessary in the following two multiplexers.

The signal coming from the left-hand multiplexer is now called the dependent variable Dd (the smaller of Dx and Dy), which by means of a wired shift left can easily be made into 2*Dd. The output from the right-hand multiplexer is now called the independent variable Di (the larger of Dx and Dy). This is complemented to give Di bar, which is the same as - Di - 1.

The following multiplexer allows an optional wired shift left (multiplying by 2 again) to be introduced. In this mode, the least significant bit of the multiplexer is also wired to 1. The multiplexer output may also be selected to be 0. The output of the multiplexer is therefore - Di - 1, - 2 * D i - 1, or 0. The negates of Di or 2*Di still have not quite been formed.

The following adder adds 2*Dd to one of these three selectable quantities. The least significant carry-in stage of the adder is automatically selected to 1 if the output from the right-hand multiplexer is not selected to 0. The output from the adder is therefore 2*Dd - Di, 2*Dd - 2*Di, or 2*Dd.

The remainder of the circuit is straightforward. The accumulator is initially cleared. Then via the second adder it is loaded with the starting constant 2*Dd - Di (accumulator := 0 + constant). Subsequently, on each following cycle, depending on accumulator sign negative or positive, either the constant 2*Dd - 2*Di

94 DISPLAYS, APRIL 1987

Page 9: Analysis of the raster-based 2D vector graphics system

Technical note

Dy latch

From geometry processor +

i comparator

EX

Ox latch

multiplexer <EX Dx or Dy

multiplexer

- D i - I I < E x

Wired left shif t gives - 2 ~ D t ' - I

Constant generating multiplexer

< Select /c lear

2 x Dd

Constant generating

adder

J -Di-I or

- 2 ~ D i - I or 0

<Carry in

Dd- Di 2

~ or 2 ~ D d - 2 ~ D i

or

Cycle J 2"Dd adder

Constant + occum.

o r - < J Accumulator J <Clear sign

-D i - I

I ~°~' nu°-~ c'c'- I

Finish cycling

Y counter

1,l Address

composition

,l I

Dx, Dy and accum. sign and EX value

Count control J

Up or down / /

or not at oil

ii ~co.°-r

1 J J 4-16 bit

decode i

1 Data /address MX J

I

1 To pixel memory

Figure 18. Scan conversion with 26,4RB011

DISPLAYS, APRIL 1987 95

Page 10: Analysis of the raster-based 2D vector graphics system

or the constant 2*Dd is added, respectively. The number of cycles is determined by the counter on the right, initially loaded with - Di - 1 ( - D x - 1 i f D y < Dx, otherwise - D y - 1) and counted up. (The absence of a true negated value is compensated for in the count- complete condition).

On each cycle, depending on accumulator sign negative or positive, either only the coordinate corresponding to the independent variable is counted, or the coordinates corresponding to both the independent and dependent variables, respectively. Which of Dx or Dy is the inde- pendent or dependent variable is given by the EX output of the comparator. The direction of count of each co- ordinate is given by the signs of Dx and Dy. The count control logic associated with the x and y coordinate counters takes appropriate action based on the values of these quantities. The initial values of the counters is determined either by a preceding invisible move instruction to the 26ARB011 or preceding vector drawing.

A final stage following the x and y counters forms the pixel memory word address and defines the bit affected within that word, basically by concatenating the most significant bits of x with the y value and decoding the least significant four bits of x. This is for a pixel memory which is organized into 16 bit wide words, with 64 or 128 words across a screen line.

Other 26ARB011 functions

The above are by no means the only functions provided by the 26ARB011. Dashed lines may be defined, pixel memory aspect ratio may be varied, and a viewport preset function is available that can set all pixels within a rectangular area to a specified colour.

MULTIPLE V I E W P O R T S

To support multiple viewports, file traversal is repeated for each in turn. Not all of the file need be traversed for a given viewport - - only that part which supplies information for it. Viewports are processed in order of visibility, those underneath being written first, those on top last. Before each is written, the viewport preset function is called in the 26ARB011. This erases unrequired parts of the viewport underneath.

F l y - b y m o d e

Figure 6 shows a path bypassing the geometry processor, enabling vectors to be routed directly from display file to drawing processor. The vectors are drawn more quickly, but without transformation or clipping. The main use is for fast drawing of short-stroke characters, not needing to be transformed or clipped, as may be required for host-system dialogue, say.

Move by

dxO

d¥O

. . . . . . . . . . . . . . . . . . . . .

d x t . . . . . . . . . . . . . . . . . . . . .

d y l . . . . . . . . . . . . . . . . . . . . .

dx5 . . . . . . . . . . . . . . . . . . . . . . .

dy3

dx4

dy4

Return . . . . . . . . . . . . . . . . . . . . . . .

dump i f zoom < N

Address

Move to

x0

¥0

Cull subroutine

Address

Move to

Xl

y l

Call subroutine

Address

Move to . . . . . . . . . . . . . . . . . . . . . .

x2

y2 . . . . . . . . . . . . . . . . . . . . . .

:~ 9[

.¢¢...-

Figure 19. Conditional jumps and subroutine calls

96 DISPLAYS, APRIL 1987

Page 11: Analysis of the raster-based 2D vector graphics system

Technicol note

CONCLUSION

The above gives a simplified view of display file traversal. Display files may contain conditional and unconditional jump and subroutine call instructions able to change the path of code execution. Figure 19 shows that condi- tional jumps testing the current zoom factor can cause filtering or inclusion of detail, while subroutine calls allow parts of a diagram that are the same (instances) to use common coding.

Display files are optionally dividable into segments sub- ject to individual segment or modelling transformations before being combined and viewed using a viewing trans- formation. The system allows transformations expressed as matrices to be mutiplied together to compose com- bined transformations. The international standard graphics protocol GKS 7.2 Level 2c may be used with the system to facilitate these types of operation, but this lies rather outside the scope of the present discussion.

To give some idea of processing rates: VARS-H draws untransformed and unclipped vectors at up to 300k

vectors/second, and transformed and clipped vectors at up to 40k vectors/second. Vectors may be drawn on a coordinate system of 32k x 32k. Screen resolution is program selectable up to 1280 x 1024 at a refresh rate of 60 Hz non-interlaced, or up to 1536 × 1024 interlaced. Pixel write rate is 270 ns per pixel in any direction, all planes being written simultaneously.

FURTHER NEADING

Transformations and the use of matrices are discussed fully in Principles of Interactive Computer Graphics, by Newman and Sproul (McGraw-Hill, 1979) and also in Fundamentals of Interactive Computer Graphics, by Foley and Van Dam (Addison-Wesley, 1982).

Fundamental work on clipping, including the develop- ment of the midpoint subdivision algorithm, is due to Evans and Sutherland. Details of the clipping algorithms described are given in the sources mentioned, which also deal with the derivation and use of the scan conversion algorithm, which is due to Bresenham.

DISPLAYS, APRIL 1987 97

Page 12: Analysis of the raster-based 2D vector graphics system

the international journal on theoretical developments in computer, systems science and their applications in computer systems eng,neermg

Coverage includes fault-tolerant computer systems, local-area network engineering, parallel- processing systems, theoretical analysis of computer systems, distributed systems, design of large software systems, systems performance evaluation, real-time systems, special-purpose systems, and specification and design issues for multiple cooperating processor systems.

Computer Systems Science and Engineering is essential reading for researchers, developers, vendors and users of computer systems. For further information and sample copy, please contact: Geraldine Hills, Butterworth Scientific Limited, PO Box 63, Westbury House, Bury Street, Guildford, Surrey GU2 5BH, UK. Telephone: 0483 31261; Telex 859556 SCITEC G. Prospective authors can obtain copies of the guidelines for authors from the Executive Editor at the above address.

An important notice to all subscribers

As from the 1st March 1987 the fulfilment of all Butterworth Scientific subscriptions will be moved to our newly formed subsidiary, Westbury Subscription Services. From this date all orders, claims or queries from the UK and the rest of the world (excluding North America) should be sent to:

Westbury Subscription Services P.O. Box 101 Sevenoaks Kent TN15 8PL UK

Telephone: 0732 885833 Telex: 95678 Facsimile: 0732 884079

and for North America (USA andCanada) all orders, cheques and queries should be sent to:

Journals Fulfilment Department Butterworths 80 Montvale Avenue Stoneham, MA 02180, USA

Telephone: (617) 438 8464 Telex: 880052

Please do not send any correspondence relating to 8utterworth Scientific Ltd journals to Quadrant Subscription Services after March 1st, 1987.

Any queries concerning the above should be sent to Mrs Sheila King, Butterworth Scientific Ltd, P.O. Box 63, Westbury House, Bury Street, Guildford, Surrey GU2 5BH, UK. Telephone Guildford (0483) 31261.

98 DISPLAYS, APRIL 1987