|
计算机应用研究 2012
Line drawing algorithm based on sorting pixel chains
|
Abstract:
In order to increase the low efficiency of the line drawing algorithm when the slope of the line is at 0.5~1, this pa-per proposed a line drawing algorithm based on sorting pixel chains. It treated a straight line as an aggregation of several hori-zontal pixel chains or diagonal ones. The attribute of a line and an algorithm of line drawing in a reverse direction, which wassimilar to the Bresenham algorithm, were used to calculate the length of all the pixel chains. The algorithm sorted the pixelchains by the codes generated by Bresenham algorithm. It generated one pixel chains by one judgment. Simulation results showthat the accuracy of straight line generated by new algorithm is as same as that generated by the Bresenham algorithm, and thecomputation is greatly reduced. The new algorithm only has two integer arithmetic, addition and multiplication, so it is suitablefor hardware implementation.