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 centerline.

Patent
   5274754
Priority
Apr 14 1986
Filed
Apr 14 1986
Issued
Dec 28 1993
Expiry
Dec 28 2010
Assg.orig
Entity
Large
7
6
EXPIRED
7. A method of anti-aliasing an arc having a centerline on a video display, said video display having a plurality of pixels 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 inside and outside of said arc; and
illuminating on said display in response to said signals each of said predetermined number of said pixels outside said arc with an intensity Is and each of said predetermined number of said pixels inside said arc with an intensity It according to the equations: ##EQU26## where R=radius of an arc
D=internal error factor in Bresenham algorithm
abs(D) ( [0,2R]
K=constant.
8. An apparatus for anti-aliasing an arc having a centerline on a video display, said video display having a plurality of pixels comprising,
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 inside and outside of said arc; and
means for illuminating on said display in response to said signals each of said predetermined number of pixels outside said arc with an intensity Is and each of said predetermined number of pixels inside said arc with an intensity It according to the equations: ##EQU27## where R=radius of an arc
D=internal error factor in Bresenham algorithm
abs(D) ( [0,2R]
K=constant.
1. In 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 gate means, each of said first and second AND gate means having an output, a plurality of memory planes and a video display, said video display having a plurality of pixels, a method for anti-aliasing a curve having a centerline on said video display 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 pairs 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 one of said first numbers corresponding to said minimum distance in each of said ranges of distances from said centerline to said second input of one of said first comparators, respectively, 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 one of said second numbers corresponding to said maximum distance in each of said ranges of distances from said centerline to said second input of one of said second comparators, respectively, 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.
9. An apparatus for anti-aliasing a curve having a centerline on a video display, said video display having a plurality of pixels comprising:
a plurality of pairs of first and second comparators, each of said comparators having a first and a 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 one of said first numbers corresponding to said minimum distance in each of said ranges of distances from said centerline to said second input of one of said first comparators, respectively, 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 one of said second numbers corresponding to said maximum distance in each of said ranges of distances from said centerline to said second input of one of said second comparators, respectively, 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.
2. A method according to claim 1 wherein said distance of each of said pixels from said centerline comprises a distance, d, said minimum distance comprises a distance dmin said maximum distance comprises a distance dmax 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 dmin and said dmax according to the equation:
dmin ≦d≦dmax.
3. A method according to claim 2 wherein: ##EQU22## dmin =Nmin dmax =Nmax
dx=max[abs(X2 -X1),abs(Y2 -Y1)]
D=internal error factor in Bresenham algorithm
X1,X2,Y1,Y2 =define the end points of a curve
K=constant
Nmin,Nmax =an integer.
4. A method according to claim 2 wherein: ##EQU23## dx=max[abs(X2 -X1),abs(Y2 -Y1)] D=internal error factor in Bresenham algorithm
X1,X2,Y1,Y2 =define the end points of a curve
K,M=constant
Nmin,Nmax =an integer.
5. A method according to claim 2 wherein: ##EQU24## dmin =Nmin dmax =Nmax
R=radius of an arc
D=internal error factor in Bresenham algorithm
abs(D) ε[0,2R]
K=constant
Nmin,Nmax =an integer.
6. A method according to claim 2 wherein: ##EQU25## R=radius of an arc D=internal error factor in Bresenham algorithm
abs(D) ε[0,2R]
K=constant
Nmin,Nmax =an integer.
10. An apparatus according to claim 9 wherein said distance of each of said pixels from said centerline comprises a distance, d, said minimum distance comprises a distance dmin and said maximum distance comprises a distance dmax and said first and second comparators comprise means for comparing said d with said dmin and said dmax according to the equation:
dmin ≦d≦dmax.
11. An apparatus according to claim 10 wherein: ##EQU28## dmin =Nmin dmax =Nmax
dx=max[abs(X2 -Xl),abs(Y2 -Y1)]
D=internal error factor in Bresenham algorithm
Xl,X2,Y1,Y2 =define the end points of a curve
K=constant
Nmin,Nmax =an integer.
12. An apparatus according to claim 10 wherein: ##EQU29## dx=max[abs(X2 -Xl),abs(Y2 -Y1)] D=internal error factor in Bresenham algorithm
Xl,X2,Y1,Y2 =define the end points of a curve
K,M=constant
Nmin,Nmax =an integer.
13. An apparatus according to claim 10 wherein: ##EQU30## dmin =Nmin dmax =Nmax
R=radius of an arc
D=internal error factor in Bresenham algorithm
abs(D) ε[0,2R]
K=constant
Nmin,Nmax =an integer.
14. An apparatus according to claim 10 wherein: ##EQU31## R=radius of an arc D=internal error factor in Bresenham algorithm
abs(D) ε[0,2R]
K=constant
Nmin,Nmax =an integer.

1. Field of the Invention

The present invention relates to a graphics processor for producing vector, arcuate and circular line drawings on a video display in general and in particular to a method and apparatus for anti-aliasing vector, arcuate and circular line drawings on a video display.

2. Description of Prior Art

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 Xl,Y1 and X2,Y2 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 pixels 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 Ti and Si be turned on to an intensity inversely proportional to their distances d1 and d2 from the centerline of a vector. The distances d1 and d2 are calculated from the equations:

d1 =t cos α (1)

d2 =s cos α (2)

where:

d1 and d2 are the distances of Ti and Si from the vector in a direction perpendicular to the vector;

t and s are the vertical distances of Ti and Si 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 d1 and d2 are calculated, the intensity of the pixels Ti and Si 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 view of the foregoing, principal objects of the present invention are a novel method and apparatus for anti-aliasing vectors, arcs and circles produced on a video display.

In accordance with the above objects, 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:

dmin ≦d≦dmax ( 3)

where

d=distance of pixel from centerline

dmin, dmax =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 ##EQU1## where dx=max[abs(x2 -Xl),abs(Y2 -Y1)]

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 ##EQU2##

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 ##EQU3##

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 ##EQU4##

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 ##EQU5## 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 ##EQU6##

In solving equations (9a) and (9b), no division is actually required and only the most significant bit of Nmin R and Nmax 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 ##EQU7##

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.

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.

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 dmin and dmax. 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 dmin and the lines 22 and 23 would be represented by dmax. Similarly, in the second range the lines 22 and 23 would be represented by dmin and the lines 21 and 24 would be represented by dmax.

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 dmin and dmax. The numbers dmin and dmax define the minimum and maximum distances from the centerline 20 in each range. The boundaries dmin and dmax 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, dmin, 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 dmax, 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, dmin and dmax.

In operation, the CPU 3 produces a number corresponding to the radial distance, d, of each pixel from the centerline and the numbers dmin and dmax. These numbers are compared and condition signals C1 -CN 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.

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 (12)

(s-t)·dx=D (13)

s,t ε[0,1]

dx=max [abs(x2 -x1), abs (y2 -y1)] 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/2(1+D/dx) (14)

t=1/2(1-D/dx) (15)

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 (16)

It follows from (15) and (16) that

absD=dx·abs(1-2t)≦dx (17)

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:

dmin ≦d≦dmax (18)

where dmin, dmax are numbers of the form N/16 with N=0,1,2 . . . , 15 Equation (18) can then be rewritten as:

Nmin ≦16d≦Nmax (19)

Replacing d with either s or t, we get:

Nmin ≦16×1/2(1±D/dx)≦Nmax (20)

which is equivalent to:

Nmin ≦8(1±D/dx)≦Nmax (21)

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 ##EQU8## where Nmin, Nmax =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 Nmin and Nmax.

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.

Rewriting equation (22), to eliminate the expression dx/8, the following equation is obtained: ##EQU9## where (dx±D)/2 has the range of 2dx/2=dx.

The advantages of the long-comparator method are that the values (N×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 Nmin ×dx/16 and Nmax ×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, Nmin =3 and Nmax =1. By applying the short-comparator method, one obtains: ##EQU10## where 10(10) =1010(2) shifted three bits to the right produces 0001 and Nmin =0011(2), Nmax =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: ##EQU11## 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 ##EQU12## The long-comparator method, on the other hand, approximates ##EQU13##

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×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.

The inverse distance method simply calculates the values ##EQU14## 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:

Is =16(1-s) (28)

It =16(1-t) (29)

or from equations (14) and (15) ##EQU15##

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.

Referring again to FIG. 3, for any given point Si =(Xi,Yi) residing outside the circumference of an arc at a radial distance s, one can write:

xi2 +yi2 =(R+s)2 =>xi +yi2 -R2 =(R+s)2 -R2 =S(2R+s), (31)

where R=radius of the arc. Since s<<2R and Xi2 +Yi2 -R2 =D (the internal error of the Bresenham algorithm), one can write:

D≈s·2R=>S≈D/2R D≧0 (32)

The point Ti, which is the other candidate for antialiasing, is situated at a distance t inside the circle. With A comprising the intersection of the line Si Ti with the circumference of the circle, then: ##EQU16## but Ti A≈t=>s+t/t≃1/t=>s+t≃1=>t.perspectiveto .1-s.

Hence

t=1-D/2R (34)

for D≧0 and D=abs(D)=>t≈1-abs(D)/2R

In reality, the point (Xi,Yi) as interpolated by the Bresenham algorithm oscillates between being inside and outside the ideal circumference, i.e.

Xi2 +Yi2 -R2 0=>D 0. (35)

This problem is solved by making ##EQU17##

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 dmin and dmax when comparators are used or to calculate the intensities Is =16(1-s), It =16(1-t) if the inverse distance method is used, as follows: ##EQU18##

2.1 The short-comparator method ##EQU19## abs(D) ε[0,2R]
PAC 2.2 The long-comparator method ##EQU20##

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 Nmin ×R and Nmax ×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 without departing from the spirit and scope of the present invention. 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. For this reason, it is intended that the scope of the invention not be limited to the embodiments illustrated but be determined by reference to the claims hereinafter provided.

Sfarti, Adrian

Patent Priority Assignee Title
10152772, Jan 18 2016 Advanced Micro Devices, Inc.; Advanced Micro Devices, INC Techniques for sampling sub-pixels of an image
10354365, Jan 18 2016 Adavanced Micro Devices, Inc.; Advanced Micro Devices, INC Hybrid anti-aliasing
11076151, Sep 30 2019 ATI Technologies ULC Hierarchical histogram calculation with application to palette table derivation
11915337, Mar 13 2020 Advanced Micro Devices, Inc. Single pass downsampler
5420970, Mar 13 1991 Intel Corporation Method for determining computer image generation display pixels occupied by a circular feature
5469564, Feb 08 1993 SAMSUNG ELECTRONICS CO , LTD Data storage device with enhanced data security
5502795, Aug 31 1993 Matsushita Electric Industrial Co., Ltd. Antialias line generating method and antialias line generator
Patent Priority Assignee Title
4262290, May 12 1978 SMITHS INDUSTRIES LIMITED, A BRITISH COMPANY Display systems
4586037, Mar 07 1983 Tektronix, Inc. Raster display smooth line generation
4593372, Nov 29 1982 Tokyo Shibaura Denki Kabushiki Kaisha Line generating method
4601002, Jan 06 1983 The United States Army Corps of Engineers as represented by the Digital technique for constructing variable width lines
4698768, Mar 28 1980 SOCIETE FRANCAISE D EQUIPMENTS POUR LA NAVIGATION AEROENNE S F E N A Process for smoothing the curves generated in a television scanning system
GB2123658,
//
Executed onAssignorAssigneeConveyanceFrameReelDoc
Apr 07 1986SFARTI, ADRIANAdvanced Micro Devices, INCASSIGNMENT OF ASSIGNORS INTEREST 0045590094 pdf
Apr 14 1986Advanced Micro Devices, Inc.(assignment on the face of the patent)
Date Maintenance Fee Events
May 22 1997M183: Payment of Maintenance Fee, 4th Year, Large Entity.
May 29 2001ASPN: Payor Number Assigned.
May 29 2001M184: Payment of Maintenance Fee, 8th Year, Large Entity.
Jul 13 2005REM: Maintenance Fee Reminder Mailed.
Dec 28 2005EXP: Patent Expired for Failure to Pay Maintenance Fees.


Date Maintenance Schedule
Dec 28 19964 years fee payment window open
Jun 28 19976 months grace period start (w surcharge)
Dec 28 1997patent expiry (for year 4)
Dec 28 19992 years to revive unintentionally abandoned end. (for year 4)
Dec 28 20008 years fee payment window open
Jun 28 20016 months grace period start (w surcharge)
Dec 28 2001patent expiry (for year 8)
Dec 28 20032 years to revive unintentionally abandoned end. (for year 8)
Dec 28 200412 years fee payment window open
Jun 28 20056 months grace period start (w surcharge)
Dec 28 2005patent expiry (for year 12)
Dec 28 20072 years to revive unintentionally abandoned end. (for year 12)