摘要:
A method and apparatus for drawing at least a one pixel wide antialiased line on an edge of a filled polygon. The apparatus comprises an interpolator, having a set up unit and an iterator unit, and a blender. The set up unit determines various parameters of the line to be drawn and selects a pair of pixels adjacent to and straddling an idealized line representing the line to be drawn, where the first pixel is claimed by the edge of the polygon as a filled pixel. The iterator unit determines the coverages of the second pixel based on the parameters output by the set up unit. The blender determines the color intensity value of the second pixel as a function of its coverage and writes the color value into a memory. The apparatus also incorporates methods for antialiasing polygon meshes and resolving accumulation error in the derivation of each pixel's position.
摘要:
Starting and ending caps of smooth line segments may be drawn on a computer display without complicated calculations and avoiding the use of inverse square root calculations by drawing the caps using rectangles. The direction of the line segment may be determined, and using the direction certain pixels in a four-pixel grouping may be selectively illuminated. The normalized intensity values of the illuminated pixels may be determined by computing an x-fraction and a y-fraction, representing the distance in the x-direction and y-direction between a sample origin point in a corner of the four-pixel grouping and the closest corner of a region covered by the mathematical origin or endpoint corrected for the thickness of the line segment. It is generally preferable for only two pixels to be illuminated for each cap, the pixels chosen according to a formula ensuring that there are no perception problems when two smooth line segments share a common mathematical origin or endpoint.
摘要:
A method for rendering a line segment extending in the positive-x direction and positive-y direction on a computer display given a starting point and an ending point, the starting point having the form (xs, ys) and the ending point having the form (xe, ye). In this method, &Dgr;x and &Dgr;y are computed using the formula &Dgr;x=|xe−xs| and &Dgr;y=|ye−ys|, respectively. Then dt(0)=(yf*&Dgr;x)−(xf*&Dgr;y) is computed, where xf is the fractional portion of xs and yf is the fractional portion of ys, which allows for more precision. If the line segment extends in the postive-x and positive-y directions, then for each column n containing a portion of said line segment the process: plots said current pixel if dt(n) 0.5*&Dgr;x; moves said current pixel to the right one pixel if dt(n) 0.5*&Dgr;x; and corrects dt(n) by computing dt(n)=dt(n)−&Dgr;x if dt(n)>0.5*&Dgr;x. After all of these computations have been performed, the process may iterate to the next column by computing dt(n+1)=dt(n)+&Dgr;y. This method greatly reduces the number of calculations required by the prior art methods, thus producing a faster and more efficient process by which to draw line segments on a computer display.