Previous Next


                                        304
CHAPTER 4                                                                  Graphics



Shading Dictionaries

A shading dictionary specifies details of a particular gradient fill, including the
type of shading to be used, the geometry of the area to be shaded, and the geome-
try of the gradient fill. Various shading types are available, depending on the val-
ue of the dictionary’s ShadingType entry:

• Function-based shadings (type 1) define the color of every point in the domain
  using a mathematical function (not necessarily smooth or continuous).
• Axial shadings (type 2) define a color blend along a line between two points,
  optionally extended beyond the boundary points by continuing the boundary
  colors.
• Radial shadings (type 3) define a blend between two circles, optionally ex-
  tended beyond the boundary circles by continuing the boundary colors. This
  type of shading is commonly used to represent three-dimensional spheres and
  cones.
• Free-form Gouraud-shaded triangle meshes (type 4) define a common construct
  used by many three-dimensional applications to represent complex colored
  and shaded shapes. Vertices are specified in free-form geometry.
• Lattice-form Gouraud-shaded triangle meshes (type 5) are based on the same
  geometrical construct as type 4 but with vertices specified as a pseudo-
  rectangular lattice.
• Coons patch meshes (type 6) construct a shading from one or more color
  patches, each bounded by four cubic Bézier curves.
• Tensor-product patch meshes (type 7) are similar to type 6 but with additional
  control points in each patch, affording greater control over color mapping.

Table 4.28 shows the entries that all shading dictionaries share in common;
entries specific to particular shading types are described in the relevant sections
below.

Note: The term target coordinate space, used in many of the following descriptions,
refers to the coordinate space into which a shading is painted. For shadings used
with a type 2 pattern dictionary, this is the pattern coordinate space, discussed in
Section 4.6.1, “General Properties of Patterns.” For shadings used directly with the
sh operator, it is the current user space.

Previous Next