Filled-Area Primitives
Filled-Area Primitives
Filled-Area Primitives
A standard output primitive in general graphics packages is a solid-color or patterned polygon area. There are two basic approaches to area filling on raster systems:
1.
The scan-line approach Determine the overlap intervals for scan lines that cross the area. is typically used in general graphics packages to fill polygons, circles, ellipses
2.
Filling approaches start from a given interior position and paint outward from this point until we encounter the specified boundary conditions. useful with more complex boundaries and in interactive painting systems.
Fill-Area algorithms are used to fill the interior of a polygonal shape. Many algorithms perform fill operations by first identifying the interior points, given the polygon boundary.
4-connected pixels
tests neighboring pixels to determine whether they are of the boundary color. If not, they are painted with the fill color, and their neighbors are tested. This process continues until all pixels up to the boundary have been tested.
1.
There are two methods for proceeding to neighboring pixels from the current test position, The 4-connected method.
2.
TCS2111
We start from a specified interior point (x, y) and reassign all pixel values that are currently set to a given interior color with the desired fill color.
11
If the area we want to paint has more than one interior color, we can first reassign pixel values so that all interior points have the same color. Using either a 4-connected or 8connected approach, we then step through pixel positions until all interior points have been repainted.
12
TCS2111
13