You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.3 KiB

1 month ago
  1. % Copyright (C) 2001-2023 Artifex Software, Inc.
  2. % All Rights Reserved.
  3. %
  4. % This software is provided AS-IS with no warranty, either express or
  5. % implied.
  6. %
  7. % This software is distributed under license and may not be copied,
  8. % modified or distributed except as expressly authorized under the terms
  9. % of the license contained in the file LICENSE in this distribution.
  10. %
  11. % Refer to licensing information at http://www.artifex.com or contact
  12. % Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
  13. % CA 94129, USA, for further information.
  14. %
  15. % traceimg.ps
  16. % Trace the data supplied to the 'image' operator.
  17. % This code currently handles only the (Level 2) dictionary form of image,
  18. % with a single data source and 8-bit pixels.
  19. /traceimage % <dict> traceimage -
  20. { currentcolorspace == (setcolorspace\n) print
  21. (<<) print
  22. dup { (\t) print exch ==only ( ) print == } forall
  23. (>>\n) print flush
  24. begin /i_left Width Height mul store /i_dict currentdict store end
  25. { i_left 0 le { exit } if
  26. i_dict /DataSource get exec
  27. dup type /filetype eq
  28. { i_buf 0 i_left 32 .min getinterval readstring pop
  29. } if
  30. dup (%stdout) (w) file exch writehexstring (\n) print flush
  31. i_left exch length sub /i_left exch def
  32. } loop
  33. } bind odef
  34. /image /traceimage load def
  35. /i_left 0 def
  36. /i_dict null def
  37. /i_buf 32 string def