GB2226480A - Method and apparatus for determining line positions for display and manipulation by a computer system - Google Patents

Method and apparatus for determining line positions for display and manipulation by a computer system Download PDF

Info

Publication number
GB2226480A
GB2226480A GB8921264A GB8921264A GB2226480A GB 2226480 A GB2226480 A GB 2226480A GB 8921264 A GB8921264 A GB 8921264A GB 8921264 A GB8921264 A GB 8921264A GB 2226480 A GB2226480 A GB 2226480A
Authority
GB
United Kingdom
Prior art keywords
line segment
value
vertices
change
line
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
GB8921264A
Other versions
GB2226480B (en
GB8921264D0 (en
Inventor
Chris Malachowsky
Curtis Priem
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sun Microsystems Inc
Original Assignee
Sun Microsystems Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sun Microsystems Inc filed Critical Sun Microsystems Inc
Publication of GB8921264D0 publication Critical patent/GB8921264D0/en
Publication of GB2226480A publication Critical patent/GB2226480A/en
Application granted granted Critical
Publication of GB2226480B publication Critical patent/GB2226480B/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G5/00Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators
    • G09G5/36Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators characterised by the display of a graphic pattern, e.g. using an all-points-addressable [APA] memory
    • G09G5/39Control of the bit-mapped memory
    • G09G5/393Arrangements for updating the contents of the bit-mapped memory

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Controls And Circuits For Display Device (AREA)
  • Image Generation (AREA)

Abstract

A circuit (30) for determining the X values of each end of a series of horizontal scan lines connecting a pair of line segments (A and B) each of which is defined by a pair of vertices (XYA, XYTA and XYB, XYTB) the horizontal scan lines defining an area to be rendered on a computer output device, comprising first and second circuit portions (32, 34), each of said circuit portions including apparatus (40-56) to determine the slope of a line segment, apparatus depending on the slope for determining the beginning and ending X values for each line segment for each scan line in the area to be rendered, apparatus for causing the two circuit portions to begin operation at the same scan line, and apparatus (64) for changing the Y value for each circuit portion to the Y value of the next adjacent scan line at the same time. <IMAGE>

Description

MEIHOD AND APPARATUS FOR DETERMINING LINE POSITIONS FOR DISPLAY AND #t4NIPU1ATION BY A COMPUTER ';YSB BACKGROUND OF THE INVENTION 1. Field of the Invention: This invention relates to computer systems and, more particularly, to circuitry for determining the position of individual points of a scan line which is to be displayed on the output display of a computer system.
2. History of the Pnor Art: A major problem in utilizing computers to provide graphic displays is that for a single frame of graphical material to be presented on a cathode ray tube (CRT), it is usually necessary to store an indication of the information which is to be displayed for each position (pixel) of the cathode ray tube.
With large and detailed displays, the number of pixels on the cathode ray tube may be approximately one thousand or greater in a horizontal direction and a like number in the vertical direction giving a total of approximately one million or more pixels about which information is to be stored. In a preferred system which is capable of providing a number of different colors on the cathode ray tube, each of these pixels contains eight bits of digital information specifying the particular color output. Consequently, approximately eight million bits of information needs to be stored for each frame to be presented at the output.
Not only does color information have to be provided for each pixel for each frame of the display, but in generating graphic displays, the usual method of determining the shapes of figures requires that various algorithms be applied to the data to shape those figures. If this information is handled by the software of the system, computing the positions of each point to be displayed and determining the data to be displayed at that point slows the opeTarìDfl of tne system to a point where functions such as animation are essentially irnpossibte. For example, in order to present a polygon on the o . display, it is necessary to determine each end on each horizontal line which makes up the polygon because the information is furnished to the display by scan lines. In prior art systems, this determination of the ends of each line to be scanned to the output display required the use of software run by the central processing unit (CPU) to evaluate the end values for each scan line of each graphical shape to be presented. Such arrangements increase the time taken to present the graphics to a point were appreciable slowing of the display occurs.
For this reason, various systems utilizing hardware to speed the operation have been suggested. One method for speeding the operation uses two output frame butters and loads one buffer while the other is being scanned to the display. Such a system significantly speeds the operation but requires essentially twice as much memory to accomplish the storage.
It is, therefore, an object of the present invention to speed the operation of computer systems.
It is another object of the present invention to provide circuitry for handling in hardware the manipulations of graphical material which have in the usual case been handled by the software of the computer system.
It is an additional object of the present invention to provide circuitry for determining the X and Y coordinates of the ends of lines to be scanned to the output display.
SUMMARY OF THE INVENTION These and other objects of the present invention are realized in a new output display system which utilizes a unique philosophy of graphic figure presentation whereby high speed graphics may be provided using only a single output display buffer.
In order to allow the use of hardware to implement the presentation of graphics, it has been found that the information presented to the hardware will be processed more rapidly if it is of essentially the same nature no matter what the shape is which is to be drawn on the display. The system is based on a definition of a graphical figure (shape) which considers the shape to be composed of a number of subportions each of which are quadrilaterals. Circuitry is provided for rapidly displaying quadrilateral images by handling only information regarding the four vertices of those quadrilaterals. All of these quadrilaterals may be handled in the same manner by the graphics presentation hardware and recombined on the display to present the desired shape.
The system breaks the quadrilaterals into subportions made up of pairs of line segments which subtend a trapezoidal area of scan lines to be presented on the output display. The X and Y coordinates of the two ends of each scan line in each trapezoid are then determined. This invention relates to circuitry which determines at the same time both ends of each scan line contained within a quadrilateral figure to be displayed at the output.
The system and the circuitry of this invention are devised to select the optimum manner of decomposing a shape so that the operation proceeds at iS most rapid. For. example, if a shape to be decomposed lies oonly pai#att# within a clip wt#dow and either partially above or below the clip window, the operation #;.il proceed more rapidly if the portion outside the Clb# wt#d#w need not be processed. This may be accorriplished if the decomposition may proceed from either the top down or the bottom up.
Furthermore, random access memory used in computer systems is usually divided into groups referred to as pages; and accessing memory within a page takes less time than going from a first address in one page to a second address in another page (crossing a page boundary). If the operation proceeds from the bottom up, fewer page boundaries in memory need to be crossed if the processing of a given scan line proceeds from right to left rather than from left to right as in the normal case. The crossing of fewer page boundaries also allows more rapid operation.
The decomposition and scan line processing provided by the system and by the operation of this invention take place either from left to right or right to left and from the top down or from the bottom up. The circuitry is also able to determine the start and stop points of each scan line even though the figure is comprised of line segments which cross one another. The ability of the circuitry of this invention to provide such rectilinear coordinates allows the rapid transfers of graphic information to an output display.
These and other objects and features of the invention will become apparent to those skilled in the art by reference to the following detailed description taken together with the several figures of the drawing in which like elements have been referred to by like designations throughout the several views.
BRIEF DESCRIPTION OF THE DRAWINGS Figure 1 is a representation of a graphical shape divided into two quadrilaterals which when individually displayed on a computer output device provide the complete original shape; Figure 2(a)-(d) is an illustration of a single quadrilateral shape decomposed into line segments; Figure 3 is a block diagram illustrating a graphical output system for a computer constructed in accordance with the invention; Figure 4 is an illustration of the operation of one portion of the circuitry of the invention; and Figure 5 is a circuit diagram illustrating one method of implementing the invention.
NOTATION AND NOMENCLATURE Some portions of the detailed descriptions which follow are presented in terms of algorithms and symbolic representations of operations on data bits within a computer memory. These algorithmic descriptions and representations are the means used by those skilled in the data processing arts to most effectively convey the substance of their work to others skilled in the art.
An algorithm is here, and generally, conceived to be a selfconsistent sequence of steps leading to a desired result. The steps are those requiring physical manipulations of physical quantities. Usually, though not necessarily, these quantities take the form of electrical or magnetic signals capable of being stored, transferred, combined, compared, and otherwise manipulated. It has proven convenient at times, principally for reasons of common usage, to refer to these signals as bits, values, elements, symbols, characters, terms, numbers, or the like. It should be borne in mind, however, that all of these and similar terms are to be associated with the appropriate physical quantities and are merely convenient labels applied to these quantities.
Further, the manipulations performed are often referred to in terms, such as adding or comparing, which are commonly associated with mental operations performed by a human operator. No such capability of a human operator is necessary or desirable in most cases in any of the operations described herein which form part of the present invention; the operations are machine operations. Useful machines for performing the operations of the present invention include general purpose digital computers or other similar devices. In all cases the distinction between the method operations in operating a computer and the method of computation itself should be borne in mind. The present invention relates to method steps for operating a computer in processing electrical or other (e.g. mechanical, chemical) physical signals to generate other desired physical signals.
The present invention also relates to apparatus for performing these operations. This apparatus may be specially constructed for the required purposes or it may comprise a general purpose computer as selectively activated or reconfigured by a computer program stored in the computer.
The algorithms presented herein are not inherently related to any particular computer or other apparatus. In particular, various general purpose machines may be used with programs written in accordance with the teachings herein, or it may prove more convenient to construct more specialized apparatus to perform the required method steps. The required structure for a variety of these machines will appear from the description given below.
DESCRIPTION OF THE PREFERRED EMBODIMENT In designing computer systems, it has become apparent that the display of graphic images substantially slows the operation of most machines. This occurs because the amount of information that the computer must deal with for each frame to be presented on the output display is very large and because the manipulation of that information in order to present the graphics image requires inordinate use of the central processing unit (CPU).
This is especially true in a system which utilizes an interface including multiple "windows" for its output display. In such a system, more than one program at a time is placed in portions of memory which are available for instant call. The text and graphics output of each such program is made to appear on the output display in a particular set of defined boundaries called a window or a clip window. Each window may overlap other windows with the "front window" constituting the current work file. Usually, the computer operator manipulates the program in only one window at a time but may switch rapidly to a program in another window to work with that program. In general, windows require substantially more memory and time to manipulate than do non-window operations.
The system of which this invention is a part speeds the display of computer graphics by handling most of the operations in hardware so that the information is available instantaneously. In order to allow the use of hardware to implement the presentation of graphics, the system breaks the graphics images to be presented on the display into quadrilaterals all of which may be handled in the same manner by the hardware. The system takes these quadrilaterals and further breaks them into line segments which subtend the same scan lines to be presented on the output display, the scan lines forming, in effect, a trapezoid. The X and Y coordinates of the two ends of each scan line are then determined by the circuitry of this invention.
The system takes those rectilinear coordinates and translates them into serial scan lines which may be stored in a frame buffer and displayed on an output display.
Figure 1 is a representation of a graphical shape divided into two quadrilaterals 8 and 9 which when individually displayed on a computer output device provide the complete original shape. Although the shape shown in Figure 1 is simple, it will be apparent to those skilled in the art that shapes of essentially infinite complication may be represented if a sufficiently large number of small individual quadrilaterals are chosen. In fact, the system of the present invention has been utilized to represent three dimensional animated shapes of a very complicated nature.
Figure 3 illustrates in block diagram form a graphical output system 10 constructed in accordance with the invention which may be used with a general purpose computer system. The system 10 includes bus interface logic 12 which receives information regarding the desired graphical shape from the central processing unit of the computer system (not shown in the figures). The bus interface logic 12 receives information on an address line which designates the particular portion of the system 10 to which the input is to be transferred. The bus interface logic 12 receives the actual data such as the color description on an input data line. The bus interface logic 12 also receives a control signal designating the manner in which the information is to be treated on a control line.
When constructing graphical representations from quadrilaterals in accordance with the present invention, the input information includes the coordinates of the rectangular area which defines the particular window in which the displayed information is to appear, the coordinates (vertices) of the quadrilateral, and the color data regarding each quadrilateral. The color data which is to be presented at the display of the quadrilateral is stored Bn adata path and memory interface stage 22. The vertices of the q#a##ia?#rai and the clip window information are stored in coordinate & ng circui#ry 14 which includes hardware that provides comparisons of the incoming information by means well known to the prior art such as registers and gating circuits.
The comparisons made include the comparison of each X value of each vertex to the X value of each of the other vertices, the comparison of each Y value of each vertex to the Y value of each of the other vertices, and the comparison of each of the X and Y values of the vertices to X and Y values of the edges of the clip window in which the information is the be presented. Since this is accomplished by hardware, the information is immediately available for use by the system 10 without loss of any system clock time.
The information regarding the vertices of the quadrilateral and the clip window available at the coordinate staging circuitry 14 is presented to a coordinate sequencing stage 16 at which the quadrilateral is decomposed into a series of subportions each of which comprises two line segments of the original quadrilateral. Each of these subportions is chosen such that the line segments define an area of the quadrilateral which may be drawn by a series of parallel horizontal scan lines, each having an X beginning value lying on one of the line segments and an X ending value lying on the other.
In essence, the two line segments define a trapezoid including as many Y (horizontal) scan lines as is possible in view of the shape of the quadrilateral. When all of the scan lines of all of the subportions are rendered on the display, the quadrilateral is defined in total.
Figure 2(a)-(d) illustrates a single quadrilateral divided into subportions in accordance with this invention. The quadrilateral which is decomposed is shown in Figure 2(a), and the subportions thereof are illustrated in Figures 2(b)-(d). As may be seen in Figure 2, each subportion includes, when presented on an output display, a series of horizontal scan lines which begin at one line segment defining the quadrilateral and end at another line segment. The scan lines for each subportion of the quadrilateral represent a trapezoidal portion of the original quadrilateral.
When these horizontal lines of all of the trapezoidal subportions are scanned to the frame buffer for presentation on the output display, the entire quadrilateral shape is reconstituted on the display.
Referring again to Figure 3, after the quadrilaterals have been decomposed into subportions, the individual Y scan lines have their beginning and ending X values determined at a functional addressing stage 18. In the preferred embodiment of the invention, this is accomplished by the use of circuitry which determines the particular pixels constituting the X values at the beginning and end of each scan line within the decomposed subportions of the quadrilateral. This functional addressing stage 18 also accomplishes a portion of the clipping necessary to fit the particular quadrilaterals to the clip windows, and then transfers the signals to a mask generation stage 20 which arranges the information into sixteen pixel portions that designate the beginning and end of each scan line and are used for addressing the data path and memory interface stage 22.
The mask generation signals are also furnished to a linear address generator 24 which translates the rectilinear addresses provided by the mask generation stage 20 into signals for linearly addressing the frame buffer for the output display. At this point, the color dala relating to the quadrilateral to be displayed which has been held in memory at the stage 22 is transferred to the output display (frame) buffer.
The invention considered by this specification relates to the apparatus and method for determining the ends of each horizontal line in each trapezoidal subportion of the quadrilateral which is ultimately to be provided to the output display as a scan line. Although this invention is described in terms of the graphics system illustrated in Figure 3, it will be realized by those skilled in the art that it will have broad application in other systems for providing graphical output displays for computer systems.
The circuitry of this invention receives from the circuitry which decomposes each quadrilateral into subportions input signals representing the pairs of line segments which subtend a series of common horizontal lines which are to be displayed at the output display of the computer system with which the graphics system is associated. These signals are furnished to the circuitry as the rectilinear coordinates of the vertices of the line segments subtending the particular trapezoidal area having common Y values.
Since the line position information furnished to the circuitry of this invention includes only the vertices of the line segments defining the particular subportions of the quadrilateral while the output display handles information on a scan line basis, it is necessary to determine the end points of each of the horizontal Y scan lines subtended by the line segments so that the scan lines may be presented on the output display to complete the quadrilateral of interest.
When drawing a straight line on an output display such as a cathode ray tube, the line is defined by a series of pixels on adjacent scan lines. If the line to be drawn is horizontal, then a single scan line on the display is sufficient to draw the line if the address of the starting and ending pixels are furnished. If the line is vertical, then a single pixel from each of a number of adjacent scan lines must be written to the display. Lines between horizontal and vertical vary in the number of pixels per scan line depending on the slope of the line. If the line has a small slope, then a number of adjacent pixels are drawn on each of a number of adjacent scan lines, continuing until the line is completed. If the beginning and ending X values of each series of adjacent pixels on each scan line are known, then the intervening pixels may be filled on the display and the line completed.
It is necessary to know the position on each scan line of each of the line segments which define the sides of the trapezoids to be scanned to the display in order to draw those trapezoids. This is true in order to begin and end each scan line and to clip the scan lines to fit a clip window. If clipping occurs across a line segment, a method must be devised for determining the portion of each line segment which is to be drawn. The philosophy of the circuitry of this Inven#on is to determine those beginning and end points on each scan L"na The circuitry of this invention includes two similar portions so that it may handle each of the two line segments defining a subportion at the same time.Each portion of the circuitry begins, initially, at one vertex of a line segment, computes the slope of that line segment, determines from this computation whether the X or the Y value of the segment increases at a greater rate, determines and stores an initial error value which is to be decremented based on the slope, and begins plotting values from a first vertex. The error value' is selected to measure the distance, perpendicular to the axis of greatest movement, between the exact path of the line segment and the actual pixels generated. If the value of X changes faster than Y, then with each step X is incremented (or decremented) by one pixel while the change in Y is subtracted from the error value until the error value reaches zero or less.In this manner, the X value at which the V value is to be incremented (or decremented) is determined. This X value is stored as the end X value for the particular line segment, and the Y value is incremented (or decremented). The X value first encountered at the new Y value is stored as the beginning X value for the new scan line associated with the new Y value. The operation continues in this manner, storing for each Y value the first and last X value encountered, until the end vertex for the line segment is reached.
Since two circuits are operating in the same manner to process the two line segments of each subportion of a quadrilateral at the same time, the portion of the circuitry handling the first line segment ready to change its Y level, when ready to do so, waits for the circuitry handling the other line segment to reach the point of change in its Y value. When this occurs, the X values for a complete scan line have been defined and may be processed; consequently, both circuits advance to the next Y value at the same time. The processing of the two beginning and two ending X values identified for each of the scan lines involves determining the leftmost (minimum) and the rightmost (maximum) of the stored X values to be delivered to the mask generation circuitry 20 shown in Figure 3.
In order to rapidly process each quadrilateral, when the end of a line segment of a subportion is reached, the circuitry loads the next line segment to be processed. As is often the case, one line segment terminates before the other. In such a case, the non-terminating line segment information need not be reloaded; and substantial time is saved.
The circuitry continues processing the line segments of the quadrilateral until the figure is completed. At each step, the values generated are passed to circuitry for sorting the values to determine the actual beginning and ending values of the scan lines in view of the direction of operation of the circuitry of this invention and the application of the clip window information. This sorting operation takes place because, as pointed out above, the system and the circuitry of this invention are devised to select the optimum manner of decomposing a shape so that the operation proceeds at its most rapid. For example, If a shape to be decomposed lies only partially within a clip window and either partially above or below that clip window, the operation proceeds more rapidly if the portion outside the clip window need not be processed.This may be accomplished if the decomposition may proceed from either the top down or the bottom up.
Furthermore, if the operation proceeds from the bottom up, fewer page boundaries in memory need to be crossed if the operation proceeds from right to left rather than from left to right as in the normal case. The crossing of fewer page boundaries also allows more rapid operation.
The following is an algorithm in pseudocode similar to the C programming language for implementing the operation of this invention. The algorithm represents a modified version of the well known Bresenham Algonithm aithcug# it should be apparent to those skilled in the art that numerous other scan conversion algorithms exist and could be readily #rnplernsnte# in practicing the invention.
In this algorithm, DeltaX means the change in X from one vertex to another; Deltas means the change in Y from one vertex to another; X is initially set to the value of the beginning vertex; Y is initially set to the value of the beginning vertex; Xterm is the X value of the ending vertex; Vterm is the Y value of the ending vertex; abs( ) returns the absolute value of its arguments; and major axis refers to either X or Y depending on whether DeltaX is greater than Deltas or not.
initialization: DeltaX = abs (X - Xterm) DeltaY = abs (V - Yterm) major axis = ((DeltaY - DeltaX) > = 0) ? V : X slope = ((X - Xterm) > = 0) ? Y: X up = ((Y -Yterm) > = 0) ? D : 1 E =: (Delta (major axis) 1) cb = Delta (major axis) tO) r least significant X major loop: start~pixel (X,Y) while (X != Xterm) ( E=E-DeltaY if (testx (E, cb, up)) { stop pixel X, Y) Y + (up ? 1 :-1); X = X + (slope ? :-1); startpixel (X,Y) E = E + DeltaX; ) else X = X + (slope ? 1 :-1); stop~pixel (x,y) X-major #oop test:: testX(e,cb,up) = (e < 0)11 (up & amp; (cb== 0) & amp; (e == 0)); Y-major loop: start~pixel (X,Y) while (Y != Yterm) ( E - E - DeltaX if (testY (E, cb, slope)) { stop~pixel (X, Y) X = X + (slope ? 1 -1); Y=Y+(up?1 :-1): start~pixel (X,Y) E=E+DeltaY; ) else Y=Y+(up?1 :-1); stop~pixel (x,y) Y-major loop test: testY(e,cb,slope) = (e < 0)11 (slope & amp; (cb == 0)) Figure 4 illustrates the operation of a portion of the circuitry of this invention just described for handling one line segment. In Figure 4, a line segment starting at vertex (0,5) and ending at vertex (4,6) is illustrated. In implementing the invention, the circuitry first determines the change in X between the two vertices of the line segment, the change in Y between the vertices, and from this computes the slope of the line segment, determines the major axis (the va## with the greatest change), and sets the error term to be equal to one-half of the value of the change in X. This half value is selected to balance the pixels defined by the circuitry for the line segment to give a more symmetric appearance. Given these values, the plot commences with the vertex value of X being stored as the value of the first X on the scan line for the line segment.Then the circuitry decrements the error by the value of the change in Y and applies two test conditions: is the error term now less than zero, or is the drawing direction up and the error equal to zero.
If neither of these conditions have occurred, the operation continues until the value of the error term is brought to a point where the test condition indicates a true state, i.e., zero or less. At this point, the value of the X term is stored as the last X value for that scan line (Y value) for that line segment.
The operation continues to the next Y value, storing the first X value after the increment as the beginning X value for the scan line and adding back the value of the change in X to the error term. The operation continues along the scan line, increasing the X values and reducing the error term until the error term falls to zero or less. Again, the X value at this point is stored as the last X value for the scan line, the change in X is added back to the error term, and the operation moves to the next Y value.
The operation continues until the X value is determined to be equal to the X termination value for the line segment; at this point the entire line segment is defined, and the circuit can be initialized for a new line segment.
It should be noted that although each of the portions of the circuit operate independently to process one of the two line segments, as each portion of the circuitry handling a line segment ends a particular scan line, it tests whether the other line segment has been completely defined for that scan line. If it has not, then the circuitry waits for the other line segment to finish that scan line so that the two may progress together and the complete definition of each scan line may be transferred to the circuitry which follows at one time.
Figure 5 illustrates one circuit 30 which is a preferred embodiment for implementing the invention. The circuit 30 includes a pair of essentially similar portions 32 and 34, each of which handles one of the two line segments. Only the portion 32 will be discussed because of this similarity.
When determining the end values of scan lines, the circuitry is first initialized for each line segment. To accomplish this, on a first clock cycle, the portion 32 receives input values representing the X values of the beginning and ending of the first line segment (the A line segment). These values are stored in registers 36 and 38, respectively, and are transferred to multiplexors 40 and 42. the X values are passed by the multiplexors 40 and 42 to exclusive OR (XOR) gates 44 and 46.
These XOR gates 44 and 46 also receive inputs (zero or one) which allow the X value to be passed through or complemented so that values may be either added or subtracted by an adder 48. If a zero is furnished the exclusive OR gate 44, for example, the value on the other input is simply passed through to the adder 48 while if a one is furnished the gate 44, the input value is complemented so (as a binary number) it may be conveniently subtracted. In order to determine the change in the X value from beginning to termination, the difference of the X terms is computed and furnished by a multiplexor 50 to a change-in-X register 52 for storage.
On the next clock cycle, the beginning and ending Y values of the A line segment are furnished the multiplexors 40 and 42; and, in a like manner, the change in Y is determined by the adder 48 and stored in both a changein-Y register 54 and an error register 56.
The storage of the change in Y value in the error register 56 allows the determination of the major axis without the need for additional circuitry.
This is accomplished by passing the values held in the registers 52 and 56 to the adder 48 while complementing one of them so that the larger of delta X or delta Y is determined. This large value is then divided by two by s#?#'n# #e vaiue ii# the adder 48 right by one bit and placed in the error waster by the mu#tiplexor 50. This completes the initialization of the circulfry 32.
At the same time, the circuitry 34 is receiving the beginning and ending X and Y values and completing its initialization for the other one of the two line segments to be processed, the B line. Once initialization is completed, each of the circuits 32 and 34 begins processing the line segment information for the line segment it is handling. Considering only circuit 32, the current X value for line A is maintained by register 36. The value in register 36 is tested against the termination value of X stored in register 38 by a comparator 58. If the values are not equal, the multiplexers 40 and 42 transfer the error and Y change values via the exclusive OR gates 44 and 46 to the adder 48 so that the Y change is subtracted from the error.The reduced error value is stored in the error register 56, and the process continues until the error value goes to zero or less. The relation of the error to the zero value is tested by a state machine 60 which, when the test condition is satisfied, passes the present X value as the end value for this Y scan line, causes the Y value to be incremented (or decremented), and resets the error register by adding to the present error value a value equal to the value of the change in X.
As outlined above, when either the circuitry 32 or the circuitry 34 reaches the point where a Y value is to change in accordance with the value of the slope of the line segment, the circuit 32 or 34 first to reach the change value signals the state machine 60 and waits for the other of the two circuits 32 or 34 until that circuit is also ready to change Y value. When this occurs, the state machine provides signals for advancing each of the two circuits 32 and 34 to the next Y line. In this manner, each circuit 32 and 34 handles the same Y scan line at the same time and the values of both ends of a scan line may be passed at the same time to the circuitry which follows.
When the circuit 30 of Figure 5 is processing a line segment to determine the X values of the horizontal line ends and the line segment is one with a slope greater than or equal to one, i.e., forty-five degrees or more, the circuitry operates in essentially the same manner. The X beginning and termination values of each line segment are first processed by each of the circuits 32 and 34 to determine a change in X value for each.
The Y beginning and termination values of each line segment are next processed by each of the circuits to determine a change in Y value for each. The change in X value is then compared to the change in Y value for each of the two line segments, and the error set to one-half of the change in V value for each line segment with a slope greater than one. The processing then proceeds as before, stepping through Y values initially, however, until a change occurs in X.
A circuit 64 is, in the meantime, handling the Y values. Circuit 64 includes a register 66 which initially receives and maintains the Y value, a multiplexer 68 which receives a number of signals including the V termination value of each line segment and the Y clip minimum and maximum values, and a Y termination register 70. The values in the registers 66 and 70 are compared by a comparator 72 which is capable of determining whether one value is greater, less than, or equal to the other.
This arrangement may be used to determine when a line segment has reached its termination point and also to determine when the figure is within the clip window.
Also included in the circuit 64 is a Y clip register 74 which receives input values indicating the maximum or minimum Y clip value. These values indicate the position of the upper and lower boundaries of the clip window to which the quadrilateral is to be written. The clip register 74 is furnished one of these values by a multiplexer 76 which passes either the minimum or maximum Y value of the clip window depending on the direction the information is being written to the frame buffer.
There are certain cases in which a particular shape to be rendered may be clipped at both its top and bottom edges. The clipping at the beginning adge of the shape is determined by comparing the Y initial value in register 66 with the beginning clip value which is furnished to the register 74 by a multiplexer 76 If the information is being written down the screen, for example, the value furnished is the clip minimum Y value; if progressing in the other direction, the clip maximum Y value is furnished to the register.
A multiplexer 78 fumishes the clip value to the comparator 72. The magnitude comparator 72 then provides a signal which inhibits rendering until the Y value is within the clip window.
The value of Y placed in the register 70 is the Y value of the last line to be drawn in the trapezoid or the appropriate Y clipping boundary depending on the value at which the entire figure is to terminate once the shape is within the clip window. This value (register 70) is furnished by the circuitry (multiplexor 78) which compares the current value of Y (register 66) with this termination value for Y.
In the case in which the shape extends beyond the clip window, the ending Y clip value is placed in the register 70 and compared in the comparator 72 to the actual Y value. In this manner, the ending value of the portion of the shape to be rendered may be determined. This is especially useful in the present invention which is capable of writing the information to the frame buffer in either up or down order (that is, in increasing or decreasing Y direction, respectively). This allows the scan conversion of the lines to proceed such that the visible (non-clipped) information is processed first in the operation followed by information which will be clipped. This latter information may be disregarded thereby substantially increasing the speed of operation.
Although the present invention has been described in terms of a preferred embodiment, it will be appreciated that various modifications and alterations might be made by those skilled in the art without departing from the spirit and scope of the invention. The invention should therefore be measured in terms of the claims which follow.

Claims (4)

1. A circuit for determining the X values of each end of a series of horizontal lines connecting a pair of line segments each of which is defined by a pair of vertices, the area defined by the horizontal lines which is to be presented on an output device of a computer system, comprising means for determining the change in the X value between the vertices of a first line segment, means for determining the change in the X value between the vertices of a second line segment, means for determining the change in the Y value between the vertices of the first line segment, means for determining the change in the V value between the vertices of the second line segment, means for determining if the slope of the first line segment is greater than one, means for determining if the slope of the second line segment is greater than one, means for setting an error value for the first line segment equal to the greater of the change of X or Y between the vertices, means for setting an error value for the second line segment equal to the greater of the change of X or Y between the vertices, means for incrementing the value of the X or the Y term havino the greatest change between the vertices beginning at an initial position of such term for the first line segment, means for incrementing the value o;; the X or the Y term having the greatest change between the vertices beginning at an initial position of such term for the second line segment, the initial positions of each line segment having the same Y value, means for subtracting from the error for the first line segment the change in the X or Y term which is the least#with each increment of the X or Y term having the greatest change between the vertices until the error reaches zero, means for subtracting from the error for the second line segment the change in the X or Y term which is the least with each increment of the X or Y term having the greatest change between the vertices llnt the error reaches zero, means for incrementing the X or the Y term ,avin åS leash Change between the vertices of the first line segment @@ response to the error term for the first line segment becoming zero, means tr incrementing the X or the Y term having the least change between the vertices of the second line segment in response to the error term for the second line segment becoming zero, and means for continuing the operation until the X and Y values reached by incrementing is equal to the X and Y values for the ending vertex for that line segment.
2. A circuit for determining the X values of each end of a series of horizontal lines connecting a pair of line segments as claimed in claim 1 further comprising means for stopping the operation of the first means for incrementing the value of the X or the Y term having the greatest change between the vertices for the line segment for which the error term reaches zero until the error term for the other line segment reaches zero.
3. A circuit for determining the X values of each end of a series of horizontal scan lines connecting a pair of line segments each of which is defined by a pair of vertices, the horizontal scan lines defining an area to be rendered on a computer output device, comprising first and second circuit portions, each of said circuit portions including means to determine the slope of a line segment, means depending on the slope for determining the beginning and ending X values for each line segment for each scan line in the area to be rendered, means for causing the two circuit portions to begin operation at the same scan line, and means for changing the Y value for each circuit portion to the Y value of the next adjacent scan line at the same time.
4. A circuit for determining the X values of each end of a series of horizontal lines connecting a pair of line segments each of which is defined by a pair of vertices, the area defined by the horizontal lines s.mich is to be present on an output device of a computer system substantially as hereinbefore described with reference to the accompanying drawings.
GB8921264A 1988-12-20 1989-09-20 Method and apparatus for determining line positions for display and manipulation by a computer system Expired - Fee Related GB2226480B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
US28699788A 1988-12-20 1988-12-20

Publications (3)

Publication Number Publication Date
GB8921264D0 GB8921264D0 (en) 1989-11-08
GB2226480A true GB2226480A (en) 1990-06-27
GB2226480B GB2226480B (en) 1993-09-22

Family

ID=23101036

Family Applications (1)

Application Number Title Priority Date Filing Date
GB8921264A Expired - Fee Related GB2226480B (en) 1988-12-20 1989-09-20 Method and apparatus for determining line positions for display and manipulation by a computer system

Country Status (5)

Country Link
JP (1) JP2787487B2 (en)
CA (1) CA1324676C (en)
FR (1) FR2640792B1 (en)
GB (1) GB2226480B (en)
HK (1) HK52594A (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0218984A2 (en) * 1985-10-09 1987-04-22 International Business Machines Corporation Computer graphics processing apparatus and method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4667306A (en) * 1983-07-20 1987-05-19 Ramtek Corporation Method and apparatus for generating surface-fill vectors
US4725831A (en) * 1984-04-27 1988-02-16 Xtar Corporation High-speed video graphics system and method for generating solid polygons on a raster display

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0218984A2 (en) * 1985-10-09 1987-04-22 International Business Machines Corporation Computer graphics processing apparatus and method

Also Published As

Publication number Publication date
GB2226480B (en) 1993-09-22
HK52594A (en) 1994-06-03
FR2640792B1 (en) 1995-03-03
CA1324676C (en) 1993-11-23
GB8921264D0 (en) 1989-11-08
JPH02190897A (en) 1990-07-26
JP2787487B2 (en) 1998-08-20
FR2640792A1 (en) 1990-06-22

Similar Documents

Publication Publication Date Title
US6483519B1 (en) Processing graphic objects for fast rasterised rendering
US5218674A (en) Hardware bit block transfer operator in a graphics rendering processor
US4679041A (en) High speed Z-buffer with dynamic random access memory
EP0356103B1 (en) Scan-conversion process and processor
CA1213085A (en) Method and apparatus for image compression and manipulation
US4648045A (en) High speed memory and processor system for raster display
US4907174A (en) Z-buffer allocated for window identification
US5973705A (en) Geometry pipeline implemented on a SIMD machine
US6828985B1 (en) Fast rendering techniques for rasterised graphic object based images
US4677573A (en) Hardware generation of styled vectors in a graphics system
US5003497A (en) Method for three-dimensional clip checking for computer graphics
GB2226479A (en) Method and apparatus for fractional double buffering
JPS63198174A (en) Graphic processor
US5128872A (en) Method and apparatus for determining line positions for display and manipulation by a computer system
US5020002A (en) Method and apparatus for decomposing a quadrilateral figure for display and manipulation by a computer system
US5590249A (en) Three dimensional sprite rendering apparatus and method
US4945497A (en) Method and apparatus for translating rectilinear information into scan line information for display by a computer system
US5117485A (en) Method and apparatus for sorting line segments for display and manipulation by a computer system
EP0250868A2 (en) Method and apparatus for area fill in a raster graphics system
JPH0714029A (en) Equipment and method for drawing of line
GB2226480A (en) Method and apparatus for determining line positions for display and manipulation by a computer system
JPH0651937A (en) Data processing system and method of data control
AU618129B2 (en) Method and apparatus for sorting line segments for display and manipulation by a computer system
JPS642953B2 (en)
AU619055B2 (en) Method and apparatus for optimized depth cueing using short vectors

Legal Events

Date Code Title Description
PCNP Patent ceased through non-payment of renewal fee

Effective date: 20030920