.BG
.VE $Header: /usr3/s/current/s/.help/RCS/flood,v 1.2 83/12/30 19:28:25 rab Exp $
.FN flood
.TL
flood: Flood Areas with Color using Seed Fill
.CS
flood(x, y, col, bdy, erase)
.PP
.AG x,y
coordinates of "seed" points within (not on the boundary of) the areas to be flooded.
A structure containing components `x' and `y' may also be given.
.AG col
color numbers to be used to flood the areas.
If `col' is shorter than `x' and `y', values will be taken cyclically
from `col'.
.AG bdy
optional vector giving the colors of lines which bound the region.
If `bdy' is given,
the `i'th region is assumed to be bordered with color `bdy[i]'.
If `bdy' is shorter than `x' and `y', values will be taken cyclically
from `bdy'.
.AG erase
should alpha overlay be erased prior to filling?
Default is TRUE with the `aed512' device driver, since
if the alpha overlay is not erased, alpha characters that overlap
the flooded areas may be mistaken for boundaries of the areas.
.SH COMMENTS
Flooding begins at the specified point and spreads outward
until stopped by a boundary.
If `bdy' is not given, any color different from the color
of the initial point is treated as a boundary.
If there is no boundary between the specified point
and the edge of the screen, the  background area of the
screen will be flooded.
.PP
It is difficult to fully flood an area
that is very narrow, e.g., a thin wedge of a pie chart.
This is because numerous "islands" may be created by the
discretization of the lines into pixels.
.SH WARNING
This function is experimental and applies only to the aed512 and ram6211
color scopes;
`flood' may be superseded by a more general
function at a later date.
.EX
usa(fifty=T); flood(state.center,1:50)
   # note Michigan's upper peninsula not filled
   # AK and HI drawn as boxes

flood(rdpen( ),10)   # fill pointed-to areas with color 10

hatch(x,y,space=0)  # draw polygon outline
flood(mean(x),mean(y),7)   # fill with color 7
.KW plot*
.KW aplot*
.WR
