File: screen.ps

package info (click to toggle)
gs 3.33-7
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 7,436 kB
  • ctags: 15,511
  • sloc: ansic: 92,150; asm: 684; sh: 486; makefile: 91
file content (58 lines) | stat: -rw-r--r-- 1,028 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
% Test a tilted halftone screen.

/dot0
	% The following screen algorithm is used by permission of the author.
    { 1 add 180 mul cos 1 0.08 add mul exch 2 add 180 mul cos 
      1 0.08 sub mul add 2 div % (C) 1989 Berthold K.P. Horn
    } bind def

/dot1
 { dup mul exch dup mul add 1 exch sub
 } bind def

/dot2
 { exch abs exch abs   2 copy le { exch } if
   exch 1 sub dup mul exch dup mul add 1 exch sub
 } bind def

72 72 scale
0 setlinewidth

/tiles {
0 1 7
 { /y exch def
   0 1 7
    { /x exch def
      x y moveto
      1 0 rlineto 0 1 rlineto -1 0 rlineto closepath
      gsave y 8 mul x add 63 div setgray fill grestore
      0 setgray stroke
    } for
  } for
} bind def

gsave
2.3 -22 /dot0 load setscreen
currentscreen pop == pop
tiles showpage
grestore

gsave
2.3 22 /dot1 load setscreen
currentscreen pop == pop
tiles showpage
grestore

gsave
2.3 45 /dot1 load setscreen
currentscreen pop == pop
tiles showpage
grestore

gsave
2.3 45 /dot2 load setscreen
currentscreen pop == pop
tiles showpage
grestore

quit