home *** CD-ROM | disk | FTP | other *** search
/ Acorn User 10 / AU_CD10.iso / Updates / GhostScript / !GhostScr / 6_01 / lib / traceimg.ps < prev    next >
Text File  |  2000-03-09  |  2KB  |  45 lines

  1. %    Copyright (C) 1994 Aladdin Enterprises.  All rights reserved.
  2. % This file is part of Aladdin Ghostscript.
  3. % Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author
  4. % or distributor accepts any responsibility for the consequences of using it,
  5. % or for whether it serves any particular purpose or works at all, unless he
  6. % or she says so in writing.  Refer to the Aladdin Ghostscript Free Public
  7. % License (the "License") for full details.
  8. % Every copy of Aladdin Ghostscript must include a copy of the License,
  9. % normally in a plain ASCII text file named PUBLIC.  The License grants you
  10. % the right to copy, modify and redistribute Aladdin Ghostscript, but only
  11. % under certain conditions described in the License.  Among other things, the
  12. % License requires that the copyright notice and this notice be preserved on
  13. % all copies.
  14.  
  15. % $Id: traceimg.ps,v 1.1 2000/03/09 08:40:40 lpd Exp $
  16. % traceimg.ps
  17. % Trace the data supplied to the 'image' operator.
  18.  
  19. % This code currently handles only the (Level 2) dictionary form of image,
  20. % with a single data source and 8-bit pixels.
  21.  
  22. /traceimage            % <dict> traceimage -
  23.  { currentcolorspace == (setcolorspace\n) print
  24.    (<<) print
  25.    dup { (\t) print exch ==only ( ) print == } forall
  26.    (>>\n) print flush
  27.    begin /i_left Width Height mul store /i_dict currentdict store end
  28.     { i_left 0 le { exit } if
  29.       i_dict /DataSource get exec
  30.       dup type /filetype eq
  31.        { i_buf 0 i_left 32 min getinterval readstring pop
  32.        } if
  33.       dup (%stdout) (w) file exch writehexstring (\n) print flush
  34.       i_left exch length sub /i_left exch def
  35.     } loop
  36.  } bind odef
  37.  
  38. /image /traceimage load def
  39. /i_left 0 def
  40. /i_dict null def
  41. /i_buf 32 string def
  42.