Current Issue Cover
反走样直线的灰度循环生成算法

牛连强1,2, 张胜男1, 钟玲2(1.沈阳工业大学信息科学与工程学院, 沈阳 110870;2.沈阳工业大学软件学院, 沈阳 110023)

摘 要
灰度转换是整数反走样直线和曲线绘制算法中较为耗时的操作。为了提高反走样直线的绘制效率,提出了一种直接利用灰度循环控制生成反走样直线的纯整数算法。该算法采用两点反走样模式,根据对灰度值的分解、每次步进时的像素及其灰度值直接利用灰度增量控制产生,从而避免了候选点与真实直线之间的距离计算,以及由距离到灰度的转换。分析表明,该算法每次步进仅需要4~5次整数基本运算,其效率较现有整数反走样直线生成算法有大幅度提高,且具有与基本直线生成算法相似的简单性。
关键词
Integral algorithm for generating anti-aliased straight line controlled by gray iteration

Niu Lianqiang1,2, Zhang Shengnan1, Zhong Ling2(1.School of Information Science and Engineering, Shenyang University of Technology, Shenyang 110870, China;2.School of Software, Shenyang University of Technology, Shenyang 110023, China)

Abstract
Gray-conversion is a time-consuming operation for drawing anti-aliased straight lines or curves. In order to improve the efficiency of drawing anti-aliased straight lines, we propose a new anti-aliasing algorithm based on a two-pixel model. Different from other anti-aliasing algorithms, a technique which controls iterations by grey values directly rather than distances is proposed. Calculations about distances between pixels and real line and distance-grey conversion are abandoned, but accurate grey values rather than estimated ones can be obtained. The analyses prove that for one step only 4~5 integer operations are invoked in this algorithm, and the drawing speed is faster than other methods. Furthermore, this algorithm can be constructed with the simplicity similar to basic scan conversion algorithms.
Keywords

订阅号|日报