home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / postscri / 6077 < prev    next >
Encoding:
Text File  |  1992-12-22  |  7.0 KB  |  151 lines

  1. Newsgroups: comp.lang.postscript
  2. Path: sparky!uunet!math.fu-berlin.de!freia.sax.de!beck
  3. From: Andre_Beck@irs.inf.tu-dresden.de (Andre Beck)
  4. Subject: XDPS Color Use (once more...) 
  5. Message-ID: <AM39QBM@math.fu-berlin.de>
  6. Keywords: XDPS setXrgbactual
  7. Sender: beck@freia.sax.de (Andre Beck)
  8. Organization: Dept. of Computer Science, TU Dresden, Germany.
  9. Date: Tue, 22 Dec 1992 19:57:26 GMT
  10. Lines: 139
  11.  
  12. Hi PostScript(tm)-Gurus,
  13.  
  14. after some discussions to the Color use
  15. of [X]DPS on colormapped displays (instead of truecolor ones) I came up
  16. with the thought of
  17.  
  18.  red green blue setXrgbactual pop
  19.  
  20. would do a color cell allocation for me, with red, green, blue beeing
  21. some floats 0..1 and the popped bool indicates if it was successful.
  22.  
  23. I tried this immediately with dpsexec (a neat client that simply sends
  24. my trash to the server) and was surprised to get a success indicator even
  25. if I used floats 0..1 for the rgb values, or f.i. ints like 200, 2000,
  26. 66000 ... i got true.
  27.  
  28. Does this setXrgbactual thingy do some autoscaling ???
  29.  
  30. Or is it only defined as { pop pop pop true } on my machine's XDPS
  31. system ? (DEC 5000 Ultrix 4.3)
  32.  
  33. At the moment methinks the latter is true, because the following code
  34. to display colormapped images still dithers its output:
  35.  
  36. ------------------------ snippel -------------------------------------
  37. %!
  38. %%Creator: ABPSoft fbm2xdps converter
  39. /numcols 64 def
  40. /rgbstr 3 string def
  41. /alloccolorcells {
  42.  0 1 numcols 1 sub {
  43.   cmap exch get dup dup
  44.   2 get 256 div 3 1 roll 1 get 256 div 3 1 roll 0 get 256 div 3 1 roll
  45.   setXrgbactual pop
  46.  } for
  47. } bind def
  48. /colormap
  49. {[exch{currentfile rgbstr readhexstring pop 3 string copy}repeat]}bind def
  50. numcols colormap
  51. 27d800004ab54fb0007788009f6000c738000029d6ef100000946b0008f700ff0000738c
  52. 07f80000de210052ad2fd00057a8007f8000a7580000bd420031cecf3000f70800009c63
  53. 0010ef007b8400e6190ff000005aa537c8005fa00087780000c53aaf50000039c6d72800
  54. ff000000a45b0018e700837c00ee1117e80000629d3fc0006798008f700000cd32b74800
  55. 0041bedf200000ac530020df008b7400f6091fe000006a9547b8006f900097680000d52a
  56. bf4000e7180000b44b0000ff
  57. /cmap exch def
  58. /setXrgbactual where {pop alloccolorcells} if
  59. % image data
  60. /width 32 def
  61. /height 64 def
  62. /srcstr width string def
  63. /dststr width 3 mul string def
  64. width height scale
  65. width height 8 [width 0 0 height neg 0 height]
  66. { currentfile srcstr readhexstring pop pop
  67.   0 1 width 1 sub {
  68.    dup srcstr exch get cmap exch get
  69.    exch 3 mul
  70.    dststr exch 3 2 roll putinterval
  71.   } bind for
  72.   dststr
  73. } bind
  74. false 3
  75. colorimage
  76. 3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f
  77. 0909090909090909090909090909090909090909090909090909090909090909
  78. 1818181818181818181818181818181818181818181818181818181818181818
  79. 2626262626262626262626262626262626262626262626262626262626262626
  80. 3333333333333333333333333333333333333333333333333333333333333333
  81. 0606060606060606060606060606060606060606060606060606060606060606
  82. 1414141414141414141414141414141414141414141414141414141414141414
  83. 2222222222222222222222222222222222222222222222222222222222222222
  84. 3030303030303030303030303030303030303030303030303030303030303030
  85. 0101010101010101010101010101010101010101010101010101010101010101
  86. 0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e
  87. 1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c
  88. 2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a
  89. 3737373737373737373737373737373737373737373737373737373737373737
  90. 0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b
  91. 1919191919191919191919191919191919191919191919191919191919191919
  92. 2727272727272727272727272727272727272727272727272727272727272727
  93. 3434343434343434343434343434343434343434343434343434343434343434
  94. 0808080808080808080808080808080808080808080808080808080808080808
  95. 1717171717171717171717171717171717171717171717171717171717171717
  96. 2525252525252525252525252525252525252525252525252525252525252525
  97. 3232323232323232323232323232323232323232323232323232323232323232
  98. 3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e
  99. 1313131313131313131313131313131313131313131313131313131313131313
  100. 2020202020202020202020202020202020202020202020202020202020202020
  101. 2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e
  102. 3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b
  103. 0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d
  104. 1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a
  105. 2828282828282828282828282828282828282828282828282828282828282828
  106. 3535353535353535353535353535353535353535353535353535353535353535
  107. 0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a
  108. 0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c
  109. 1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b
  110. 2929292929292929292929292929292929292929292929292929292929292929
  111. 3636363636363636363636363636363636363636363636363636363636363636
  112. 0000000000000000000000000000000000000000000000000000000000000000
  113. 0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f
  114. 1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d
  115. 2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b
  116. 3838383838383838383838383838383838383838383838383838383838383838
  117. 0202020202020202020202020202020202020202020202020202020202020202
  118. 1010101010101010101010101010101010101010101010101010101010101010
  119. 1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e
  120. 2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c
  121. 3939393939393939393939393939393939393939393939393939393939393939
  122. 0303030303030303030303030303030303030303030303030303030303030303
  123. 1111111111111111111111111111111111111111111111111111111111111111
  124. 1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f
  125. 2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d
  126. 3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a
  127. 0404040404040404040404040404040404040404040404040404040404040404
  128. 1212121212121212121212121212121212121212121212121212121212121212
  129. 2121212121212121212121212121212121212121212121212121212121212121
  130. 2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f
  131. 3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c
  132. 0505050505050505050505050505050505050505050505050505050505050505
  133. 1515151515151515151515151515151515151515151515151515151515151515
  134. 2323232323232323232323232323232323232323232323232323232323232323
  135. 3131313131313131313131313131313131313131313131313131313131313131
  136. 3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d
  137. 0707070707070707070707070707070707070707070707070707070707070707
  138. 1616161616161616161616161616161616161616161616161616161616161616
  139. 2424242424242424242424242424242424242424242424242424242424242424
  140.  
  141. ----------------------- snuppel --------------------------------
  142.  
  143. -- 
  144. ,------------------------+---------------------------------------------.
  145. | Andre' Beck (ABPSoft)  |   TCP/IP-Mail: beck@freia.inf.tu-dresden.de |
  146. | HG R 142               |   VMS        : hermes::beck                 |
  147. +------------------------+---------------------------------------------+
  148. |       Windows is the best placebo against MS-DOOF headaches !        |
  149. `----------------------------------------------------------------------'
  150.  
  151.