Documente Academic
Documente Profesional
Documente Cultură
Fill Algorithm
For each scan line crossing a polygon, this algorithm locates the
intersection points of the scan line with the polygon edges.
These intersection points are then sorted from left to right and
the corresponding positions between each intersection pair are
set to the specified fill color.
The four pixel intersection positions with the polygon
boundaries define two stretches of interior pixels from x=10 to
x=14 and from x=18 to x=24.
The scan line algorithm first finds the largest and smallest y
values of the polygon.
It then starts with the largest y value & works its down,
scanning from left to right.
The important task is to find the intersection points of the scan line
with the polygon boundary.
When intersection points are even, they are sorted from left to right,
paired and pixels between paired points are set to the fill color.
When scan line intersect polygon vertex, a special handling is
required to find the exact intersection points.
To handle such cases, look at the other endpoint of the two line
segments of the polygon which meet at this vertex.
If these points lie on the same(up & down) side of the scan line,
then this point in question counts as an even number of
intersection.
If they lie on opposite sides of the scan line, then the point is
counted as single intersection.
G
F
This is given as
xi+1 = xi 1/m
G
F
TOP
GF GH
EF HI
JI
BOTTOM
Text Generation
Starbust Method
Bitmap Method
Stroke Method
Starbust Method
Starbust Method
3
13
14
23
17
18
6
21
12
22
7
20
19
24
11
16
10
8
15
9
Bitmap Method