Method and apparatus for generating anti-aliased vectors, arcs and circles on a video display

Abstract: A method and apparatus for anti-aliasing vectors, arcs and circles comprising a plurality of pixels on a video display. The distance, d, of each pixel from the centerline of a curve is computed using a plurality of linearly dependent equations. The intensity of each pixel is set as a function of the magnitude of the distance, d, of the pixel from the centerline of the curve. In some cases, the distance, d, is compared with ranges of distances and the intensity of the pixel set according to the range within which the pixel is located. In other cases, the intensity of the pixel is simply inversely proportional to its distance, d, from the center-­ line.

Description: The present invention relates to a method and apparatus for anti-aliasing vector, arcuate and circular line drawings on a video display. A video display comprises a plurality of rows and columns of uniformly spaced discrete locations called pixels. The pixels are illuminated by means of one or more electron beams which are directed through holes in a mask which define the boundaries of the pixels. To draw a vector, i.e straight line, on the display, the end points X₁,Y₁ and X₂,Y₂ of the line are sent to a graphics processor. The processor, using a suitable algorithm, such as the Bresenham Line Algorithm described in Fundamentals of Interactive Computer Graphics by Foley & VanDam, identifies the location of all pixels intersected by the vector. If the desired vector passes between the centers of a pair of pixel and, therefore, does not intersect the center of either of them, the algorithm identifies the location of the pixel closest to the centerline of the vector and generates a signal which is used for illuminating that pixel to a predetermined intensity. The selected pixel may be either above or below the centerline of the vector. The number of pixels in which the center of the pixel is intersected by a vector on a display varies as the slope of the vector on the display changes such that to an observer, as the slope of the vector varies, the vector on the display appears more or less jagged. This effect, which is called aliasing, is analogous to the effect of sampling a signal at a frequency too low to allow exact reconstruction of that particular signal. Heretofore, a number of proposals have been made to reduce the jagged appearance, i.e. aliasing, of a vector on a video display by selectively controlling the intensity of the illuminated pixels. Typically, the intensity is made inversely proportional to the distance of a pixel from the centerline. In one such proposal, a method called pixel dithering is employed. In pixel dithering, the intensity of a pixel is controlled by controlling the amount of the electron beam flux which is permitted to impinge on the surface of the display. Recalling that pixel boundaries are defined by the boundaries of a hole in a mask, 100% pixel intensity is achieved when the electron beam is directed into the center of the hole. If the electron beam is turned on during a scan such that 50% of the beam is blocked by the mask, then the pixel intensity will be reduced to 50%. Similarly, if 75% of the beam is blocked by the mask, then the pixel intensity will be reduced to 25%, etc. The disadvantages of pixel dithering is that it has only been used for anti-aliasing vectors and has not been used for anti-aliasing arcs and circles; it is expensive to build the electronic circuits required for controlling the electron beam, and the vectors displayed on the video display cannot be stored in a bit map. In another method, to reduce the jagged appearance, i.e. aliasing, of a vector on a video display, it has been proposed to illuminate not one, but two, pixels in either a row or a column of pixels intersected by a vector with the intensity of the pixels being inversely proportional to their distance from the centerline of the vector. For example, in their article Filtering Edges for Gray-Scale Displays , Computer Graphics, August 1981, pp.1-5, Gupta and Sproull propose that to improve gray-scale displays, a pair of pixels T i and S i be turned on to an intensity inversely proportional to their distances d₁ and d₂ from the centerline of a vector. The distances d₁ and d₂ are calculated from the equations: d₁ = t cos α d₂ = s cos α where: d₁ and d₂ are the distances of T i and S i from the vector in a direction perpendicular to the vector; t and s are the vertical distances of T i and S i from the centerline of the vector as determined by the Bresenham algorithm; and α = angle of vector relative to a row of pixels intersected by the vector. After the distances d₁ and d₂ are calculated, the intensity of the pixels T i and S i is made inversely proportional thereto. Disadvantages of the Gupta and Sproull proposal are that the calculations required for evaluating the expressions (1) and (2) above are generally difficult and time consuming in that they involve independent expressions comprising trigonometric functions. Moreover, they result in producing a "barber-pole" effect, i.e. the intensity of the pixels lying along the centerline of the curve varies, producing an impression of twist. In a method of displaying an arc of a circle described and shown in GB-A-2 123 658 there are several approximations as follows; 1. d is approximated with a polynomial of degree 1 in p and q. This is a very gross approximation that is only somewhat acceptable for large radiuses (i.e. when the circle has small curvature). Let's call the approximative distance ∼d in order to distinguish it from the real distance , d. 2. The computation of ∼d suffers from error accumulation due to the errors in computing δd/δp and δd/δq. 3. The computation of δd/δp and δd/δq suffers from error accumulation transmitted from potential errors in computing 1/r. For example if r=33 no amount of bits can represent 1/33 exactly. 4. Both δd/δp and δd/δq are grossly approximated as being equal to p/r and q/r respectively. This approximation holds true only and for larger values of r. In view of the foregoing, we will describe a novel method and apparatus for anti-aliasing vectors, arcs and circles produced on a video display. This uses the internal error factor D in the Bresenham algorithm. The present invention provides a graphics processor - apparatus for antialiasing a curve having a centerline on a video display, said video display having a plurality of pixels, said graphics processor apparatus comprising: a plurality of pairs of first and second comparators, each of said comparators having a first and second input and an output; means for generating for each one of a plurality of predetermined positions on said centerline a plurality of signals which correspond to the distance each of a predetermined number of said pixels is from said position; means for generating a predetermined number of pairs of first and second numbers, said first number in each of said pairs having a magnitude corresponding to a predetermined minimum distance from said centerline and said second number in each of said pairs having a magnitude corresponding to a predetermined maximum distance from said centerline, each of said pairs of numbers defining a predetermined range of distances from said centerline; means for applying a number corresponding to said distance each of said predetermined number of pixels is from said position on said centerline to said first input of each of said first and second comparators; means for applying each of said first numbers corresponding to said minimum distance in each of said ranges of distances from said centerline to said second input of a different one of said first comparators, each of said first comparators providing a signal on its output when the magnitude of said number applied to its first input is equal to or greater than the magnitude of the number applied to its second input; means for applying each of said second number corresponding to said maximum distance in each of said ranges of distances from said centerline to said second input of a different one of said second comparators each of said second comparators providing a signal on its output when the magnitude of said number applied to its first input is equal to or less than the magnitude of the number applied to its second input; a plurality of first AND gates, each of said first AND gates having an output; means for coupling said outputs of said first and second comparators in each pair of comparators to a different one of said first AND gates, each of said first AND gates providing a signal on its output when there is a signal generated on the output of both said first and second comparators coupled thereto; a plurality of second AND gates, each of said second AND gates having an output; means for coupling a write enable signal to a first input of each of said second AND gates; means for coupling said output of each of said first AND gates to a second input of a different one of said second AND gates; a plurality of memory planes; means for coupling said output of each of said second AND gates to a different one of said plurality of memory planes, respectively; and means for addressing said memory planes for storing a bit in each memory plane in response to an output from the second AND gate coupled thereto, said bit and the memory plane in which it is stored determining the intensity of the pixel associated therewith. The present invention also provides a method for antialiasing a curve having a centerline on a video display including a graphics processor having a plurality of pairs of first and second comparators, each of said comparators having a first and a second input and an output, a plurality of first and second AND gates means, each of said first and second AND gates means having an output, and a plurality of memory planes, said video display having a plurality of pixels, said method comprising the steps of: generating for each one of a plurality of predetermined positions on said centerline a plurality of signals which correspond to the distance each of a predetermined number of said pixels is from said position; generating a predetermined number of pairs of first and second numbers, said first number in each of said pairs having a magnitude corresponding to a predetermined minimum distance from said centerline and said second number in each of said pairs having a magnitude corresponding to a predetermined maximum distance from said centerline, each of said pair of numbers defining a predetermined range of distances from said centerline; applying a number corresponding to said distance each of said predetermined number of pixels is from said position on said centerline to said first input of each of said first and second comparators; applying each of said first numbers corresponding to said minimum distance in each of said ranges of distances from said centerline to said second input of a different one of said first comparators each of said first comparators providing a signal on its output when the magnitude of said number applied to its first input is equal to or greater than the magnitude of the number applied to its second input; applying each of said second numbers corresponding to said maximum distance in each of said ranges of distances from said centerline to said second input of a different one of said second comparators each of said second comparators providing a signal on its output when the magnitude of said number applied to its first input is equal to or less than the magnitude of the number applied to its second input; coupling said outputs of said first and second comparators in each pair of comparators to a different one of said first AND gate means, each of said first AND gate means providing a signal on its output when there is a signal generated on the output of both said first and second comparators coupled thereto; coupling a write enable signal to a first input of each of said second AND gate means; coupling said output of each of said first AND gate means to a second input of a different one of said second AND gate means; coupling said output of each of said second AND gate means to a different one of said plurality of memory planes, respectively; and addressing said memory planes for storing a bit in each memory plane in response to an output from the second AND gate means coupled thereto, said bit and the memory plane in which it is stored determining the intensity of the pixel associated therewith. In general terms therefore, a plurality of linearly dependent equations, which are used in the Bresenham algorithm, are rewritten and thereafter used for generating a plurality of linearly dependent signals. Each of the signals corresponds to one of a plurality of pixels and to the distance of that pixel from the centerline of a curve and is used for illuminating that pixel with an intensity which is a function of the magnitude of said distance. The curve may comprise a vector, an arc, a circle or any combination thereof. In a number of embodiments of the present invention which are used for anti-aliasing a vector, the distance of a pixel from the centerline of the vector is compared with each one of a plurality of ranges of distances from said vector for generating a signal corresponding to each of the ranges within which the pixel is located according to the following general equation: d min ≦ d ≦ d max where d = distance of pixel from centerline d min , d max = numbers of the form N/16 with N = 0,1,2...,15 and correspond to the minimum and maximum distances of each range from the centerline. For example, if the distance of a pixel from the centerline of a vector is within a first range of distances from said centerline, the pixel is illuminated with a first predetermined intensity. But if the distance of the pixel from said centerline is within a second range of distances from said centerline, the pixel is illuminated with a second predetermined intensity. Alternatively, if the first and second ranges of distances partially overlap and said distance of said pixel from said centerline is within said overlapping portion of said range of distances, said pixel is illuminated with said first predetermined intensity. But if said distances of said pixel from said centerline is within said non-overlapping range of distances, then said pixel is illuminated with said second predetermined intensity. In one of the above-described embodiments used for anti-aliasing a vector, called the short-comparator method, equation (3) has the form N min ≦ dx±D dx/8 ≦ N max where dx = max[abs(x₂-X₁), abs (Y₂-Y₁)] and D is an internal error factor used in the Bresenham algorithm for decision taking In another of the above-described embodiments which is used for anti-aliasing a vector, called the long-comparator method, which provides a greater precision than equation (5) and avoids the division of dx±D by dx/8 for every pixel but requires a larger arithmetic logic unit for its dynamic range, equation (3) has the form N min dx 16 ≦ dx±D 2 ≦ N max dx 16 In still another of the above-described embodiments which is used for anti-aliasing a vector, which provides a greater precision than equation (5) but requires an additional bit of dynamic range, equation (3) has the form N min dx 8 ≦ dx±D ≦ N max dx 8 In still another embodiment of the present invention which is used for anti-aliasing a vector, each pixel is illuminated with an intensity which is inversely proportional to its distance from the centerline of the vector as determined by the equation dx±D 2dx In each of a number of further embodiments of the present invention, which is used for anti-aliasing an arc or a circle, the distance of each pixel from the centerline of the arc or circle is compared with each one of a plurality of ranges of distances for generating a signal corresponding to each of the ranges within which the pixel is located as described above for anti-aliasing vectors. In a first of these embodiments, called the short-comparator method, for the pixels inside and outside the centerline of the arc, equation (3) has the forms N min ≦ 2R-abs(D) R/8 ≦ N max and N min ≦ abs(D) R/8 ≦ N max where R = radius of arc or circle abs(D) has the range ε[0,2R] respectively. In another of the embodiments which is used for anti-aliasing an arc or a circle, called the long-comparator method, for the pixels inside and outside the centerline of the arc, equation (3) has the forms N min R 8 ≦ 2R-abs(D) ≦ N max R 8 and N min R 8 ≦ abs(D) ≦ N max R 8 In solving equations (9a) and (9b), no division is actually required and only the most significant bit of N min R and N max R is used in the comparators. In still another embodiment of the present invention which is used for anti-aliasing an arc or a circle, each pixel is illuminated with an intensity which is inversely proportional to its distance from the centerline of the arc or the circle as determined by the expressions I s = 2R-abs(D) R/8 I t = abs(D) R/8 In each of the embodiments, because linearly dependent equations instead of independent equations, are used for computing the distance of a pixel from the centerline of a vector, arc or circle, the time and apparatus required for making the computations and setting the intensity of each pixel is significantly reduced from that required in prior known methods and apparatus. Brief Description of the Drawing The above and other objects, features and advantages of the present invention will become apparent from the following detailed description of the accompanying drawings in which: Fig. 1 is a block diagram of a generalized multiple comparator circuit according to the present invention; Fig. 2 is a representation of pixels on a video display on which a vector is superimposed; and Fig. 3 is a representation of pixels on a video display on which an arc is superimposed. Detailed Description of the Drawing Referring to Fig. 1, there is provided in accordance with the present invention a plurality of N comparator circuits 1-1 to 1-N, an actual distance signal bus 2 with means for coupling the bus 2 to a central processing unit (CPU) 3, a plurality of AND gates 4-1 to 4-N, a bit map comprising a plurality of memory planes 5-1 to 5-N and an address bus 6. In each of the comparator circuit 1-1 to 1-N there is provided a first comparator 10, a second comparator 11, a first reference source 12, a second reference source 13 and an AND gate 14. A first input of the comparators 10 and 11 is coupled to the actual distance signal bus 2. A second input of the comparator 10 is coupled to the reference source 12. The second input of the comparator 11 is coupled to the reference source 13. The outputs of the comparators 10 and 11 are coupled to first and second inputs of the AND gate 14. The output of the AND gate 14 is coupled to a first input of one of the AND gates 4-1 to 4-N. A second input of AND gates 4-1 to 4-N is coupled to a source of write enable pulses WE. The outputs of each of the AND gates 4-1 to 4-N is coupled to the write enable input WE of one of the memory planes 5-1 to 5-N. The address lines of the memory planes 5-1 to 5-N are coupled to the address bus 6. Referring to Fig. 2, there is shown a plurality of pixels represented by a plurality of squares, with the center of each square representing the center of each pixel. Superimposed upon the pixels and extending at an angle α relative to a row thereof there is shown a vector, the centerline of which is designated 20. On each side of the centerline 20 there is provided a plurality of broken lines 21, 22, 23 and 24. Lines 21-24 represent ranges of distances from the centerline 20 where each range of distance is defined by the quantities d min and d max . For example, in Fig. 2, two ranges of distances are represented by the lines 21-24. The first range is from the centerline 20 to the line 22 and from the centerline 20 to the line 23. The second range is from the line 22 to the line 21 and from the line 23 to the line 24. In this example, for the first range the centerline 20 would be represented by d min and the lines 22 and 23 would be represented by d max . Similarly, in the second range the lines 22 and 23 would be represented by d min and the lines 21 and 24 would be represented by d max . Also shown in Fig. 2 there is provided a plurality of pairs of filled and unfilled circular marks 30 and 31 which are located at the center of certain ones of the pixels represented by the squares. Each such pair of pixels is associated with a particular position on the centerline 20. This position is defined by a line which extends through both pixels in each pair. As will be further described below, the distance of one of the pixels from the centerline along said line is defined by the quantity, s, in the Bresenham algorithm. The distance of the other pixel from said centerline along said line is defined by the quantity, t, in the Bresenham algorithm. The filled circular marks 30 represent pixels which have been illuminated to a 100% intensity. The unfilled marks 31 represent pixels which have been illuminated to a lesser intensity, e.g. 60% of the intensity of the pixels represented by the filled marks 30. It will be noted that all of the pixels illuminated to 100% intensity fall within the distance range defined by the lines 20-23 and that all of the pixels illuminated to an intensity of 60% fall within the distance range defined by the lines 21 and 22 and 23 and 24. By varying the intensity of the pixels in proportion to their distance from the centerline 20, it will be appreciated that the apparent jaggedness of the vector represented by the centerline 20, which would appear if only one pixel in each of the above-described pairs of pixels was illuminated, is reduced. This smoothing out of the appearance of the vector is called anti-aliasing. Referring again to Fig. 1, in operation, the CPU 3, for each pixel, provides a number which correspnds to a distance, d, of that pixel from the centerline 20. The CPU 3 also provides, for each range of distances above and below the centerline 20, a pair of numbers d min and d max . The numbers d min and d max define the minimum and maximum distances from the centerline 20 in each range. The boundaries d min and d max of each range are then placed in the registers 12 and 13 and applied to the second input of the comparators 10 and 11. The first input of the comparators 10 and 11 receive the number corresponding to the actual distance, d. In the comparators 10 and 11, the actual distance, d, is compared with each of the range boundaries. If the distance, d, is greater than or equal to the minimum range distance, d min , comparator 10 outputs a signal to the first input of the AND gate 14. If the distance, d, is less than or equal to the maximum range distance d max , comparator 11 outputs a signal to the second input of the AND gate 14. If both inputs of the AND gate 14 are active, the AND gate 14 outputs a signal C. The signal C indicates that a condition has been met and enables a corresponding one of the AND gates 4-1 to 4-N. The AND gate 4-1 to 4-N which is enabled then provides a write enable pulse WE on its output and applies the pulse WE to a corresponding one of the memory planes 5-1 to 5-N. At the same time that the CPU 3 generates the boundaries of the distance ranges and the actual distance, d, of a pixel from the centerline of a vector, the CPU 3 also produces an address of the pixel in each of the memory planes 5-1 to 5-N which is applied to the memory planes 5-1 to 5-N by means of the address bus 6. With the address of the pixel applied to all of the memory planes, a bit will be stored at that address only in the memory plane to which the write enable pulse is applied. In one embodiment of the present invention, each of the memory planes are assigned a predetermined intensity level. During a video refresh, if a pixel location in a memory plane has been set by a signal C as described above, that memory plane will produce a pixel having the predetermined intensity assigned to it. In another embodiment of the present invention, the intensity of each pixel is determined by a number of memory planes which have been set by a signal C in response to a given write enable pulse. For example, if the minimum boundary for both of the distance ranges represented in Fig. 2 comprise the centerline 20 and the maximum boundaries represented by lines 22 and 21 are used as the references in two of the pairs of comparator circuits 1-1 to 1-N, it will be appreciated that for pixels within the distance range defined by the boundaries 20-22 and 23, two C signals would be produced while only one condition signal C would be produced for those pixels lying within the boundaries defined by the lines 21,22 and 23,24. Thus it can be seen that very fine graduations of intensity can be obtained by using the multiple pairs of comparators having overlapping reference distance ranges. Referring to Fig. 3, there is shown a segment of a circle, or arc having a centerline designated as 40, a plurality of distance ranges represented by a plurality of lines 41, 42, 43 and 44 inside and outside the centerline 40 and a plurality of pairs of filled and unfilled circular marks defining the centers of pixels, S and T, located on radial lines outside and inside of the centerline, respectively. The lines 40-44 define the minimum and maximum of distance ranges, d min and d max . In operation, the CPU 3 produces a number corresponding to the radial distance, d, of each pixel from the centerline and the numbers d min and d max . These numbers are compared and condition signals C₁-C N are produced for controlling the intensity of pixels as described above with respect to the vectors of Fig. 2. In additional embodiments of the present invention as will be further described below, the distance, d, of each pixel from the centerline of a vector, arc or circle is used directly to control the intensity of the pixel such that the intensity of the pixel is inversely proportional to the distance, d. From the foregoing description of the operation of the apparatus of Fig. 1 wherein the intensity of a pixel is determined by means of a comparative analysis and the alternative embodiments of the present invention wherein the intensity of a pixel is inversely porportional to its distance, d, from the centerline of a curve, it will be appreciated that the calculation of the actual distance, d, from the centerline of a straight or arcuate curve should be done with the greatest precision consistent with a minimum of computation and apparatus. To avoid the difficult and time consuming operations of computing the distance, d, from the centerline of a curve for each pixel from independent expressions comprising trigonometric functions, such as used by Gupta and Sproull, supra, modifications of equations used in the Bresenham Line Algorithm are provided. As will be seen from the following discussion, the distance, d, for each pixel is computed from a plurality of linearly dependent equations for use in both the vector as well as arc interpolation methods and apparatus described above. 1. Vector interpolation As is well known, the Bresenham algorithm calculates for every pair of pixels closest to the centerline of a curve their distances to the centerline. These distances are s and t where: s + t = 1 (s-t) · dx = D s,t ε [0,1] dx = max [abs(x₂-x₁), abs (y₂-y₁)] and D is an internal error factor used in the algorithm for decision taking. Rewriting expressions (12) and (13), the following expressions are obtained: s = ½(1+D/dx) t = ½(1-D/dx) Because s,t ε [0,1] and s+t=1, it follows that D has the same order of magnitude as dx, i.e. D=(s-t)dx = (1-2t)dx It follows from (15) and (16) that absD = dx · abs(1-2t) ≦ dx As described above with respect to the apparatus of Fig. 1, a pixel gets intensified to a predetermined intensity if the distance, d, from the centerline is in a predetermined range as defined by the following general equation: d min ≦ d ≦ d max where d min , d max are numbers of the form N 16 with N=0,1,2..., 15 Equation (18) can then be rewritten as: N min ≦ 16d ≦ N max Replacing d with either s or t, we get: N min ≦ 16 x ½(1±D/dx) ≦ N max which is equivalent to: N min ≦ 8(1±D/dx) ≦ N max From equation (21), the general equation (18) can be rewritten in three different forms for use in the above-described apparatus as follows: 1.1 The short-comparator method N min ≦ dx±D dx/8 ≦ N max where N min , N max = 0,1,...,15 For each pixel the value dx±D is calculated and divided by the precalculated constant dx/8. The result is then compared using two four bit comparators, e.g. comparators 10 and 11 of Fig. 1, against N min and N max . The short-comparator method has the advantage that only 4-bit comparators are required and the disadvantages that the integer division dx/8 reduces the precision of the comparison and that a division dx±D/ct, where ct = a constant, must be executed for every pixel. 1.2 The long-comparator method Rewriting equation (22), to eliminate the expression dx/8, the following equation is obtained: N min dx 16 ≦ dx±D 2 ≦ N max dx 16 where (dx±D)/2 has the range of 2dx/2=dx. The advantages of the long-comparator method are that the values (N x dx)/16 are precalculated once at initialization by a 4-bit right shift with the only loss of precision being the 4 least significant bits in the right shifting of N min x dx/16 and N max x dx/16 and 1 least significant bit in the right shifting of dx±D/2. The disadvantage of the long-comparator method is that more bits are required in an ALU to maintain the necessary dynamic range than is required to compute d in the short-comparator method. The long-comparator method can be also used as an improvement of the short-comparator method by using five bit comparators instead of four bit comparators as shown by the following example: Suppose that dx=10, D=2, N min =3 and N max =1. By applying the short-comparator method, one obtains: dx+D dx/8 = 10+2 10/8 = 12 1 = 12 (10) = 1100 (2) where 10 (10) = 1010 (2) shifted three bits to the right produces 0001 and N min = 0011 (2) , N max = 1101 (2) . Since 0011 (2) < 1100 (2) < 1101 (2) , it follows that the pixel is inside the bounds. By applying the long-comparator method using 5-bit comparators, one obtains: dx+D 2 = 12 2 = 6 = 0110.0 (2) N min dx 16 = 3 x 10 16 = 11110 (2) 16 = 0001.1 (2) N max dx 16 = 13 x 10 16 = 130 16 = 100000 10 (2) 16 where 30 (10) = 11110 (2) shifted 4 bits to the right produces 0001.1 and 130 (10) = 10000010 (2) shifted 4 bits to the right produces 1000.0 (2) ; and 0001.1 (2) < 0110.0 (2) < 1000.0 (2) Obviously the long-comparator method using 5-bit comparators is more precise since the short-comparator method makes a rather poor approximation, replacing 10+2 10/8 = 9.6 by 12. The long-comparator method, on the other hand, approximates 3 x 10 16 = 1.875 (10) by 0001.1 (2) = 1.5 (10) and 13 x 10 16 = 8.125 (10) by 1000.0 (2) = 8 (10) From the foregoing discussion it is seen that the long-comparator method is faster, relative to the short-comparator method, in that it requires only two multiplications in the setup; and more precise, in that it employs a minimum amount of division and affects only the three least significant bits of N x dx and only 1 least significant bit of dx±D. Still, it should be noted that if n planes, i.e. n pairs of comparators, are used there are theoretically n possible intensity combinations. However, using two comparators per pixel, only n+1 of the possible intensity combinations can be ordered in a decreasing fashion. 1.3 The inverse distance method The inverse distance method simply calculates the values dx±D 2 · dx for each pair of pixels with four bits of precision. By interpreting the four bits as the encoding of 16 levels of intensity in four bit planes, the intensity I is equal to: I s = 16(1-s) I t = 16(1-t) or from equations (14) and (15) The inverse distance method has the advantage of producing 16 possible levels of intensity. It has the disadvantages that: it requires division for each pixel; it is imprecise due to the integer division dx/8; and it requires the use of a color look-up table to compensate for the fact that it produces a variable intensity along the centerline, which in turn produces an unpleasant twisting effect. Moreover, increasing the number of bit planes from 4 to 8 doesn't add any extra information - there are still only 16 levels of intensity that can be produced; and the correction necessary for creating consistent intensity vectors may not be the same with the standard gamma correction implemented in the color look-up table. 2. Arc (circle) interpolation. Referring again to Fig. 3, for any given point S i = (X i ,Y i ) residing outside the circumference of an arc at a radial distance s, one can write: X i ²+Y i ² = (R+s)² ⇒ X i +Y i ²-R² = (R+s)²-R² = S(2R+s), where R = radius of the arc. Since s << 2R and X i ²+Y i ²-R² = D (the internal error of the Bresenham algorithm), one can write: D ≈ s · 2R ⇒ S ≈ D 2R D ≧ 0 The point T i , which is the other candidate for antialiasing, is situated at a distance t inside the circle. With A comprising the intersection of the line S i T i with the circumference of the circle, then: s t = S i A T i A = s+t t = S i A+T i A T i A = 1 T i A but T i A ≈ t ⇒ s+t t ≃ 1 t ⇒ s+t ≃ 1 ⇒t ≃ 1-s. Hence t = 1 - D 2R for D ≧ 0 and D=abs(D) ⇒ t ≈ 1- abs(D) 2R In reality, the point (X i ,Y i ) as interpolated by the Bresenham algorithm oscillates between being inside and outside the ideal circumference, i.e. This problem is solved by making s = abs(D) 2 · R and t = 1 - abs(D) 2R As in the case of vector interpolation discussed above, it is not necessary to identify which is the main pixel and which is the antialiasing candidate. All that is required is to compare s and t with the reference values d min and d max when comparators are used or to calculate the intensities I s = 16(1-s), I t = 16(1-t) if the inverse distance method is used, as follows: N min ≦ 16d ≦ N max N min ≦ 16 x abs(D) 2R ≦ N max 2.1 The short-comparator method: N min ≦ abs(D) R/8 ≦ N max N min ≦ 2R-abs(D) R/8 ≦ N max abs(D) ε[0,2R] 2.2 The long-comparator method: N min x R 8 ≦ abs(D) ≦ N max x R 8 N min x R 8 ≦ 2R-abs(D) ≦ N max x R 8 2.3. The inverse distance method: From the foregoing discussion, it is apparent that the long-comparator method may be preferred for anti-aliasing arcs because no division is actually required. In practice, only the most significant bit of N min x R and N max x R is retained and the three least significant bits are simply ignored. While several embodiments of the present invention are described above, various modifications may be made thereto. For example, the illustrated embodiments comprising comparator circuits are described with respect to two ranges of distances. However, it is contemplated that any number N of distance ranges may be used with a comparable number of comparators.

