Flood-filling of a region on raster devices is one of the most widely used techniques in the interactive graphical systems. Existing filling algorithms, in general, require significant amount of memory and/or are limited to the specific types of regions or fill styles. We discuss some of the up-to-date filling techniques and propose a general framework for generation of flood-filling algorithms. An “optimal” representative of this class of algorithms is presented. It is proved, in particular, that necessary size of work memory for this particular algorithm is proportional to the horizontal dimension of the box containing region to be filled. The algorithm may be used to fill 4-step and 8-step connected regions both border- and interior-defined.
Read full abstract