Welcome, Guest. Please login or register.

Author Topic: Help needed with a very silly idea...  (Read 8380 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Kronos

  • Resident blue troll
  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 4017
    • Show all replies
    • http://www.SteamDraw.de
Re: Help needed with a very silly idea...
« on: January 27, 2005, 10:22:29 PM »
I cant say that I understood all in here, but that won't stop me from
adding my "mustard" ;)

I would create 2 arrays of "struct blob" (minx,maxx,miny,maxy), both
big enough to hold the maximum amount of blobs I expect per line
(+safety offcoure, lets say struct blob even[20] and odd[20]).

I would now start with line 0, and eachtime I get a hit I fill in
the mins into one odd blob.
I'll then search for the end of the blob in
this line and and add the maxx. Maxy is set to the same as miny.

Then I do the same for line 1 filling in odd blobs.

Now I do check wether blobs in even are connected to blobs in odd, and
change the odd ones to include the even one.

Even blobs that have no partner are fully found and pushed into the
outbuffer.

And now I fill the even blobs with line 2 and so one.

Makes sure at every pixel is only looked at once, and I don't think
the blob-comparing adds much overhead.

1. Make an announcment.
2. Wait a while.
3. Check if it can actually be done.
4. Wait for someone else to do it.
5. Start working on it while giving out hillarious progress-reports.
6. Deny that you have ever announced it
7. Blame someone else