home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / graphics / 14303 < prev    next >
Encoding:
Text File  |  1993-01-28  |  2.2 KB  |  44 lines

  1. Newsgroups: comp.graphics
  2. Path: sparky!uunet!ferkel.ucsb.edu!taco!gatech!swrinde!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!math.fu-berlin.de!news.netmbx.de!Germany.EU.net!mcsun!sunic!aun.uninett.no!nuug!nntp.uio.no!eivind
  3. From: eivind@kih.no (eivind hagen)
  4. Subject: Re: "fill" algorithm
  5. Message-ID: <1993Jan28.103741.20104@ulrik.uio.no>
  6. Sender: news@ulrik.uio.no (Mr News)
  7. Nntp-Posting-Host: samson.kih.no
  8. Organization: Kongsberg Ingeniorhogskole
  9. X-Newsreader: TIN [version 1.1 PL8]
  10. References: <lmdeluINNs7o@exodus.Eng.Sun.COM>
  11. Date: Thu, 28 Jan 1993 10:37:41 GMT
  12. Lines: 30
  13.  
  14. Scott R. Nelson (srnelson@speedsail.Eng.Sun.COM) wrote:
  15. > I tried that once and even with 100 megabytes of virtual memory it
  16. > ran out of stack space after filling less than 500,000 pixels on the
  17. > background of a complex scene.  The system also went through a major
  18. > thrashing period before the program died.  That doesn't fit my
  19. > definition of "foolproof".
  20.  
  21. Well, if U got a proper OS it's foolproof :-)
  22.  
  23. > A very simple change would be to pick a pixel, then fill horizontally
  24. > in both directions as far as possible.  Once done, go check all of the
  25. > pixels above and below that filled region.  This uses much less stack
  26. > space and is also faster.  There are certainly more speed optimizations
  27. > that could be made to avoid redundant tests if you like to experiment.
  28.  
  29. I know, and this is what I normally do: Also, a nice thing is to save all
  30. the x1,x2,y positions while filling, and after you are done, you have a list of the entire area. Then, use this for easy pattern filling etc. You also know the min/max of the area, so auto-scaling images for filling etc.
  31. BTW: Any other smart algorithms anyone? This line-scanning is the fastest I've
  32. found so far...
  33.  
  34. > You might also want to consider checking the 8 adjacent pixels rather
  35. > than 4, if you want it to go through diagonal holes.
  36.  
  37. Hmm. This is not normal is it? Beides, MORE STACK is needed :-)))
  38.  
  39. --
  40. I--------------------------------------I-------------------------------------I
  41. I Eivind Hagen (eivind@samson.kih.no)  I  "I've got the POWER"               I
  42. I Zynx of Arc Empire                   I  (ARM 3 + cx486slc / 8 MB RAM)      I
  43. I--------------------------------------I-------------------------------------I
  44.