Previous Next


                                                       344
CHAPTER 4                                                                                     Graphics



   stream
   9LhZI9h\GY9i+bb;,p:e;G9SP92/)X9MJ>^:f14d;,U(X8P;cO;G9e];c$=k9Mn\]
   … Image data representing 65,536 samples …
   8P;cO;G9e];c$=k9Mn\]~>
   endstream
   endobj

   23 0 obj                                                    % Contents of page
       << /Length 56 >>
   stream
       q                                                       % Save graphics state
         132 0 0 132 45 140 cm                                 % Translate to (45,140) and scale by 132
         /Im1 Do                                               % Paint image
       Q                                                       % Restore graphics state
   endstream
   endobj


Decode Arrays

An image’s data stream is initially decomposed into integers in the domain 0 to
2n − 1, where n is the value of the image dictionary’s BitsPerComponent entry.
The image’s Decode array specifies a linear mapping of each integer component
value to a number that would be appropriate as a component value in the image’s
color space.

Each pair of numbers in a Decode array specifies the lower and upper values to
which the domain of sample values in the image is mapped. A Decode array con-
tains one pair of numbers for each component in the color space specified by the
image’s ColorSpace entry. The mapping for each color component is a linear
transformation; that is, it uses the following formula for linear interpolation:
y = Interpolate ( x , x min , x max , y min , y max )

            ⎛                 y max – y min ⎞
  = y min + ⎜ ( x – x min ) × ---------------------------- ⎟
            ⎝                 x max – x min ⎠

Generally, this formula is used to convert a value x between xmin and xmax to a
corresponding value y between ymin and ymax , projecting along the line defined
by the points (xmin , ymin ) and (xmax , ymax ). While this formula applies to values
outside the domain xmin to xmax and does not require that xmin < xmax , note that
interpolation used for color conversion, such as the Decode array, does require

Previous Next