Advertisement
kaiserh

PostScript or EPS?

May 23rd, 2017
3,364
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. %!PS-Adobe-3.0
  2. %%Creator: (ImageMagick)
  3. %%Title: (intermediate1.ps)
  4. %%CreationDate: (2017-05-23T08:11:50+10:00)
  5. %%BoundingBox: -0 -0 697 1129
  6. %%HiResBoundingBox: 0 0 697.08 1129
  7. %%DocumentData: Clean7Bit
  8. %%LanguageLevel: 1
  9. %%Orientation: Portrait
  10. %%PageOrder: Ascend
  11. %%Pages: 1
  12. %%EndComments
  13.  
  14. %%BeginDefaults
  15. %%EndDefaults
  16.  
  17. %%BeginProlog
  18. %
  19. % Display a color image.  The image is displayed in color on
  20. % Postscript viewers or printers that support color, otherwise
  21. % it is displayed as grayscale.
  22. %
  23. /DirectClassPacket
  24. {
  25.   %
  26.   % Get a DirectClass packet.
  27.   %
  28.   % Parameters:
  29.   %   red.
  30.   %   green.
  31.   %   blue.
  32.   %   length: number of pixels minus one of this color (optional).
  33.   %
  34.   currentfile color_packet readhexstring pop pop
  35.   compression 0 eq
  36.   {
  37.     /number_pixels 3 def
  38.   }
  39.   {
  40.     currentfile byte readhexstring pop 0 get
  41.     /number_pixels exch 1 add 3 mul def
  42.   } ifelse
  43.   0 3 number_pixels 1 sub
  44.   {
  45.     pixels exch color_packet putinterval
  46.   } for
  47.   pixels 0 number_pixels getinterval
  48. } bind def
  49.  
  50. /DirectClassImage
  51. {
  52.   %
  53.   % Display a DirectClass image.
  54.   %
  55.   systemdict /colorimage known
  56.   {
  57.     columns rows 8
  58.     [
  59.       columns 0 0
  60.       rows neg 0 rows
  61.     ]
  62.     { DirectClassPacket } false 3 colorimage
  63.   }
  64.   {
  65.     %
  66.     % No colorimage operator;  convert to grayscale.
  67.     %
  68.     columns rows 8
  69.     [
  70.       columns 0 0
  71.       rows neg 0 rows
  72.     ]
  73.     { GrayDirectClassPacket } image
  74.   } ifelse
  75. } bind def
  76.  
  77. /GrayDirectClassPacket
  78. {
  79.   %
  80.   % Get a DirectClass packet;  convert to grayscale.
  81.   %
  82.   % Parameters:
  83.   %   red
  84.   %   green
  85.   %   blue
  86.   %   length: number of pixels minus one of this color (optional).
  87.   %
  88.   currentfile color_packet readhexstring pop pop
  89.   color_packet 0 get 0.299 mul
  90.   color_packet 1 get 0.587 mul add
  91.   color_packet 2 get 0.114 mul add
  92.   cvi
  93.   /gray_packet exch def
  94.   compression 0 eq
  95.   {
  96.     /number_pixels 1 def
  97.   }
  98.   {
  99.     currentfile byte readhexstring pop 0 get
  100.     /number_pixels exch 1 add def
  101.   } ifelse
  102.   0 1 number_pixels 1 sub
  103.   {
  104.     pixels exch gray_packet put
  105.   } for
  106.   pixels 0 number_pixels getinterval
  107. } bind def
  108.  
  109. /GrayPseudoClassPacket
  110. {
  111.   %
  112.   % Get a PseudoClass packet;  convert to grayscale.
  113.   %
  114.   % Parameters:
  115.   %   index: index into the colormap.
  116.   %   length: number of pixels minus one of this color (optional).
  117.   %
  118.   currentfile byte readhexstring pop 0 get
  119.   /offset exch 3 mul def
  120.   /color_packet colormap offset 3 getinterval def
  121.   color_packet 0 get 0.299 mul
  122.   color_packet 1 get 0.587 mul add
  123.   color_packet 2 get 0.114 mul add
  124.   cvi
  125.   /gray_packet exch def
  126.   compression 0 eq
  127.   {
  128.     /number_pixels 1 def
  129.   }
  130.   {
  131.     currentfile byte readhexstring pop 0 get
  132.     /number_pixels exch 1 add def
  133.   } ifelse
  134.   0 1 number_pixels 1 sub
  135.   {
  136.     pixels exch gray_packet put
  137.   } for
  138.   pixels 0 number_pixels getinterval
  139. } bind def
  140.  
  141. /PseudoClassPacket
  142. {
  143.   %
  144.   % Get a PseudoClass packet.
  145.   %
  146.   % Parameters:
  147.   %   index: index into the colormap.
  148.   %   length: number of pixels minus one of this color (optional).
  149.   %
  150.   currentfile byte readhexstring pop 0 get
  151.   /offset exch 3 mul def
  152.   /color_packet colormap offset 3 getinterval def
  153.   compression 0 eq
  154.   {
  155.     /number_pixels 3 def
  156.   }
  157.   {
  158.     currentfile byte readhexstring pop 0 get
  159.     /number_pixels exch 1 add 3 mul def
  160.   } ifelse
  161.   0 3 number_pixels 1 sub
  162.   {
  163.     pixels exch color_packet putinterval
  164.   } for
  165.   pixels 0 number_pixels getinterval
  166. } bind def
  167.  
  168. /PseudoClassImage
  169. {
  170.   %
  171.   % Display a PseudoClass image.
  172.   %
  173.   % Parameters:
  174.   %   class: 0-PseudoClass or 1-Grayscale.
  175.   %
  176.   currentfile buffer readline pop
  177.   token pop /class exch def pop
  178.   class 0 gt
  179.   {
  180.     currentfile buffer readline pop
  181.     token pop /depth exch def pop
  182.     /grays columns 8 add depth sub depth mul 8 idiv string def
  183.     columns rows depth
  184.     [
  185.       columns 0 0
  186.       rows neg 0 rows
  187.     ]
  188.     { currentfile grays readhexstring pop } image
  189.   }
  190.   {
  191.     %
  192.     % Parameters:
  193.     %   colors: number of colors in the colormap.
  194.     %   colormap: red, green, blue color packets.
  195.     %
  196.     currentfile buffer readline pop
  197.     token pop /colors exch def pop
  198.     /colors colors 3 mul def
  199.     /colormap colors string def
  200.     currentfile colormap readhexstring pop pop
  201.     systemdict /colorimage known
  202.     {
  203.       columns rows 8
  204.       [
  205.         columns 0 0
  206.         rows neg 0 rows
  207.       ]
  208.       { PseudoClassPacket } false 3 colorimage
  209.     }
  210.     {
  211.       %
  212.       % No colorimage operator;  convert to grayscale.
  213.       %
  214.       columns rows 8
  215.       [
  216.         columns 0 0
  217.         rows neg 0 rows
  218.       ]
  219.       { GrayPseudoClassPacket } image
  220.     } ifelse
  221.   } ifelse
  222. } bind def
  223.  
  224. /DisplayImage
  225. {
  226.   %
  227.   % Display a DirectClass or PseudoClass image.
  228.   %
  229.   % Parameters:
  230.   %   x & y translation.
  231.   %   x & y scale.
  232.   %   label pointsize.
  233.   %   image label.
  234.   %   image columns & rows.
  235.   %   class: 0-DirectClass or 1-PseudoClass.
  236.   %   compression: 0-none or 1-RunlengthEncoded.
  237.   %   hex color packets.
  238.   %
  239.   gsave
  240.   /buffer 512 string def
  241.   /byte 1 string def
  242.   /color_packet 3 string def
  243.   /pixels 768 string def
  244.  
  245.   currentfile buffer readline pop
  246.   token pop /x exch def
  247.   token pop /y exch def pop
  248.   x y translate
  249.   currentfile buffer readline pop
  250.   token pop /x exch def
  251.   token pop /y exch def pop
  252.   currentfile buffer readline pop
  253.   token pop /pointsize exch def pop
  254.   x y scale
  255.   currentfile buffer readline pop
  256.   token pop /columns exch def
  257.   token pop /rows exch def pop
  258.   currentfile buffer readline pop
  259.   token pop /class exch def pop
  260.   currentfile buffer readline pop
  261.   token pop /compression exch def pop
  262.   class 0 gt { PseudoClassImage } { DirectClassImage } ifelse
  263.   grestore
  264.   showpage
  265. } bind def
  266. %%EndProlog
  267. %%Page:  1 1
  268. %%PageBoundingBox: 0 0 697 1129
  269. DisplayImage
  270. 0 0
  271. 697.08 1128.96
  272. 12
  273. 5809 9408
  274. 0
  275. 0
  276. F6F3F0F6F4F1F9F5F2FBF7F5FBF7F5FBF8F5FAF8F4FAF8F4FBF7F4FAF7F4FAF6F3FAF6F3F9F6F3
  277.  
  278. [[Snip -- more than 300 MB of image data -- snip]]
  279.  
  280. EDE7E1EEE8E2EEE9E3ECE7E3EDE8E2EBE6E1EBE6E2EEE9E3
  281.  
  282. %%PageTrailer
  283. %%Trailer
  284. %%EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement