Previous Next


                                                   210
          CHAPTER 4                                                                      Graphics



    4.3 Graphics State

          A PDF consumer application maintains an internal data structure called the
          graphics state that holds current graphics control parameters. These parameters
          define the global framework within which the graphics operators execute. For ex-
          ample, the f (fill) operator implicitly uses the current color parameter, and the S
          (stroke) operator additionally uses the current line width parameter from the
          graphics state.

          The graphics state is initialized at the beginning of each page with the values
          specified in Tables 4.2 and 4.3. Table 4.2 lists those graphics state parameters that
          are device-independent and are appropriate to specify in page descriptions. The
          parameters listed in Table 4.3 control details of the rendering (scan conversion)
          process and are device-dependent; a page description that is intended to be de-
          vice-independent should not modify these parameters.

                        TABLE 4.2 Device-independent graphics state parameters
PARAMETER             TYPE               VALUE

CTM                   array              The current transformation matrix, which maps positions from user
                                         coordinates to device coordinates (see Section 4.2, “Coordinate Sys-
                                         tems”). This matrix is modified by each application of the coordi-
                                         nate transformation operator, cm. Initial value: a matrix that
                                         transforms default user coordinates to device coordinates.

clipping path         (internal)         The current clipping path, which defines the boundary against
                                         which all output is to be cropped (see Section 4.4.3, “Clipping Path
                                         Operators”). Initial value: the boundary of the entire imageable
                                         portion of the output page.

color space           name or array      The current color space in which color values are to be interpreted
                                         (see Section 4.5, “Color Spaces”). There are two separate color space
                                         parameters: one for stroking and one for all other painting opera-
                                         tions. Initial value: DeviceGray.

color                 (various)          The current color to be used during painting operations (see Section
                                         4.5, “Color Spaces”). The type and interpretation of this parameter
                                         depend on the current color space; for most color spaces, a color
                                         value consists of one to four numbers. There are two separate color
                                         parameters: one for stroking and one for all other painting opera-
                                         tions. Initial value: black.

Previous Next