Previous Next


                                               318
CHAPTER 4                                                                                 Graphics




    va           vc             ve        vg                        vh va            vc
                                                          vh = va
             1          3            5                                        1
                 2     vd       4    vf   6                           6       vb     2
         vb                                          vh    vg                               vd
          vm            vk
                 11             9         7                           5              3
   vm = vb
                       10            8                                        4

                 vl             vj        vi                          vf             ve
                      vk = vd

                       Mesh 1                                               Mesh 2


         FIGURE 4.18 Varying the value of the edge flag to create different shapes


The data for each vertex consists of the following items, reading in sequence from
higher-order to lower-order bit positions:

• An edge flag, expressed in BitsPerFlag bits
• A pair of horizontal and vertical coordinates, expressed in BitsPerCoordinate
  bits each
• A set of n color components (where n is the number of components in the
  shading’s color space), expressed in BitsPerComponent bits each, in the order
  expected by the sc operator

Each set of vertex data must occupy a whole number of bytes. If the total number
of bits required is not divisible by 8, the last data byte for each vertex is padded at
the end with extra bits, which are ignored. The coordinates and color values are
decoded according to the Decode array in the same way as in an image dictionary
(see “Decode Arrays” on page 344).

If the shading dictionary contains a Function entry, the color data for each vertex
must be specified by a single parametric value t rather than by n separate color
components. All linear interpolation within the triangle mesh is done using the t
values. After interpolation, the results are passed to the function(s) specified in
the Function entry to determine the color at each point.

Previous Next