annotate toolboxes/graph_visualisation/lib/lefty/lefty.psp @ 0:cc4b1211e677 tip

initial commit to HG from Changeset: 646 (e263d8a21543) added further path and more save "camirversion.m"
author Daniel Wolff
date Fri, 19 Aug 2016 13:07:06 +0200
parents
children
rev   line source
Daniel@0 1 /BOX {
Daniel@0 2 /boxy1 exch def /boxx1 exch def /boxy0 exch def /boxx0 exch def
Daniel@0 3 boxx0 boxy0 moveto boxx1 boxy0 lineto
Daniel@0 4 boxx1 boxy1 lineto boxx0 boxy1 lineto
Daniel@0 5 closepath
Daniel@0 6 } def
Daniel@0 7 /SCP { stroke initclip newpath BOX clip newpath } def
Daniel@0 8 /CL { stroke setrgbcolor } def
Daniel@0 9 /DO { stroke } def
Daniel@0 10 /NP { newpath } def
Daniel@0 11 /FI { fill } def
Daniel@0 12 /LI { moveto lineto } def
Daniel@0 13 /CT { curveto } def
Daniel@0 14 /AR {
Daniel@0 15 /ang2 exch def /ang1 exch def
Daniel@0 16 /radius exch def /y2x exch def /cy exch def /cx exch def
Daniel@0 17 gsave
Daniel@0 18 cx cy translate 1 y2x scale 0 0 radius ang1 ang2 arc stroke
Daniel@0 19 grestore
Daniel@0 20 } def
Daniel@0 21 /ARF {
Daniel@0 22 /ang2 exch def /ang1 exch def
Daniel@0 23 /radius exch def /y2x exch def /cy exch def /cx exch def
Daniel@0 24 gsave
Daniel@0 25 cx cy translate 1 y2x scale 0 0 radius ang1 ang2 arc fill
Daniel@0 26 grestore
Daniel@0 27 } def
Daniel@0 28 /TXT {
Daniel@0 29 /texth exch def
Daniel@0 30 /textf exch def
Daniel@0 31 /textn exch def
Daniel@0 32 /texts exch def
Daniel@0 33 /textyj exch def /texty exch def
Daniel@0 34 /textxj exch def /textx exch def
Daniel@0 35 textf findfont texth scalefont dup setfont
Daniel@0 36 /FontBBox get 1 get 1000 div texth mul /textbl exch def
Daniel@0 37 /textth texth textn mul def /texttw 0 def
Daniel@0 38 0 1 textn 1 sub {
Daniel@0 39 texts exch get 0 get stringwidth pop
Daniel@0 40 dup texttw gt { /texttw exch def } { pop } ifelse
Daniel@0 41 } for
Daniel@0 42 textyj (b) eq { /ty texty textth add textbl add def } if
Daniel@0 43 textyj (d) eq { /ty texty textth add def } if
Daniel@0 44 textyj (c) eq { /ty texty textth 2 div add def } if
Daniel@0 45 textyj (u) eq { /ty texty def } if
Daniel@0 46 /ty ty textbl sub def
Daniel@0 47 textxj (l) eq { /tx textx def } if
Daniel@0 48 textxj (c) eq { /tx textx texttw 2 div sub def } if
Daniel@0 49 textxj (r) eq { /tx textx texttw sub def } if
Daniel@0 50 0 1 textn 1 sub {
Daniel@0 51 /ty ty texth sub def
Daniel@0 52 texts exch get dup 0 get /ts exch def 1 get /tj exch def
Daniel@0 53 tj (l) eq { tx ty moveto ts show } if
Daniel@0 54 tj (n) eq {
Daniel@0 55 tx texttw ts stringwidth pop sub 2 div add ty moveto ts show
Daniel@0 56 } if
Daniel@0 57 tj (r) eq {
Daniel@0 58 tx texttw ts stringwidth pop sub add ty moveto ts show
Daniel@0 59 } if
Daniel@0 60 } for
Daniel@0 61 } def
Daniel@0 62
Daniel@0 63 /colorimage where {
Daniel@0 64 pop
Daniel@0 65 } {
Daniel@0 66 /bwproc {
Daniel@0 67 rgbproc dup length 3 idiv string 0 3 0 5 -1 roll {
Daniel@0 68 add 2 1 roll 1 sub dup 0 eq {
Daniel@0 69 pop 3 idiv 3 -1 roll dup 4 -1 roll
Daniel@0 70 dup 3 1 roll 5 -1 roll put 1 add 3 0
Daniel@0 71 } {
Daniel@0 72 2 1 roll
Daniel@0 73 } ifelse
Daniel@0 74 } forall
Daniel@0 75 pop pop pop
Daniel@0 76 } def
Daniel@0 77 /colorimage {
Daniel@0 78 pop pop /rgbproc exch def {bwproc} image
Daniel@0 79 } bind def
Daniel@0 80 } ifelse