Claims: A graphics processor apparatus for anti-aliasing a curve having a centerline on a video display, said video display having a plurality of pixels, said graphics processor apparatus comprising: a plurality of pairs of first (10) and second (11) comparators, each of said comparators having a first and second input and an output; means (3) for generating for each one of a plurality of predetermined positions on said centerline a plurality of signals which correspond to the distance each of a predetermined number of said pixels is from said position; means (3) for generating a predetermined number of pairs of first and second numbers, said first number in each of said pairs having a magnitude corresponding to a predetermined minimum distance from said centerline and said second number in each of said pairs having a magnitude corresponding to a predetermined maximum distance from said centerline, each of said pairs of numbers defining a predetermined range of distances from said centerline; means (3) for applying a number corresponding to said distance each of said predetermined number of pixels is from said position on said centerline to said first input of each of said first and second comparators; means (12) for applying each of said first numbers corresponding to said minimum distance in each of said ranges of distances from said centerline to said second input of a different one of said first comparators each of said first comparators providing a signal on its output when the magnitude of said number applied to its first input is equal to or greater than the magnitude of the number applied to its second input; means (13) for applying each of said second numbers corresponding to said maximum distance in each of said ranges of distances from said centerline to said second input of a different one of said second comparators each of said second comparators providing a signal on its output when the magnitude of said number applied to its first input is equal to or less than the magnitude of the number applied to its second input; a plurality of first AND gates (14), each of said first AND gates having an output; means for coupling said outputs of said first and second comparators in each pair of comparators to a different one of said first AND gates, each of said first AND gates providing a signal on its output when there is a signal generated on the output of both said first and second comparators coupled thereto; a plurality of second AND gates (4), each of said second AND gates having an output; means for coupling a write enable signal (WE) to a first input of each of said second AND gates; means for coupling said output of each of said first AND gates to a second input of a different one of said second AND gates; a plurality of memory planes; means for coupling said output of each of said second AND gates to a different one of said plurality of memory planes (S.1-S.N), respectively; and means for addressing said memory planes for storing a bit in each memory plane in response to an output from the second AND gate coupled thereto, said bit and the memory plane in which it is stored determining the intensity of the pixel associated therewith. An apparatus according to claim 1 characterised in that said distance of each of said pixels from said centerline comprises a distance, d, which is directly related to the magnitude of the internal error factor D in the Bresenham algorithm said minimum distance comprises a distance d min and said maximum distance comprises a distance d max and said first and second comparators comprise means for comparing said d with said d min and said d max according to the equation: d min ≦ d ≦ d max. An apparatus according to claim 2 characterised in that: d = dx ± D dx/K d min = N min d max = N max dx = max[abs(X₂-X₁),abs(Y₂-Y₁)] X₁, X₂, Y₁, Y₂ define the end points of a curve D = internal error factor in Bresenham algorithm K = constant N min and N max = an integer An apparatus according to claim 2 characterised in that: d = dx ± D K d min = N min dx M d max = N max dx M dx = max[abs(X₂-X₁),abs(Y₂-Y₁)] D = internal error factor in Bresenham algorithm X₁, X₂, Y₁, Y₂ define the end points of a curve K,M = constant N min and N max = an integer. An apparatus according to claim 2 characterised in that: d = 2 R - abs ( D ) R/K d = abs ( D ) R/K d min = N min d max = N max R = radius of an arc D = internal error factor in Bresenham algorithm abs(D) ε[0,2R] K = constant N min and N max = an integer. An apparatus according to claim 2 characterised in that: d = 2R-abs(D) or d = abs(D) d min = N min R K d max = N max R K R = radius of an arc D = internal error factor in Bresenham algorithm abs(D) ε[0,2R] K = constant N min and N max = an integer. A method for antialiasing a curve having a centerline on a video display including a graphics processor having a plurality of pairs of first and second comparators, each of said comparators having a first and a second input and an output, a plurality of first and second AND gates means, each of said first and second AND gates means having an output, and a plurality of memory planes, said video display having a plurality of pixels, said method comprising the steps of: generating for each one of a plurality of predetermined positions on said centerline a plurality of signals which correspond to the distance each of a predetermined number of said pixels is from said position; generating a predetermined number of pairs of first and second numbers, said first number in each of said pairs having a magnitude corresponding to a predetermined minimum distance from said centerline and said second number in each of said pairs having a magnitude corresponding to a predetermined maximum distance from said centerline, each of said pair of numbers defining a predetermined range of distances from said centerline; applying a number corresponding to said distance each of said predetermined number of pixels is from said position on said centerline to said first input of each of said first and second comparators; applying each of said first numbers corresponding to said minimum distance in each of said ranges of distances from said centerline to said second input of a different one of said first comparators each of said first comparators providing a signal on its output when the magnitude of said number applied to its first input is equal to or greater than the magnitude of the number applied to its second input; applying each of said second numbers corresponding to said maximum distance in each of said ranges of distances from said centerline to said second input of a different one of said second comparators each of said second comparators providing a signal on its output when the magnitude of said number applied to its first input is equal to or less than the magnitude of the number applied to its second input; coupling said outputs of said first and second comparators in each pair of comparators to a different one of said first AND gate means, each of said first AND gate means providing a signal on its output when there is a signal generated on the output of both said first and second comparators coupled thereto; coupling a write enable signal to a first input of each of said second AND gate means; coupling said output of each of said first AND gate means to a second input of a different one of said second AND gate means; coupling said output of each of said second AND gate means to a different one of said plurality of memory planes, respectively; and addressing said memory planes for storing a bit in each memory plane in response to an output from the second AND gate means coupled thereto, said bit and the memory plane in which it is stored determining the intensity of the pixel associated therewith. A method according to claim 7 characterised in that said distance of each of said pixels from said centerline comprises a distance d, which is directly related to the magnitude of the internal error factor D in the Bresenham algorithm said minimum distance comprises a distance d min , said maximum distance comprises a distance d max and said steps of applying said numbers to said first and second inputs of said comparators comprises the step of comparing said d with said d min and d max according to the equation: d min ≦ d ≦ d max. A method according to claim 8 characterised in that: d = dx ± D dx/K d min = N min d max = N max dx = max[abs(X₂-X₁), abs(Y₂-Y₁)] X₁, X₂, Y₁, Y₂ define the end points of a curve D = internal error factor in Bresenham algorithm K = constant N min and N max = an integer. A method according to claim 8 characterised in that: d = dx ± D K d min = N min dx M d max = N max dx M dx = max[abs(X₂-X₁), abs(Y₂-Y₁)] D = internal error factor in Bresenham algorithm X₁, X₂, Y₁, Y₂ define the end points of a curve K,M = constant N min and N max = an integer. A method according to claim 8 characterised in that: d = 2 R-abs ( D ) R/K d = abs ( D ) R/K d min = N min d max = N max R = radius of an arc D = internal error factor in Bresenham algorithm abs(D) ε[0,2R] K = constant N min and N max = an integer. A method according to claim 8 characterised in that: d = 2R-abs(D) or d = abs(D) d min = N min R K d max = N max R K R = radius of an arc D = internal error factor in Bresenham algorithm abs(D) ε[0,2R] K = constant N min and N max = an integer.

Inventors: SFARTI ADRIAN, SFARTI, ADRIAN
Applicants: ADVANCED MICRO DEVICES INC, ADVANCED MICRO DEVICES, INC.
Application year: 1987
Main classification: G09G1
IPC codes: G09G5, G06T11