;fill  --  fills holes in objects
;syntax: /fill [#b]
;expects - binary image in specified bitplane #b (default: 1)
;          of active image
;Comment: Operation takes place in active image.
;         Seed bitplane (SB) is 1 lower than obj. bitplane (OB),
;         except when OB == 1: then SB = 2
;
parms
int obj_plane = 1
endparms
int seed_plane 

seed_plane = obj_plane - 1
if seed_plane == 0
  seed_plane = 2
endif

keep obj_plane
binv obj_plane
bbord seed_plane 1
lpr4 seed_plane obj_plane
binv seed_plane
bit seed_plane
stop
