Consider the following statements with respect to approaches to fill

2019

Consider the following statements with respect to approaches to fill area on raster systems:

𝑃: To determine the overlap intervals for scan lines that cross the area

𝑄: To start from a given interior position and pain outward from this point until we encounter the specified boundary conditions.

Select the correct answer from the options given below:

  1. A.

    𝑃 only

  2. B.

    𝑄 only

  3. C.

    Both 𝑃 and 𝑄

  4. D.

    Neither 𝑃 nor 𝑄

Attempted by 60 students.

Show answer & explanation

Correct answer: C

Answer: Both statements are correct β€” both approaches are used to fill areas on raster systems.

  • Scan-line fill (determine overlap intervals for scan lines):

    For each horizontal scan line, compute intersections with the region boundary, sort the intersection x-coordinates, pair them, and fill the pixel spans between each pair.

    Advantages: efficient for polygons with long horizontal spans and requires fewer per-pixel boundary checks.

  • Flood-fill (start from an interior point and paint outward):

    Begin at a known interior pixel and iteratively (using a stack or queue) expand to neighboring pixels (4- or 8-connected) until boundary pixels stop further expansion.

    Advantages: simple to implement and works for arbitrary shapes; disadvantages: can be memory- or recursion-intensive for large regions.

Conclusion: Both the scan-line interval method and the flood-fill method are valid approaches for filling areas on raster displays, so the correct choice is the one that states both are true.

Explore the full course: Dsssb Tgt Computer Science Paper 2