/usr/share/ghostscript/lib
NameSizeModeActions
acctest.ps42690644editdlrm
align.ps21560644editdlrm
bj8.rpd6390644editdlrm
bj8gc12f.upp15320644editdlrm
bj8hg12f.upp15310644editdlrm
bj8oh06n.upp15170644editdlrm
bj8pa06n.upp15250644editdlrm
bj8pp12f.upp15420644editdlrm
bj8ts06n.upp15300644editdlrm
bjc610a0.upp15270644editdlrm
bjc610a1.upp15160644editdlrm
bjc610a2.upp15170644editdlrm
bjc610a3.upp15220644editdlrm
bjc610a4.upp15300644editdlrm
bjc610a5.upp15170644editdlrm
bjc610a6.upp15170644editdlrm
bjc610a7.upp15200644editdlrm
bjc610a8.upp15260644editdlrm
bjc610b1.upp15160644editdlrm
bjc610b2.upp15170644editdlrm
bjc610b3.upp15220644editdlrm
bjc610b4.upp15300644editdlrm
bjc610b6.upp15170644editdlrm
bjc610b7.upp15210644editdlrm
bjc610b8.upp15260644editdlrm
bjc6000a1.upp16600644editdlrm
bjc6000b1.upp16600644editdlrm
caption.ps17590644editdlrm
cbjc600.ppd111480644editdlrm
cbjc800.ppd114910644editdlrm
cdj550.upp16900644editdlrm
cdj690.upp19990644editdlrm
cdj690ec.upp20600644editdlrm
cid2code.ps44910644editdlrm
dnj750c.upp28080644editdlrm
dnj750m.upp19750644editdlrm
docie.ps74980644editdlrm
font2pcl.ps184390644editdlrm
ghostpdf.ppd256430644editdlrm
gslp.ps207280644editdlrm
gsnup.ps26340644editdlrm
gs_ce_e.ps22190644editdlrm
gs_css_e.ps49220644editdlrm
gs_il2_e.ps26310644editdlrm
gs_kanji.ps40070644editdlrm
gs_ksb_e.ps31450644editdlrm
gs_l.xbm19450644editdlrm
gs_l.xpm27510644editdlrm
gs_lgo_e.ps27340644editdlrm
gs_lgx_e.ps17660644editdlrm
gs_l_m.xbm19550644editdlrm
gs_m.xbm9450644editdlrm
gs_m.xpm14370644editdlrm
gs_m_m.xbm9550644editdlrm
gs_s.xbm5940644editdlrm
gs_s.xpm9570644editdlrm
gs_s_m.xbm6040644editdlrm
gs_t.xbm3450644editdlrm
gs_t.xpm6050644editdlrm
gs_t_m.xbm3550644editdlrm
gs_wl1_e.ps24950644editdlrm
gs_wl2_e.ps24940644editdlrm
gs_wl5_e.ps25120644editdlrm
ht_ccsto.ps2281430644editdlrm
image-qa.ps730500644editdlrm
jispaper.ps7840644editdlrm
landscap.ps14680644editdlrm
lines.ps37360644editdlrm
mkcidfm.ps223210644editdlrm
necp2x.upp10450644editdlrm
necp2x6.upp10690644editdlrm
pdf2dsc.ps80630644editdlrm
PDFA_def.ps25820644editdlrm
PDFX_def.ps38640644editdlrm
pdf_info.ps151520644editdlrm
pf2afm.ps152950644editdlrm
pfbtopfa.ps9960644editdlrm
PM760p.upp11600644editdlrm
PM760pl.upp11240644editdlrm
PM820p.upp11420644editdlrm
PM820pl.upp11170644editdlrm
ppath.ps18190644editdlrm
pphs.ps68440644editdlrm
prfont.ps72130644editdlrm
printafm.ps48980644editdlrm
ps2ai.ps223060644editdlrm
ps2epsi.ps60700644editdlrm
ras1.upp2150644editdlrm
ras3.upp2140644editdlrm
ras4.upp2200644editdlrm
ras8m.upp2090644editdlrm
ras24.upp2190644editdlrm
ras32.upp1960644editdlrm
rollconv.ps125260644editdlrm
s400a1.upp14540644editdlrm
s400b1.upp16030644editdlrm
sharp.upp19360644editdlrm
sipixa6.upp5290644editdlrm
st640ih.upp22810644editdlrm
st640ihg.upp15080644editdlrm
st640p.upp19140644editdlrm
st640pg.upp11410644editdlrm
st640pl.upp18780644editdlrm
st640plg.upp11050644editdlrm
stc.upp19230644editdlrm
stc2.upp19040644editdlrm
stc2s_h.upp22720644editdlrm
stc2_h.upp18790644editdlrm
stc200_h.upp18480644editdlrm
stc300.upp21360644editdlrm
stc300bl.upp13410644editdlrm
stc300bm.upp14300644editdlrm
stc500p.upp19030644editdlrm
stc500ph.upp19030644editdlrm
stc600ih.upp22810644editdlrm
stc600p.upp11510644editdlrm
stc600pl.upp11150644editdlrm
stc640p.upp10950644editdlrm
Stc670p.upp11590644editdlrm
Stc670pl.upp11240644editdlrm
Stc680p.upp11400644editdlrm
Stc680pl.upp11150644editdlrm
stc740ih.upp21230644editdlrm
Stc740p.upp10390644editdlrm
Stc740pl.upp11150644editdlrm
Stc760p.upp11410644editdlrm
Stc760pl.upp11150644editdlrm
Stc777p.upp11400644editdlrm
Stc777pl.upp11150644editdlrm
stc800ih.upp21580644editdlrm
stc800p.upp11150644editdlrm
stc800pl.upp10970644editdlrm
stc1520h.upp21540644editdlrm
stcany.upp6730644editdlrm
stcany_h.upp6810644editdlrm
stcinfo.ps255170644editdlrm
stcolor.ps50650644editdlrm
stc_h.upp19130644editdlrm
stc_l.upp7340644editdlrm
stocht.ps24940644editdlrm
Stp720p.upp11580644editdlrm
Stp720pl.upp11150644editdlrm
Stp870p.upp11400644editdlrm
Stp870pl.upp11150644editdlrm
traceimg.ps13820644editdlrm
traceop.ps25720644editdlrm
uninfo.ps59860644editdlrm
viewcmyk.ps19840644editdlrm
viewgif.ps53950644editdlrm
viewjpeg.ps56910644editdlrm
viewmiff.ps42530644editdlrm
viewpbm.ps102820644editdlrm
viewpcx.ps52320644editdlrm
viewps2a.ps11360644editdlrm
winmaps.ps36050644editdlrm
zeroline.ps23170644editdlrm
Edit: /usr/share/ghostscript/lib/viewpbm.ps (10282B)
% Copyright (C) 2001-2021 Artifex Software, Inc. % 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. % % Refer to licensing information at http://www.artifex.com or contact % Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato, % CA 94945, U.S.A., +1(415)492-9861, for further information. % % viewpbm.ps % Display a PBM/PGM/PPM file. % Requires the Level 2 `image' operator (to handle variable pixel widths). % If SCALE is defined, maps input pixels to output pixels with that scale; % if SCALE is undefined, scales the image to fit the page. % If FITPAGE true, it fits the output page size to the image, honouring SCALE % When the input is PAM (P7) RGBTAG from bitrgbtags device, -dTAG will show % the tags is pseudo color: % TEXT=1, IMAGE=2, PATH=4, UNTOUCHED=8 % red green blue gray /s 100 string def /readmaxv { % readmaxv - 10 string readline pop cvx exec /maxv exch def } bind def /readrow { % readrow 0 1 2 index length 1 sub { 1 index exch 3 index token pop put } for exch pop } bind def /read01 { % read01 0 exch { 1 index read pop 48 xor dup 1 le { exch dup add add } { pop } ifelse } repeat } bind def /readrow01 { % readrow01 0 1 w 8 idiv { 1 index exch 3 index 8 read01 put } for wrem 0 ne { dup rsize 1 sub wrem read01 8 wrem sub bitshift put } if exch pop } bind def /readwh { % readwh dup s readline pop % check for comment (#) anchorsearch { pop pop dup s readline pop } if cvx exec } bind def /pbmtypes mark % The procedures in this dictionary are called as % Pn /P1 { % ASCII 1-bit white/black /bpc 1 def /maxv 1 def /rsize w 7 add 8 idiv def /wrem w 8 mod def /ncomp 1 def /invert true def /DeviceGray setcolorspace readwh { readrow01 } } bind /P2 { % ASCII 8-bit gray readwh /bpc 8 def 2 index readmaxv /rsize 2 index def /ncomp 1 def /invert false def /DeviceGray setcolorspace { readrow } } bind /P3 { % ASCII 8-bit RGB readwh /bpc 8 def 2 index readmaxv /rsize 2 index 3 mul def /ncomp 3 def /invert false def /DeviceRGB setcolorspace { readrow } } bind /P4 { % Binary 1-bit white/black readwh /bpc 1 def /maxv 1 def /rsize 2 index 7 add 8 idiv def /ncomp 1 def /invert true def /DeviceGray setcolorspace { readstring pop } } bind /P5 { % Binary 8-bit gray readwh /bpc 8 def 2 index readmaxv /rsize 2 index def /ncomp 1 def /invert false def /DeviceGray setcolorspace { readstring pop } } bind /P6 { % Binary 8-bit RGB readwh /bpc 8 def 2 index readmaxv /rsize 2 index 3 mul def /ncomp 3 def /invert false def /DeviceRGB setcolorspace { readstring pop } } bind /P7 { % Assume Binary 8-bit CMYK -- assumes 'pf' is the input file % P7 % WIDTH 612 %% used to set rsize and w % HEIGHT 792 %% used to set h % DEPTH 4 %% if present and not 1 or 4, then bail % MAXVAL 255 %% used to set maxv % TUPLTYPE CMYK | RGB_TAG | RGB_ALPHA | GRAYSCALE %% if present and not one of these, then bail % ENDHDR %% skip everything else up to this /P7KEYS << /WIDTH { /w pf token pop def } /HEIGHT { /h pf token pop def } /DEPTH { /d pf token pop def d 4 eq d 1 eq or not { (*** Only DEPTH 1 or 4 PAM files supported at this time. ***) = quit } if } /MAXVAL { /maxv pf token pop def } /TUPLTYPE { pf token pop dup /CMYK eq 1 index /RGB_TAG eq or 1 index /RGB_ALPHA eq or 1 index /GRAYSCALE eq or not { (*** Only CMYK, RGB_TAG, RGB_ALPHA and GRAYSCALE files supported at this time. ***) = quit } if /T exch def } /ENDHDR { exit } (#) cvn { pf 255 string readline pop pop } >> def { pf token not { exit } if P7KEYS exch .knownget { exec } if } loop /bpc 8 def /rsize w 4 mul def % same bytes per line for CMYK or RGB_TAG /T load /CMYK eq { /ncomp 4 def /invert false def /DeviceCMYK setcolorspace w h { readstring pop } } if /T load /RGB_ALPHA eq { /ncomp 4 def /invert false def /DeviceCMYK setcolorspace w h { readstring pop } } if /T load /GRAYSCALE eq { /ncomp 1 def /invert false def /DeviceGray setcolorspace w h { readstring pop } } if /T load /RGB_TAG eq { % not CMYK, must be RGB_TAG since was checked above /TAG where { pop % show the tags as pseudo-color image /ncomp 1 def /invert false def /maxv 1 def [ /Indexed /DeviceRGB 255 % UNTOUCHED=0, TEXT=1, IMAGE=2, PATH=4 % gray red green blue 768 string dup 0 putinterval ] setcolorspace w h { readstring pop % discard all but the tag dup length 4 div cvi string % destination string 0 1 2 index length 1 sub { 2 index 1 index 4 mul get 2 index exch 2 index exch put pop % done with pixel# } for exch pop } } { % show the image as RGB (ignore tags) /ncomp 3 def /invert false def /DeviceRGB setcolorspace w h { readstring pop % re-pack the RGB, discard the tag dup length 4 div 3 mul cvi string % destination string 0 1 2 index length 3 idiv 1 sub { % stack: RGBTstring destRGBstring pixel# 2 index 1 index 4 mul 4 getinterval 1 3 getinterval % RGB values % stack RGBTstring destRGBstring pixel# RGBstring 2 index exch 2 index 3 mul exch putinterval pop % done with pixel# } for exch pop } } ifelse } if } bind .dicttomark readonly def /pbmsetup { % pbmsetup /readproc exch def /h exch def /w exch def /f exch def 20 dict begin % image dictionary /ImageType 1 def /Width w def /Height h def /ImageMatrix [w 0 0 h neg 0 h] def /BitsPerComponent bpc def /Decode [ 0 255 maxv div invert { exch } if ncomp 1 sub { 2 copy } repeat ] def /DataSource [ f rsize string /readproc load /exec load ] cvx def currentdict end } def /imagescale { % imagescale - begin /SCALE where { pop /FITPAGE where {/FITPAGE get}{false} ifelse { Width SCALE mul Height SCALE mul } { % Map pixels SCALE-for-1. Assume orthogonal transformation. Width 1 0 dtransform add abs div SCALE mul Height 0 1 dtransform add abs div SCALE mul } ifelse } { /FITPAGE where {/FITPAGE get}{false} ifelse { % Scale the image (uniformly) to fit the page. clippath pathbbox pop pop translate % offset to the printable origin pathbbox 3 -1 roll sub exch 3 -1 roll sub exch % stack printable_width printable_height 2 copy gt 3 1 roll .min exch % stack: min(printable_w, printable_h) landscape? { % printable height is less than width (landscape) dup Height Width gt { Width mul Height div exch } { Height mul Width div } ifelse } { % printable width is less than height (portrait) dup Height Width lt { Width mul Height div exch } { Height mul Width div } ifelse } ifelse } { 0 0 translate 612 792 } ifelse } ifelse scale end } def % Image a PBM file page by page. /viewpbm { % viewpbm - 20 dict begin (r) file /pf exch def { pf token not { exit } if pbmtypes exch get pf exch exec pbmsetup currentcolorspace % preserve colorspace around setpagedevice /FITPAGE where { /FITPAGE get { /SCALE where { pop << /PageSize [ 1 1 dtransform h SCALE mul exch abs div exch w SCALE mul exch abs div exch ] >> } { << /PageSize [ 1 1 dtransform h exch abs div exch w exch abs div exch ] >> } ifelse setpagedevice } if } if setcolorspace % restore colorspave in case we did setpagedevice dup imagescale image showpage } loop end } def % Reassemble a composite PBM file from the CMYK separations. /viewpsm { 20 dict begin /fname exch def /sources [ 0 1 3 { /plane exch def /pf fname (r) file def pf pbmtypes pf token pop get exec % Stack: pf w h readproc plane { /readproc exch def /h exch def /w exch def pop /row rsize string def h { pf row readproc pop } repeat pf pbmtypes pf token pop get exec } repeat pbmsetup } for ] def /datas [ sources { /DataSource get 0 get } forall ] def /decode sources 0 get /Decode get dup 0 get exch 1 get add cvi 0 exch 2 copy 4 copy 8 array astore def sources 0 get dup /MultipleDataSources true put dup /DataSource datas put dup /Decode decode put /DeviceCMYK setcolorspace /FITPAGE where { /FITPAGE get { /SCALE where { <> } { <> }ifelse setpagedevice } if } if dup imagescale image showpage end } def % If the program was invoked from the command line, run it now. [ .shellarguments { counttomark 1 ge { ] { viewpbm } forall } { cleartomark (Usage: gs [-dSCALE=#.#] [-dFITPAGE] [--] viewpbm.ps filename.p*m ...\n) print ( e.g.: gs [-dSCALE=#.#] [-dFITPAGE] [--] viewpbm.ps my.ppm another.ppm\n) print flush ( also -dTAG option can be used to show the pseudo-color tag image from a\n) print flush ( P7 RGB_TAG PAM file created by the bitrgbtags device.\n) print flush } ifelse } { pop } ifelse