The Computer Journal Advance Access originally published online on March 5, 2007
The Computer Journal 2007 50(4):473-477; doi:10.1093/comjnl/bxm004
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||
A Linear-Time Constant-Space Algorithm for the Boundary Fill Problem
Computer Science Department, Technion IIT, Haifa 32000, Israel
* Corresponding author: volodyan{at}cs.technion.ac.il
Received 25 June 2006; revised 2 October 2006
In this paper, we consider the problem of boundary fill of a 4 or 8-connected region in a graphic device having a color image frame-buffer memory. We provide an algorithm that solves the problem in a time linear in the number of pixels in the region and requiring only constant memory space in addition to the frame-buffer memory itself. We map this problem to a boundary fill problem in a general graph, and solve it using a novel depth first search-based algorithm.
Key Words: Computer graphics boundary fill algorithm space complexity