Lecture 15
Lecture 15
Presented By,
Mrs. B.A.Chatterjee
1
UNIT II
Raster Scan Graphics
Computer Engineering 2
Lecture 15
Computer Engineering 3
Company
Boundary Fill Algorithm
LOGO
Advantages of Boundary Fill Algorithm
•Simple
•Easy to implement.
•Works for any type of polygons.
Computer Engineering 4
Company
Boundary Fill Algorithm
LOGO
Disadvantages of Boundary Fill Algorithm
•Does not work if the boundary is specified with multiple colours.
•Need to specify seed point contained within the polygon.
•Uses extensive stacking.
•Require more memory.
•Not suitable for the large polygon.
•Filling the region with 4 and 8 connectivity.
•Filling of polygon depends on types of connectivity employed.
The 4-connected approach does four recursive calls for each of
its four nearest neighbours.
•The 8-connected approach does eight calls. The 4-connected
approach requires less memory but sometimes fails to fill certain
parts of the polygon.
Computer Engineering 5
Company
Flood Fill Algorithm
LOGO
•Many realistic objects have different colored boundary.
Boundary fill algorithm cannot fill the polygon with multicoloured
boundary.
•Flood Fill can fill the polygon with multiple boundary colour.
•The algorithm starts with the interior pixel, fill color and old
color.If the color of the current pixel is the same as old color then
it fills the pixel with fill color and examine its neighbours.
Computer Engineering 6
Company
Flood Fill Algorithm
LOGO
Computer Engineering 7
Company
Advantages of Flood Fill Algorithm
LOGO
•Simple.
•Easy to implement.
Computer Engineering 8
Company
Disadvantages of Flood Fill Algorithm
LOGO
•Slow in nature.
Computer Engineering 9