SECTION 6.5
511
Scan Conversion Details
Note:
Normally, the intersection of two regions is defined as the intersection of their
interiors. However, for purposes of scan conversion, a filling region is considered to
intersect every pixel through which its boundary passes, even if the interior of the
filling region is empty. Thus, for example, a zero-width or zero-height rectangle
paints a line 1 pixel wide.
The region of device space to be painted by a sampled image is determined simi-
larly to that of a filled shape, though not identically. The application transforms
the image’s source rectangle into device space and defines a half-open region, just
as for fill operations. However, only those pixels whose
centers
lie within the re-
gion are painted. The position of the center of such a pixel—in other words, the
point whose coordinate values have fractional parts of one-half—is mapped back
into source space to determine how to color the pixel. There is no averaging over
the pixel area; if the resolution of the source image is higher than that of device
space, some source samples are not used.
For clipping, the clipping region consists of the set of pixels that would be in-
cluded by a fill operation. Subsequent painting operations affect a region that is
the intersection of the set of pixels defined by the clipping region with the set of
pixels for the region to be painted.
Scan conversion of character glyphs is performed by a different algorithm from
the one above. That font rendering algorithm uses hints in the glyph descriptions
and techniques that are specialized to glyph rasterization.
6.5.4 Automatic Stroke Adjustment
When a stroke is drawn along a path, the scan conversion algorithm may produce
lines of nonuniform thickness because of rasterization effects. In general, the line
width and the coordinates of the endpoints, transformed into device space, are
arbitrary real numbers not quantized to device pixels. A line of a given width can
intersect with different numbers of device pixels, depending on where it is posi-
tioned. Figure 6.7 illustrates this effect.
For best results, it is important to compensate for the rasterization effects to pro-
duce strokes of uniform thickness. This is especially important in low-resolution
display applications. To meet this need, PDF 1.2 provides an optional
automatic
stroke adjustment
feature. When stroke adjustment is enabled, the line width and
the coordinates of a stroke are automatically adjusted as necessary to produce