home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2002 February / INTERNET88.ISO / pc / software / windows / bits / pdf995 / data1.cab / Program_Executable_Files / res / traceimg.ps < prev    next >
Encoding:
Text File  |  2001-12-08  |  1.8 KB  |  46 lines

  1. %    Copyright (C) 1994 Aladdin Enterprises.  All rights reserved.
  2. % This file is part of GNU Ghostscript.
  3. % GNU Ghostscript is distributed in the hope that it will be useful, but
  4. % WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  5. % to anyone for the consequences of using it or for whether it serves any
  6. % particular purpose or works at all, unless he says so in writing.  Refer
  7. % to the GNU General Public License for full details.
  8. % Everyone is granted permission to copy, modify and redistribute GNU
  9. % Ghostscript, but only under the conditions described in the GNU General
  10. % Public License.  A copy of this license is supposed to have been given
  11. % to you along with GNU Ghostscript so you can know your rights and
  12. % responsibilities.  It should be in a file named COPYING.  Among other
  13. % things, the copyright notice and this notice must be preserved on all
  14. % copies.
  15.  
  16. % $RCSfile: traceimg.ps,v $ $Revision: 1.2.2.1 $
  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
  43.