postgif.ps 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. %
  2. % Version 3.3.2 prologue for GIF pixmap files.
  3. %
  4. /#copies 1 store
  5. /aspectratio 1 def
  6. /formsperpage 1 def
  7. /landscape false def
  8. /magnification 1 def
  9. /margin 0 def
  10. /orientation 0 def
  11. /rotation 1 def
  12. /xoffset 0 def
  13. /yoffset 0 def
  14. /useclippath true def
  15. /pagebbox [0 0 612 792] def
  16. /inch {72 mul} bind def
  17. /min {2 copy gt {exch} if pop} bind def
  18. /setup {
  19. counttomark 2 idiv {def} repeat pop
  20. landscape {/orientation 90 orientation add def} if
  21. pagedimensions
  22. xcenter ycenter translate
  23. orientation rotation mul rotate
  24. xoffset inch yoffset inch translate
  25. magnification dup aspectratio mul scale
  26. /height height margin sub def
  27. /width width margin sub def
  28. } def
  29. /pagedimensions {
  30. useclippath {
  31. /pagebbox [clippath pathbbox newpath] def
  32. } if
  33. pagebbox aload pop
  34. 4 -1 roll exch 4 1 roll 4 copy
  35. landscape {4 2 roll} if
  36. sub /width exch def
  37. sub /height exch def
  38. add 2 div /xcenter exch def
  39. add 2 div /ycenter exch def
  40. userdict /gotpagebbox true put
  41. } def
  42. /pagesetup {/page exch def} bind def
  43. /done {/lastpage where {pop lastpage} if} def
  44. /alignment false def
  45. /gifscreen { % scrwidth scrheight $
  46. 2 copy
  47. alignment {
  48. 100 dup dtransform exch 100 exch div abs exch 100 exch div abs
  49. 2 copy scale
  50. /height exch height exch div def
  51. /width exch width exch div def
  52. } if
  53. height exch div exch width exch div
  54. 2 copy lt { pop } { exch pop } ifelse
  55. alignment { cvi } if
  56. dup scale
  57. neg 2 div exch neg 2 div exch translate
  58. } def
  59. /gifimage { % gray imagewidth imageheight xorigin yorigin $
  60. translate
  61. 2 copy scale
  62. /imageheight exch def
  63. /imagewidth exch def
  64. /gray exch def
  65. imagewidth imageheight 8 [imagewidth 0 0 imageheight neg 0 imageheight]
  66. gray {
  67. { currentfile codestr readhexstring pop } image
  68. } {
  69. /colorimage where {
  70. pop
  71. /picstr imagewidth 3 mul string def
  72. { currentfile codestr readhexstring pop pop
  73. 0 1 imagewidth 1 sub {
  74. picstr exch dup 3 mul exch colortbl exch codestr exch get
  75. 3 mul 3 getinterval putinterval
  76. } for picstr
  77. } false 3 colorimage
  78. } {
  79. { currentfile codestr readhexstring pop pop
  80. 0 1 imagewidth 1 sub {
  81. codestr exch dup graytbl exch codestr exch get get put
  82. } for codestr
  83. } image
  84. } ifelse
  85. } ifelse
  86. } def