Flood-fill is an algorithm which fills in a contiguous area. The basic algorithm maintains a stack of pixels to check, and for each pixel tested it pushes the neighbours onto the stack.
An optimised version of this algorithm maintains a stack of scanlines rather than pixels to test. This saves a lot of pixel tests over the basic algorithm. The scanline flood fill algorithm works by scanning a line, and adding ranges on the next/previous lines to a stack. For a shape with no loops or thin walls which are filled on both sides the scanline algorithm will only test each pixel once. It achieves this by skipping testing the range of pixels that the current line was filled from.
A rough outline of the algorithm is: