home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / t / timwin.zip / TIMWIN2.EXE / pak / FILL.CMD < prev    next >
OS/2 REXX Batch file  |  1992-08-05  |  706b  |  31 lines

  1. ;  fill -  fills holes in objects
  2. ;expects:  binary image in a
  3. ;******************************************
  4. int num
  5. int count = 1
  6. cls
  7. era x
  8. dest p
  9. show p
  10. num = label a           ;separate objects
  11. if num == 0
  12.    print @8 "Something wrong with image!"
  13.    stop
  14. endif
  15. dest q
  16. while count <= num
  17.   mark p count          ;find object
  18.   inv qc                ;invert
  19.   and qc 1              ;put into bitplane 1 (RED)
  20.   bord qc 3             ;put border in bitplane 2 (GREEN)
  21.   lpr4 qc 2 1            ;propagate from outside into object
  22.   comp qc == 1          ;keep non-propagated part (= isolated hole)
  23.   curs a q
  24.   or ac qc              ;OR with original
  25.   count += 1
  26. endw
  27. stop
  28.  
  29.  
  30. 
  31.