Previous Next
263
SECTION 4.5 Color Spaces
The base parameter is an array or name that identifies the base color space in
which the values in the color table are to be interpreted. It can be any device or
CIE-based color space or (in PDF 1.3) a Separation or DeviceN space, but not a
Pattern space or another Indexed space. For example, if the base color space is
DeviceRGB, the values in the color table are to be interpreted as red, green, and
blue components; if the base color space is a CIE-based ABC space such as a
CalRGB or Lab space, the values are to be interpreted as A, B, and C components.
Note: Attempting to use a Separation or DeviceN color space as the base for an
Indexed color space generates an error in PDF 1.2.
The hival parameter is an integer that specifies the maximum valid index value. In
other words, the color table is to be indexed by integers in the range 0 to hival.
hival can be no greater than 255, which is the integer required to index a table
with 8-bit index values.
The color table is defined by the lookup parameter, which can be either a stream
or (in PDF 1.2) a byte string. It provides the mapping between index values and
the corresponding colors in the base color space.
The color table data must be m × (hival + 1) bytes long, where m is the number of
color components in the base color space. Each byte is an unsigned integer in the
range 0 to 255 that is scaled to the range of the corresponding color component in
the base color space; that is, 0 corresponds to the minimum value in the range for
that component, and 255 corresponds to the maximum.
Note: PostScript uses a different interpretation of an Indexed color space’s color ta-
ble. In PostScript, the component value is always scaled to the range 0.0 to 1.0, re-
gardless of the range of color values in the base color space.
The color components for each entry in the table appear consecutively in the
string or stream. For example, if the base color space is DeviceRGB and the
indexed color space contains two colors, the order of bytes in the string or stream
is R0 G0 B0 R1 G1 B1 , where letters denote the color component and numeric
subscripts denote the table entry.
Example 4.10 illustrates the specification of an Indexed color space that maps
8-bit index values to three-component color values in the DeviceRGB color space.
Previous Next