Article View: comp.lang.postscript
Article #5821XDPS Color Use (once more...)
From: Andre Beck
Date: Tue, 22 Dec 1992 19:57
Date: Tue, 22 Dec 1992 19:57
138 lines
7308 bytes
7308 bytes
Hi PostScript(tm)-Gurus,
after some discussions to the Color use
of [X]DPS on colormapped displays (instead of truecolor ones) I came up
with the thought of
red green blue setXrgbactual pop
would do a color cell allocation for me, with red, green, blue beeing
some floats 0..1 and the popped bool indicates if it was successful.
I tried this immediately with dpsexec (a neat client that simply sends
my trash to the server) and was surprised to get a success indicator even
if I used floats 0..1 for the rgb values, or f.i. ints like 200, 2000,
66000 ... i got true.
Does this setXrgbactual thingy do some autoscaling ???
Or is it only defined as { pop pop pop true } on my machine's XDPS
system ? (DEC 5000 Ultrix 4.3)
At the moment methinks the latter is true, because the following code
to display colormapped images still dithers its output:
------------------------ snippel -------------------------------------
%!
%%Creator: ABPSoft fbm2xdps converter
/numcols 64 def
/rgbstr 3 string def
/alloccolorcells {
0 1 numcols 1 sub {
cmap exch get dup dup
2 get 256 div 3 1 roll 1 get 256 div 3 1 roll 0 get 256 div 3 1 roll
setXrgbactual pop
} for
} bind def
/colormap
{[exch{currentfile rgbstr readhexstring pop 3 string copy}repeat]}bind def
numcols colormap
27d800004ab54fb0007788009f6000c738000029d6ef100000946b0008f700ff0000738c
07f80000de210052ad2fd00057a8007f8000a7580000bd420031cecf3000f70800009c63
0010ef007b8400e6190ff000005aa537c8005fa00087780000c53aaf50000039c6d72800
ff000000a45b0018e700837c00ee1117e80000629d3fc0006798008f700000cd32b74800
0041bedf200000ac530020df008b7400f6091fe000006a9547b8006f900097680000d52a
bf4000e7180000b44b0000ff
/cmap exch def
/setXrgbactual where {pop alloccolorcells} if
% image data
/width 32 def
/height 64 def
/srcstr width string def
/dststr width 3 mul string def
width height scale
width height 8 [width 0 0 height neg 0 height]
{ currentfile srcstr readhexstring pop pop
0 1 width 1 sub {
dup srcstr exch get cmap exch get
exch 3 mul
dststr exch 3 2 roll putinterval
} bind for
dststr
} bind
false 3
colorimage
3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f
0909090909090909090909090909090909090909090909090909090909090909
1818181818181818181818181818181818181818181818181818181818181818
2626262626262626262626262626262626262626262626262626262626262626
3333333333333333333333333333333333333333333333333333333333333333
0606060606060606060606060606060606060606060606060606060606060606
1414141414141414141414141414141414141414141414141414141414141414
2222222222222222222222222222222222222222222222222222222222222222
3030303030303030303030303030303030303030303030303030303030303030
0101010101010101010101010101010101010101010101010101010101010101
0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e
1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c
2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a
3737373737373737373737373737373737373737373737373737373737373737
0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b
1919191919191919191919191919191919191919191919191919191919191919
2727272727272727272727272727272727272727272727272727272727272727
3434343434343434343434343434343434343434343434343434343434343434
0808080808080808080808080808080808080808080808080808080808080808
1717171717171717171717171717171717171717171717171717171717171717
2525252525252525252525252525252525252525252525252525252525252525
3232323232323232323232323232323232323232323232323232323232323232
3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e
1313131313131313131313131313131313131313131313131313131313131313
2020202020202020202020202020202020202020202020202020202020202020
2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e
3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b
0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d
1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a
2828282828282828282828282828282828282828282828282828282828282828
3535353535353535353535353535353535353535353535353535353535353535
0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a
0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c
1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b
2929292929292929292929292929292929292929292929292929292929292929
3636363636363636363636363636363636363636363636363636363636363636
0000000000000000000000000000000000000000000000000000000000000000
0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f
1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d
2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b
3838383838383838383838383838383838383838383838383838383838383838
0202020202020202020202020202020202020202020202020202020202020202
1010101010101010101010101010101010101010101010101010101010101010
1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e
2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c
3939393939393939393939393939393939393939393939393939393939393939
0303030303030303030303030303030303030303030303030303030303030303
1111111111111111111111111111111111111111111111111111111111111111
1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f
2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d
3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a
0404040404040404040404040404040404040404040404040404040404040404
1212121212121212121212121212121212121212121212121212121212121212
2121212121212121212121212121212121212121212121212121212121212121
2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f
3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c
0505050505050505050505050505050505050505050505050505050505050505
1515151515151515151515151515151515151515151515151515151515151515
2323232323232323232323232323232323232323232323232323232323232323
3131313131313131313131313131313131313131313131313131313131313131
3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d
0707070707070707070707070707070707070707070707070707070707070707
1616161616161616161616161616161616161616161616161616161616161616
2424242424242424242424242424242424242424242424242424242424242424
----------------------- snuppel --------------------------------
--
,------------------------+---------------------------------------------.
| Andre' Beck (ABPSoft) | TCP/IP-Mail: beck@freia.inf.tu-dresden.de |
| HG R 142 | VMS : hermes::beck |
+------------------------+---------------------------------------------+
| Windows is the best placebo against MS-DOOF headaches ! |
`----------------------------------------------------------------------'
Technical Details
Message-ID:
<AM39QBM@math.fu-berlin.de>Path:
arc1-ca.pugleaf.net!sparky!uunet!math.fu-berlin.de!freia.sax.de!beckShow Full Headers
Complete Article Headers
Newsgroups: comp.lang.postscript Path: arc1-ca.pugleaf.net!sparky!uunet!math.fu-berlin.de!freia.sax.de!beck From: Andre_Beck@irs.inf.tu-dresden.de (Andre Beck) Subject: XDPS Color Use (once more...) Message-ID: <AM39QBM@math.fu-berlin.de> Keywords: XDPS setXrgbactual Sender: beck@freia.sax.de (Andre Beck) Organization: Dept. of Computer Science, TU Dresden, Germany. Date: Tue, 22 Dec 1992 19:57:26 GMT Lines: 139