Liste des Groupes | Revenir à cl c |
On 16/03/2024 12:33, Malcolm McLean wrote:Now is this David Brown being David Borwn, ot its it actaully ture?
>And here's some code I wrote a while ago. Use that as a pattern. But not sure how well it works. Haven't used it for a long time.Your implementation is a mess, /vastly/ more difficult to prove correct than the OP's original one, and unlikely to be very much faster (it will certainly scale in the same way in both time and memory usage).
>
https://github.com/MalcolmMcLean/binaryimagelibrary/blob/master/drawbinary.c
>
There are a variety of different flood-fill algorithms, with different advantages and disadvantages. Speeds will often depend as much on the way the get/set pixel code works, especially if the flood-fill is on live displayed data rather than in a buffer off-screen. But typically you need to get a /lot/ more advanced (i.e., not your algorithm) to improve on the OP's version by an order of magnitude, so if speed is not essential but understanding that it is correct is important, then it makes more sense to stick to the original recursive version.What are these / lot / more advanced algorithms? Maybe they exist. But don't people deserve some sort of link?
Les messages affichés proviennent d'usenet.