摘要: 针对传统区域填充存在的一些欠缺,提出了一种新的区域填充扫描线算法。该算法在处理同一条扫描线上的多个填充区域时,分成向上搜索和向下搜索两种情况进行,每种情况又都可能出现多个搜索新区;在填充过程中,考虑到当前扫描线区间的左右连续性和上下相关性,只需将出现的新搜索区压入堆栈,不需要将相邻的每根扫描线都压入堆栈,从而减少了像素的重复判读和回溯区的搜索时间,避免了不必要的进栈出栈处理,提高了填充效率。
关键词:
区域填充;扫描线;像素点;回溯区
Abstract: Against the defect of traditional area filling, this paper presents a new method for area filling scan line algorithm. To deal with areas on same scan line, different searching directions need to be processed separately, new searching areas may be found in this process. Considering the continuity and relativity of current scan line, it needs only push the new searching areas rather than every scan line area into stack in filling. In this case, it will decrease the number of repeated pixel reading, reduce the time spent on retrospective searching area, avoid needless operations of push stack and pop stack, raise the filling efficiency
Key words:
Area filling; Scan line; Pixel point; Retrospective searching area
张荣国,刘焜. 新区入栈的区域填充扫描线算法[J]. 计算机工程, 2006, 32(5): 63-64,121.
ZHANG Rongguo, LIU Kun. Area Filling Scan Line Algorithm with Pushing New Area into Stack[J]. Computer Engineering, 2006, 32(5): 63-64,121.