计算机工程与应用 ›› 2009, Vol. 45 ›› Issue (20): 181-185.DOI: 10.3778/j.issn.1002-8331.2009.20.054

• 图形、图像、模式识别 • 上一篇    下一篇

基于SVG的动态颜色填充算法研究

林见莹1,李 岩2   

  1. 1.华南师范大学 计算机学院,广州 510631
    2.华南师范大学 空间信息技术与应用研究中心,广州 510631

  • 收稿日期:2008-04-21 修回日期:2008-08-04 出版日期:2009-07-11 发布日期:2009-07-11
  • 通讯作者: 林见莹

Dynamic color filling algorithm based on SVG

LIN Jian-ying1,LI Yan2   

  1. 1.School of Computer,South China Normal University,Guangzhou 510631,China
    2.Spatial Information Research Center,South China Normal University,Guangzhou 510631,China
  • Received:2008-04-21 Revised:2008-08-04 Online:2009-07-11 Published:2009-07-11
  • Contact: LIN Jian-ying

摘要: SVG提供了对区域进行动态颜色填充和渐变的标签<animateColor>。在工程实践中发现,区域边界越复杂,颜色动态变化过程所需系统资源就越多,以致影响浏览速度。在分析了SVG区域颜色填充和颜色动态变化基本算法的基础上,提出了一种应用原始交点链表的扫描线颜色填充算法。实验证明,在动态填充的过程中,该算法比SVG Viewer的总体效率明显改进了70%以上,且对发生了几何变换的区域也能够高效率地进行正确填充。

关键词: 可伸缩矢量图像, 原始交点链表, 颜色渐变, 颜色动态填充

Abstract: SVG(Scalable Vector Graphics) provides a label <animateColor> for dynamic and gradual color change filling with the region.From practical point of view,the browsing speed is not high enough to the end user as the more complex region boundary is,the more system resources are needed by the process of color gradual change.To solve this problem,a scan line color filling algorithm which uses the original node chain is brought forward based on the analysis of the basal algorithm of SVG region filling and the principle of color gradual change.The experiments prove that the algorithm performs a higher general efficiency than SVG Viewer about 70% during the process of dynamic filling.And it also provides an efficient and correct color region filling after geometric transformation.

Key words: Scalable Vector Graphics(SVG), original node chain, color gradual change, color dynamic filling