Re: flood fills



On 18 Dec 2002, Calum Benson wrote:

[snip]

I don't know how the Amiga did it either, but the general algorithm for
flood-filling any arbitrary enclosed shape starting from some interior
point (x,y) is actually pretty easy:

[snip]

Yes, that seems to work quite well!  Thanks!  Complications arose when I
tried it because I'm using Gtk 1.2 and so must call gdk_image_get to get a
single pixel image at the test point every time, then free the image.
That causes some speed penalties.

Obviously the downside is that it's highly recursive, so if you're
filling big areas you don't want to be running on a machine that's low
on memory...

Yes, the actual pixel-by-pixel drawing is relatively slow if you're
filling a large area (especially if it's the entire drawing area [ugh!]),
but for smaller areas it's quite satisfactory, at least on my Linux box (a
Dell Precision 330 with 256Mb of memory).

OK, I guess that pretty much raps it up.

Now to clean out the debugging statements and prepare for a beta release.

Many thanks,

Bryan


*---------------------------------------------------------------
* Bryan Brown      <*>              bbrown radix net
* http://www.radix.net/~bbrown
*---------------------------------------------------------------




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]