Page 110 - DCAP313_LAB_ON_COMPUTER_GRAPHICS
P. 110
Lab on Computer Graphics
Notes 14. Some 4-connected regions cannot be filled using boundary-fill algorithm such regions are
called ……………..
15. Flood fill algorithm determines the area connected to a given node in a ……………...
6.4 Summary
• A polygon is a closed planar path composed of a finite number of sequential line segments.
• An important issue that arises when filling polygons is that of deciding whether a particular
point is interior or exterior to a polygon.
• The scan line fill algorithm is an ingenious way of filling in irregular polygons this algorithm
begins with a set of points.
• Boundary-fill Algorithm makes use of coherence properties of the boundary of a point
inside the region the algorithm recursively plots the surrounding pixels until the primitive
boundary is reached.
• Flood fill, is an algorithm that determines the area connected to a given node in a multi-
dimensional array.
6.5 Keywords
Array: It is a data structure consisting of a collection of elements (values or variables), each
identified by at least one array index or key.
Data Structure: It is a particular way of storing and organizing data in a computer so that it
can be used efficiently.
Edge: The line between two points is considered to be an edge of the polygon.
Pixel: It is a physical point in a raster image or the smallest, addressable element in a display
device; so it is the smallest, controllable element of a picture represented on the screen.
Polygon: It is traditionally a plane figure that is bounded by a closed path, composed of a finite
sequence of straight line segments.
6.6 Review Questions
1. What is scan line algorithm?
2. How will you generate a polygon?
3. Which algorithms can be used to generate a polygon?
4. Explain the seed fill algorithm.
5. Which are the two conditions are required before setting the pixel?
6. Write down the method of implementing the scan line algorithm.
7. Write a program to implementing the flood fill algorithm.
8. Write a program to implementing the scan line algorithm.
9. What is boundary-fill algorithm? Explain in detail.
10. Write a program to implementing the boundary-fill algorithm.
104 LOVELY PROFESSIONAL UNIVERSITY