摘要
提出了一种基于对角线行程的直线生成算法。针对现有基于行程模式的直线生成算法在直线斜率大于1/2时效率极剧下降的问题,提出将在同一45°对角线上的连续点亮的像素点个数作为行程计算。算法详细分析了决定对角线行程长度的所有因素,对于满足一定条件的特殊直线,算法不需要进行偏差判断,可直接生成整条直线;对普通直线,仅使用一次加法运算和判零运算即可得到对角线行程长度,改善了行程算法的效率,弥补了直线行程算法长期以来存在的缺点。
The efficiency of previous line interpolation algorithms based on horizontal run-length is greatly reduced when the slope of line is greater than 1/2. A new algorithm based on diagonal run-length was presented by treating the successive pixels on a same diagonal direction as a whole. Based on a careful analysis of the line segments' properties, the algorithm can generate the whole line without error discriminating when line meets a special condition; to other lines, the diagonal run-length can be determined by only one addition and a zero judgment so that the efficiency of line interpolation algorithm is improved.
出处
《计算机应用》
CSCD
北大核心
2008年第9期2270-2273,共4页
journal of Computer Applications
关键词
直线生成
行程
对角线
偏差因子
line interpolation
run-length
diagonal direction
error discriminator