Appendix C Drawing Algorithms - Hitachi HD64411 Q2 User Manual

Quick 2d graphics renderer
Table of Contents

Advertisement

Appendix C Drawing Algorithms

Straight Line Drawing Algorithms
• 8-point drawing and 4-point drawing
Figures C-1 (a) and (b) show examples of straight lines plotted on a bit-mapped display.
Circles in the figures represent pixels. Due to the characteristics of a bit-mapped display, a
straight line is drawn with the pixels arranged in a path differing slightly from an actual
straight line. The same line is drawn in figures C-1 (a) and (b), but the algorithms are different,
and so the pixel arrangements are also different. In both figures the line starts at the bottom left
of the figure and is drawn dot by dot toward the top right corner. With the method shown in
figure C-1 (a), the next dot drawn is to the right, or diagonally to the upper right, of the current
dot. With the method shown in figure C-1 (b), on the other hand, the next dot drawn is to the
right of, or directly above, the current dot.
For the sake of convenience, the method in figure C-1 (a) is here called 8-point drawing, and
that in figure C-1 (b), 4-point drawing.
The difference between 8-point and 4-point drawing is illustrated in figure C-2. With 4-point
drawing, the move to draw the next dot can be made in one of only four directions, up, down,
left, or right (figure C-2 (b)). With 8-point drawing, moves can also be made in the four
diagonal directions (figure C-2 (a)).
(a)
Figure C-1
Two Representations of a Straight Line on a Raster Display
218
(b)

Advertisement

Table of Contents
loading

Table of Contents