2013, (6): 717-722.
Abstract:
Line is a basic element of graphics. Its drawing algorithm is always one of the basic content of computer graphics research. In order to solve the aliasing phenomenon generated when drawing a non-vertical and non-horizontal straight line on a raster graphics monitor, based on Bresenham algorithm and the thought of the traditional unweighted area sampling algorithm, a new anti-aliasing straight line drawing algorithm was put forward. Compared to the traditional algorithm and the well-known Wu algorithm, the new algorithm principally used integer addition and subtraction to draw anti-aliasing straight lines. The calculation of the new algorithm was simple and the new algorithm could be easily implemented in FPGA hardware platform. Experimental results show that the simulation speed obtained by the new algorithm when drawing lines is nearly three times as fast as that obtained by the traditional algorithm and is almost equivalent to that obtained by Wu algorithm. Although the straight line generated by Wu algorithm has good smooth effect, along the straight line direction adjacent pixels- grey values sometimes have large difference. However, the new algorithm not only has good smooth effect, but also can find a good solution to solve the problem Wu algorithm has. Therefore, compared with Wu algorithm, the new algorithm-s anti-aliasing effect is much better.