1 % Copyright (C) 1994 Aladdin Enterprises. All rights reserved.
3 % This software is provided AS-IS with no warranty, either express or
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.
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.
16 % $Id: traceimg.ps,v 1.5 2002/06/02 12:03:28 mpsuzuki Exp $
18 % Trace the data supplied to the 'image' operator.
20 % This code currently handles only the (Level 2) dictionary form of image,
21 % with a single data source and 8-bit pixels.
23 /traceimage % <dict> traceimage -
24 { currentcolorspace == (setcolorspace\n) print
26 dup { (\t) print exch ==only ( ) print == } forall
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
32 { i_buf 0 i_left 32 .min getinterval readstring pop
34 dup (%stdout) (w) file exch writehexstring (\n) print flush
35 i_left exch length sub /i_left exch def
39 /image /traceimage load def