2 |
- |
1 |
% Copyright (C) 1994 Aladdin Enterprises. All rights reserved.
|
|
|
2 |
%
|
|
|
3 |
% This software is provided AS-IS with no warranty, either express or
|
|
|
4 |
% implied.
|
|
|
5 |
%
|
|
|
6 |
% This software is distributed under license and may not be copied,
|
|
|
7 |
% modified or distributed except as expressly authorized under the terms
|
|
|
8 |
% of the license contained in the file LICENSE in this distribution.
|
|
|
9 |
%
|
|
|
10 |
% For more information about licensing, please refer to
|
|
|
11 |
% http://www.ghostscript.com/licensing/. For information on
|
|
|
12 |
% commercial licensing, go to http://www.artifex.com/licensing/ or
|
|
|
13 |
% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
|
|
|
14 |
% San Rafael, CA 94903, U.S.A., +1(415)492-9861.
|
|
|
15 |
|
|
|
16 |
% $Id: traceimg.ps,v 1.5 2002/06/02 12:03:28 mpsuzuki Exp $
|
|
|
17 |
% traceimg.ps
|
|
|
18 |
% Trace the data supplied to the 'image' operator.
|
|
|
19 |
|
|
|
20 |
% This code currently handles only the (Level 2) dictionary form of image,
|
|
|
21 |
% with a single data source and 8-bit pixels.
|
|
|
22 |
|
|
|
23 |
/traceimage % <dict> traceimage -
|
|
|
24 |
{ currentcolorspace == (setcolorspace\n) print
|
|
|
25 |
(<<) print
|
|
|
26 |
dup { (\t) print exch ==only ( ) print == } forall
|
|
|
27 |
(>>\n) print flush
|
|
|
28 |
begin /i_left Width Height mul store /i_dict currentdict store end
|
|
|
29 |
{ i_left 0 le { exit } if
|
|
|
30 |
i_dict /DataSource get exec
|
|
|
31 |
dup type /filetype eq
|
|
|
32 |
{ i_buf 0 i_left 32 .min getinterval readstring pop
|
|
|
33 |
} if
|
|
|
34 |
dup (%stdout) (w) file exch writehexstring (\n) print flush
|
|
|
35 |
i_left exch length sub /i_left exch def
|
|
|
36 |
} loop
|
|
|
37 |
} bind odef
|
|
|
38 |
|
|
|
39 |
/image /traceimage load def
|
|
|
40 |
/i_left 0 def
|
|
|
41 |
/i_dict null def
|
|
|
42 |
/i_buf 32 string def
|