From Wikipedia, the free encyclopedia
Recursive Flood Fill
This image shows the running recursive flood fill algorithm with eight directions.
- Creator André Karwath aka Aka
- Date 2005-12-27
This animation has been generated using the following Perl function:
...
sub FloodFill8
{
my ($x, $y) = @_;
if ($im->getPixel ($x, $y) == $colfill)
{
$im->setPixel ($x, $y, $colpen);
WriteImage ();
FloodFill8 ($x, $y+1);
FloodFill8 ($x, $y-1);
FloodFill8 ($x+1, $y);
FloodFill8 ($x-1, $y);
FloodFill8 ($x+1, $y+1);
FloodFill8 ($x+1, $y-1);
FloodFill8 ($x-1, $y+1);
FloodFill8 ($x-1, $y-1);
}
}
...
File links
The following pages on the English Wikipedia link to this file (pages on other projects are not listed):