home *** CD-ROM | disk | FTP | other *** search
/ jppd.dyndns.org / jppd.dyndns.org.tar / jppd.dyndns.org / QUERYPRO / Actualizar / Impressora_PDF / converter.exe / GPLGS / traceimg.ps < prev    next >
Text File  |  2002-06-03  |  2KB  |  43 lines

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