diff options
Diffstat (limited to 'Master/tlpkg/tlgs/lib/viewpcx.ps')
-rw-r--r-- | Master/tlpkg/tlgs/lib/viewpcx.ps | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/Master/tlpkg/tlgs/lib/viewpcx.ps b/Master/tlpkg/tlgs/lib/viewpcx.ps index cab82d213b4..17d180f5b8a 100644 --- a/Master/tlpkg/tlgs/lib/viewpcx.ps +++ b/Master/tlpkg/tlgs/lib/viewpcx.ps @@ -1,19 +1,19 @@ % Copyright (C) 1996, 1999 Aladdin Enterprises. All rights reserved. -% +% % This software is provided AS-IS with no warranty, either express or % implied. -% +% % This software is distributed under license and may not be copied, % modified or distributed except as expressly authorized under the terms % of the license contained in the file LICENSE in this distribution. -% +% % For more information about licensing, please refer to % http://www.ghostscript.com/licensing/. For information on % commercial licensing, go to http://www.artifex.com/licensing/ or % contact Artifex Software, Inc., 101 Lucas Valley Road #110, % San Rafael, CA 94903, U.S.A., +1(415)492-9861. -% $Id: viewpcx.ps 6300 2005-12-28 19:56:24Z giles $ +% $Id$ % viewpcx.ps % Display a PCX file. % Requires the Level 2 `image' operator (to handle variable pixel widths). @@ -51,7 +51,7 @@ { 100 dict begin /fname 1 index def /f exch (r) file def - % Read and unpack the header. + % Read and unpack the header. /header f 128 string readstring pop def /version header 1 get def /bpp header 3 get def @@ -64,32 +64,32 @@ version 5 eq { nbits 8 le { /cspace - [/Indexed /DeviceRGB 1 bpp bitshift 1 sub - f fileposition - 1 nbits bitshift 3 mul string - fname status pop pop pop exch pop - 1 index length sub f exch setfileposition - f exch readstring pop - exch f exch setfileposition - ] def - /decode [0 cspace 2 get] def + [/Indexed /DeviceRGB 1 bpp bitshift 1 sub + f fileposition + 1 nbits bitshift 3 mul string + fname status pop pop pop exch pop + 1 index length sub f exch setfileposition + f exch readstring pop + exch f exch setfileposition + ] def + /decode [0 cspace 2 get] def } { /cspace /DeviceRGB def - /decode [0 1 0 1 0 1] def + /decode [0 1 0 1 0 1] def } ifelse } { /cspace - [/Indexed /DeviceRGB 1 bpp bitshift 1 sub - header 16 1 nbits bitshift 16 .min 3 mul getinterval - ] def + [/Indexed /DeviceRGB 1 bpp bitshift 1 sub + header 16 1 nbits bitshift 16 .min 3 mul getinterval + ] def /decode [0 cspace 2 get] def } ifelse - % Set up scaling. + % Set up scaling. /SCALE where { pop - % Map pixels SCALE-for-1. Assume orthogonal transformation. + % Map pixels SCALE-for-1. Assume orthogonal transformation. w 1 0 dtransform add abs div SCALE mul h 0 1 dtransform add abs div SCALE mul } @@ -99,10 +99,10 @@ dup h w gt { w mul h div exch } { h mul w div } ifelse } ifelse scale - % Since the number of bytes per line is always even, - % it may not match the width specification. + % Since the number of bytes per line is always even, + % it may not match the width specification. /wbpl w bpp mul 7 add 8 idiv def - % Define the data source procedure. + % Define the data source procedure. /s1 bpl wbpl sub string def /df /readpcx load copyarray dup 0 f put cvx bind readonly 0 () /SubFileDecode filter def @@ -112,7 +112,7 @@ cvx bind readonly } repeat ] def - % Construct the image dictionary. + % Construct the image dictionary. 20 dict begin % image dictionary /ImageType 1 def /Width w def @@ -125,7 +125,7 @@ { 0 get } ifelse def currentdict end - % Finally, display the image. + % Finally, display the image. cspace setcolorspace image showpage |