Previous Next


                                          294
CHAPTER 4                                                                      Graphics



in the tiling is based on the location of one key pattern cell, which is then dis-
placed by multiples of XStep and YStep to replicate the pattern. The origin of the
key pattern cell coincides with the origin of the pattern coordinate system. The
phase of the tiling can be controlled by the translation components of the Matrix
entry in the pattern dictionary.

The first step in painting with a tiling pattern is to establish the pattern as the cur-
rent color in the graphics state. Subsequent painting operations tile the painted
areas with the pattern cell described by the pattern’s content stream. To obtain the
pattern cell, the application performs these steps:

1. Saves the current graphics state (as if by invoking the q operator)
2. Installs the graphics state that was in effect at the beginning of the pattern’s
   parent content stream, with the current transformation matrix altered by the
   pattern matrix as described in Section 4.6.1, “General Properties of Patterns”
3. Paints the graphics objects specified in the pattern’s content stream
4. Restores the saved graphics state (as if by invoking the Q operator)

Note: The pattern’s content stream should not set any of the device-dependent
parameters in the graphics state (see Table 4.3 on page 212) because it may result in
incorrect output.


Colored Tiling Patterns

A colored tiling pattern is a pattern whose color is self-contained. In the course of
painting the pattern cell, the pattern’s content stream explicitly sets the color of
each graphical element it paints. A single pattern cell can contain elements that
are painted different colors; it can also contain sampled grayscale or color images.
This type of pattern is identified by a pattern type of 1 and a paint type of 1 in the
pattern dictionary.

When the current color space is a Pattern space, a colored tiling pattern can be
selected as the current color by supplying its name as the single operand to the
SCN or scn operator. This name must be the key of an entry in the Pattern subdic-
tionary of the current resource dictionary (see Section 3.7.2, “Resource Diction-
aries”), whose value is the stream object representing the pattern. Since the

Previous Next