Tizen 2.0 Release
[framework/graphics/cairo.git] / util / cairo-script / examples / interference.cs
1 /rot { 3 -1 roll } def
2 /2dup { 2 copy } def
3
4 /circle { % context radius -- context
5         2dup 0 m pop
6         0 0 rot 0 math.2pi arc h
7 } def
8
9 /circles { % context #circles -- context
10         1 1 rot { circle } for
11 } def
12
13 /SIDE 600. def
14 /SIZE 600. def
15 << /width SIZE /height SIZE >> surface context
16 1 1 1 set-source-rgb paint
17 0 0 0 set-source-rgb
18 //EVEN_ODD set-fill-rule
19
20 /r 4 def
21 /n SIDE 1.5 mul r div integer def
22
23 SIZE SIDE div dup scale
24
25 save
26   302 200 translate
27   r dup scale
28   n circles
29 restore
30
31 save
32   100 300 translate
33   r dup scale
34   n circles
35 restore
36
37 save
38   500 400 translate
39   r dup scale
40   n circles
41 restore
42
43 fill
44
45 /target get (out.png) write-to-png pop
46 pop