首页 | 本学科首页   官方微博 | 高级检索  
     

基于像素链的直线绘制算法
引用本文:朱晓林,蔡勇,张建生.基于像素链的直线绘制算法[J].计算机应用,2011,31(4):1057-1061.
作者姓名:朱晓林  蔡勇  张建生
作者单位:1. 西南科技大学 计算机科学与技术学院,四川 绵阳 6210102. 西南科技大学 制造科学与工程学院,四川 绵阳 621010
基金项目:国家自然科学基金资助项目
摘    要:针对直线生成算法在直线斜率大于0.5时的低效率问题,提出一种基于像素链的直线绘制算法。将直线看做是由许多条平行像素链或对角像素链拼接而成,提出并利用逆向生成直线的类Bresenham算法,将斜率在0.5~1的直线绘制转换为斜率在0~0.5的直线绘制,一次判断生成一条像素链。仿真实验表明,基于像素链的算法生成的直线与Bresenham算法生成直线一致,且计算量显著减少。该算法只有加法和乘法两种整数运算,适合硬件实现,其绘制速度是Bresenham算法的4倍。

关 键 词:计算机图形学    直线绘制算法    Bresenham算法    逆向生成直线    整数运算
收稿时间:2010-10-26
修稿时间:2010-11-29

Line drawing algorithm based on pixel chain
ZHU Xiao-lin,CAI Yong,ZHANG Jian-sheng.Line drawing algorithm based on pixel chain[J].journal of Computer Applications,2011,31(4):1057-1061.
Authors:ZHU Xiao-lin  CAI Yong  ZHANG Jian-sheng
Affiliation:1. School of Computer Science and Technology, Southwest University of Science and Technology, Mianyang Sichuan 621010, China2. School of Manufacturing Science and Engineering, Southwest University of Science and Technology, Mianyang Sichuan 621010, China
Abstract:In order to increase the efficiency of the line drawing algorithm when the slope of the line is greater than 0.5, a line drawing algorithm based on pixel chain was proposed. A straight line was treated as an aggregation of several horizontal pixel chains or diagonal pixel chains. An algorithm of line drawing in a reverse direction, which was similar to Bresenham algorithm, was introduced, by which the slope between 0.5 and 1 was converted to that between 0 and 0.5 while generating line. One pixel chain was generated by one judgment. The simulation results show the straight line generated by new algorithm is as same as that generated by Bresenham algorithm, but the calculation is greatly reduced. The new algorithm has generated two integer arithmetic: addition and multiplication, and it is suitable for hardware implementation. The generation speed of the new algorithm is 4 times of Bresenham algorithm with the same complexity of design.
Keywords:computer graphics                                                                                                                        line drawing algorithm                                                                                                                        Bresenham algorithm                                                                                                                        line generation in reverse direction                                                                                                                        integer arithmetic
本文献已被 CNKI 万方数据 等数据库收录!
点击此处可从《计算机应用》浏览原始摘要信息
点击此处可从《计算机应用》下载全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号