Flood Fill Algorithm

Hello!

Anybody has a simple algorithm Flood Fill?

Thanks.

The simplest recursive (pseudo code):

void fill( int x, int y )
{
if( pixel[y]->color == fill_color | | pixel[y]->color == boundary_color )
return;
pixel[y]->color = fill_color;
fill( x + 1, y );
fill( x - 1, y );
fill( x, y + 1 );
fill( x, y - 1 );
}

[This message has been edited by glYaro (edited 09-19-2003).]

The filling itself might not be that complicated, but deciding what to fill is. Search google for edge detection algorithms.