diff options
author | sanine <sanine.not@pm.me> | 2022-10-12 12:03:23 -0500 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2022-10-12 12:03:23 -0500 |
commit | 530ffd0b7d3c39757b20f00716e486b5caf89aff (patch) | |
tree | 76b35fdf57317038acf6b828871f6ae25fce2ebe /libs/cairo-1.16.0/util/cairo-script/examples/interference.cs | |
parent | 3dbe9332e47c143a237db12440f134caebd1cfbe (diff) |
add cairo
Diffstat (limited to 'libs/cairo-1.16.0/util/cairo-script/examples/interference.cs')
-rw-r--r-- | libs/cairo-1.16.0/util/cairo-script/examples/interference.cs | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/libs/cairo-1.16.0/util/cairo-script/examples/interference.cs b/libs/cairo-1.16.0/util/cairo-script/examples/interference.cs new file mode 100644 index 0000000..6d2ee22 --- /dev/null +++ b/libs/cairo-1.16.0/util/cairo-script/examples/interference.cs @@ -0,0 +1,46 @@ +/rot { 3 -1 roll } def +/2dup { 2 copy } def + +/circle { % context radius -- context + 2dup 0 m pop + 0 0 rot 0 math.2pi arc h +} def + +/circles { % context #circles -- context + 1 1 rot { circle } for +} def + +/SIDE 600. def +/SIZE 600. def +<< /width SIZE /height SIZE >> surface context +1 1 1 set-source-rgb paint +0 0 0 set-source-rgb +//EVEN_ODD set-fill-rule + +/r 4 def +/n SIDE 1.5 mul r div integer def + +SIZE SIDE div dup scale + +save + 302 200 translate + r dup scale + n circles +restore + +save + 100 300 translate + r dup scale + n circles +restore + +save + 500 400 translate + r dup scale + n circles +restore + +fill + +/target get (out.png) write-to-png pop +pop |