Graphics Reference
In-Depth Information
increases the resolution of the display device is a special case of the latter. Mathe-
matically, the two methods are
(1) prefiltering, and
(2) supersampling or postfiltering
Prefiltering.
This amounts to treating each sample point as representing a finite
area rather than simply a dot. Because lines often fall between pixels, this would avoid
concentrating everything at a pixel in a hit-or-miss fashion. Mathematically, the
process corresponds to applying a convolutional filter before sampling. One must
make sure that the highest frequency of a signal in a scene does not exceed one-half
the sampling rate.
Two widely used models for computing the area subtended by a pixel are
(1) One considers the image a square grid as in Figure 2.13 with the pixels in the
centers of the squares.
(2) One computes the area using a weighting function similar to a Gaussian func-
tion. This in fact models the effect of the electron beam of a CRT and print-
ing processes more closely. The pixels are larger and overlap. Details near the
center now count more heavily than those near the edge.
Model (1) is easier than (2), but (2) produces better pictures. Internal details, such as
highlights, are harder to handle.
In the case of boundaries of polygons we can use shading to suggest the position
of the edges and can make the picture look as if it had higher resolution than it in
fact has. Therefore, associate to each pixel an intensity proportional to the percent-
age of its area that is covered by the polygon. For example, if the intensity values
ranged from 0 to 15, then we might assign pixel
A
in Figure 2.13 a value of 2 and
pixel
B
, a value of 8. This approach could obviously substantially increase the amount
of computation one has to do. However, by using an efficient approximation of
the area that is needed, it turns out that all it takes is a slight modification to the
Bresenham algorithm to get an efficient implementation of it, namely, the Pitteway-
Watkinson algorithm. See [PitW80] or [Roge98].
Another approach for drawing antialiased lines treats the lines as having a thick-
ness. An algorithm of this type is the Gupta-Sproull algorithm. See [GupS81],
[Thom90], or [FVFH90]. It also starts with the standard Bresenham algorithm and
then adds some checks for nearby pixels above and below each pixel that would be
drawn by that algorithm.
Figure 2.13.
Pixel intensities based on percentage of
area covered.