diff options
Diffstat (limited to 'support/dktools/dk4grepp.ctr')
-rw-r--r-- | support/dktools/dk4grepp.ctr | 888 |
1 files changed, 0 insertions, 888 deletions
diff --git a/support/dktools/dk4grepp.ctr b/support/dktools/dk4grepp.ctr deleted file mode 100644 index ddf4e88b14..0000000000 --- a/support/dktools/dk4grepp.ctr +++ /dev/null @@ -1,888 +0,0 @@ -%% options - -copyright owner = Dirk Krause -copyright year = 2017-xxxx -SPDX-License-Identifier: BSD-3-Clause - - -%% module - -#include "dk4conf.h" - -#include <stdio.h> - -#ifndef DK4GRA_H_INCLUDED -#include "dk4gra.h" -#endif - -#ifndef GRA_H_INCLUDED -#include "gra.h" -#endif - -#if DK4_HAVE_ASSERT_H -#ifndef ASSERT_H_INCLUDED -#include <assert.h> -#define ASSERT_H_INCLUDED 1 -#endif -#endif - - -/** Pattern procedure. -*/ -static const char * const p00[] = { -$!string-table -/ThirtyLeft % xs xe ys ye dy -{ - 3 index 5 index sub 3.0 sqrt div % xs xe ys ye dy ydiff - 3 index % xs xe ys ye dy ydiff y - { - dup 4 index gt {exit} if % xs xe ys ye dy ydiff y - 5 index 1 index % xs xe ys ye dy ydiff y xe y - 8 index 1 index 5 index add % xs xe ys ye dy ydiff y xe y xs y2 - newpath moveto % xs xe ys ye dy ydiff y xe y - lineto stroke % xs xe ys ye dy ydiff y - 2 index add % xs xe ys ye dy ydiff y - } - loop % xs xe ys ye dy ydiff y - pop pop pop pop pop pop pop % -- -} bind def -$!end -}; - - - -/** Pattern procedure. -*/ -static const char * const p01[] = { -$!string-table -/ThirtyRight % xs xe ys ye dy -{ - 3 index 5 index sub 3.0 sqrt div % xs xe ys ye dy ydiff - 3 index % xs xe ys ye dy ydiff y - { - dup 4 index gt {exit} if % xs xe ys ye dy ydiff y - 6 index 1 index % xs xe ys ye dy ydiff y xs y - 7 index 1 index % xs xe ys ye dy ydiff y xs y xe y - 5 index add % xs xe ys ye dy ydiff y xs y xe y2 - newpath moveto % xs xe ys ye dy ydiff y xs y - lineto stroke % xs xe ys ye dy ydiff y - 2 index add % xs xe ys ye dy ydiff y - } - loop % xs xe ys ye dy ydiff y - pop pop pop pop pop pop pop % -- -} bind def -$!end -}; - - - -/** Pattern procedure. -*/ -static const char * const p02[] = { -$!string-table -/ThirtyHatch % xs xe ys ye dy -{ - 3 index 5 index sub 3.0 sqrt div % xs xe ys ye dy ydiff - 3 index % xs xe ys ye dy ydiff y - { - dup 4 index gt {exit} if % xs xe ys ye dy ydiff y - 6 index 1 index % xs xe ys ye dy ydiff y xs y - 7 index 1 index % xs xe ys ye dy ydiff y xs y xe y - 5 index add % xs xe ys ye dy ydiff y xs y xe y2 - newpath moveto % xs xe ys ye dy ydiff y xs y - lineto stroke % xs xe ys ye dy ydiff y - 2 index add % xs xe ys ye dy ydiff y - } - loop % xs xe ys ye dy ydiff y - pop pop % xs xe ys ye dy - 3 index 5 index sub 3.0 sqrt div % xs xe ys ye dy ydiff - 3 index % xs xe ys ye dy ydiff y - { - dup 4 index gt {exit} if % xs xe ys ye dy ydiff y - 5 index 1 index % xs xe ys ye dy ydiff y xe y - 8 index 1 index 5 index add % xs xe ys ye dy ydiff y xe y xs y2 - newpath moveto % xs xe ys ye dy ydiff y xe y - lineto stroke % xs xe ys ye dy ydiff y - 2 index add % xs xe ys ye dy ydiff y - } - loop % xs xe ys ye dy ydiff y - pop pop pop pop pop pop pop % -- -} bind def -$!end -}; - - - -/** Pattern procedure. -*/ -static const char * const p03[] = { -$!string-table -/FourtyFiveLeft % xs xe ys ye dy -{ - 3 index 5 index sub % xs xe ys ye dy ydiff - 3 index % xs xe ys ye dy ydiff y - { - dup 4 index gt {exit} if % xs xe ys ye dy ydiff y - 5 index 1 index % xs xe ys ye dy ydiff y xe y - 8 index 1 index 5 index add % xs xe ys ye dy ydiff y xe y xs y2 - newpath moveto % xs xe ys ye dy ydiff y xe y - lineto stroke % xs xe ys ye dy ydiff y - 2 index add % xs xe ys ye dy ydiff y - } - loop % xs xe ys ye dy ydiff y - pop pop pop pop pop pop pop % -- -} bind def -$!end -}; - - - -/** Pattern procedure. -*/ -static const char * const p04[] = { -$!string-table -/FourtyFiveRight % xs xe ys ye dy -{ - 3 index 5 index sub % xs xe ys ye dy ydiff - 3 index % xs xe ys ye dy ydiff y - { - dup 4 index gt {exit} if % xs xe ys ye dy ydiff y - 6 index 1 index % xs xe ys ye dy ydiff y xs y - 7 index 1 index % xs xe ys ye dy ydiff y xs y xe y - 5 index add % xs xe ys ye dy ydiff y xs y xe y2 - newpath moveto % xs xe ys ye dy ydiff y xs y - lineto stroke % xs xe ys ye dy ydiff y - 2 index add % xs xe ys ye dy ydiff y - } - loop % xs xe ys ye dy ydiff y - pop pop pop pop pop pop pop % -- -} bind def -$!end -}; - - - -/** Pattern procedure. -*/ -static const char * const p05[] = { -$!string-table -/FourtyFiveHatch % xs xe ys ye dy -{ - 3 index 5 index sub % xs xe ys ye dy ydiff - 3 index % xs xe ys ye dy ydiff y - { - dup 4 index gt {exit} if % xs xe ys ye dy ydiff y - 5 index 1 index % xs xe ys ye dy ydiff y xe y - 8 index 1 index 5 index add % xs xe ys ye dy ydiff y xe y xs y2 - newpath moveto % xs xe ys ye dy ydiff y xe y - lineto stroke % xs xe ys ye dy ydiff y - 2 index add % xs xe ys ye dy ydiff y - } - loop % xs xe ys ye dy ydiff y - pop pop % xs xe ys ye dy - 3 index 5 index sub % xs xe ys ye dy ydiff - 3 index % xs xe ys ye dy ydiff y - { - dup 4 index gt {exit} if % xs xe ys ye dy ydiff y - 6 index 1 index % xs xe ys ye dy ydiff y xs y - 7 index 1 index % xs xe ys ye dy ydiff y xs y xe y - 5 index add % xs xe ys ye dy ydiff y xs y xe y2 - newpath moveto % xs xe ys ye dy ydiff y xs y - lineto stroke % xs xe ys ye dy ydiff y - 2 index add % xs xe ys ye dy ydiff y - } - loop % xs xe ys ye dy ydiff y - pop pop pop pop pop pop pop % -- -} bind def -$!end -}; - - - -/** Pattern procedure. -*/ -static const char * const p06[] = { -$!string-table -/HorizontalBricks % xs xe ys ye dy -{ - 2 index 0 % xs xe ys ye dy y nr - { - 1 index % xs xe ys ye dy y nr y - 4 index % xs xe ys ye dy y nr y ye - gt {exit} if % xs xe ys ye dy y nr - 6 index % xs xe ys ye dy y nr xs - 2 index % xs xe ys ye dy y nr xs y - 7 index % xs xe ys ye dy y nr xs y xe - 1 index % xs xe ys ye dy y nr xs y xe y - newpath moveto lineto stroke % xs xe ys ye dy y nr - 6 index % xs xe ys ye dy y nr x - 1 index 0 % xs xe ys ye dy y nr x nr 0 - gt {3 index add} if % xs xe ys ye dy y nr x - { - dup 7 index % xs xe ys ye dy y nr x x xe - gt {exit} if % xs xe ys ye dy y nr x - dup 3 index % xs xe ys ye dy y nr x x y - 1 index 1 index % xs xe ys ye dy y nr x x y x y - 7 index add % xs xe ys ye dy y nr x x y x y - newpath moveto lineto stroke % xs xe ys ye dy y nr x - 3 index 2.0 mul add % xs xe ys ye dy y nr x - } - loop % xs xe ys ye dy y nr x - pop % xs xe ys ye dy y nr - 1 add % xs xe ys ye dy y nr - dup % xs xe ys ye dy y nr nr - 1 gt {pop 0} if % xs xe ys ye dy y nr - exch 2 index add exch % xs xe ys ye dy y nr - } - loop % xs xe ys ye dy y nr - pop pop pop pop pop pop pop % -- -} bind def -$!end -}; - - - -/** Pattern procedure. -*/ -static const char * const p07[] = { -$!string-table -/VerticalBricks % xs xe ys ye dx -{ - 4 index 0 % xs xe ys ye dx x nr - { - 1 index 6 index % xs xe ys ye dx x nr x xe - gt {exit} if % xs xe ys ye dx x nr - 1 index 5 index % xs xe ys ye dx x nr x ys - 1 index 6 index % xs xe ys ye dx x nr x ys x ye - newpath moveto lineto stroke % xs xe ys ye dx x nr - 4 index 1 index 0 % xs xe ys ye dx x nr y nr 0 - gt {3 index add} if % xs xe ys ye dx x nr y - { - dup 5 index % xs xe ys ye dx x nr y y ye - gt {exit} if % xs xe ys ye dx x nr y - 2 index 1 index % xs xe ys ye dx x nr y x y - dup 2 index % xs xe ys ye dx x nr y x y y x - 7 index add exch % xs xe ys ye dx x nr y x y x y - newpath moveto lineto stroke % xs xe ys ye dx x nr y - 3 index 2.0 mul add % xs xe ys ye dx x nr y - } - loop % xs xe ys ye dx x nr y - pop % xs xe ys ye dx x nr - exch 2 index add exch % xs xe ys ye dx x nr - 1 add % xs xe ys ye dx x nr - dup 1 % xs xe ys ye dx x nr nr 1 - gt {pop 0} if % xs xe ys ye dx x nr - } - loop % xs xe ys ye dx x nr - pop pop pop pop pop pop pop % -- -} bind def -$!end -}; - - - -/** Pattern procedure. -*/ -static const char * const p08[] = { -$!string-table -/HorizontalLines % xs xe ys ye dy -{ - 2 index % xs xe ys ye dy y - { - dup 3 index gt {exit} if % xs xe ys ye dy y - 4 index 1 index % xs xe ys ye dy y xe y - 7 index 1 index % xs xe ys ye dy y xe y xs y - newpath moveto % xs xe ys ye dy y xe y - lineto stroke % xs xe ys ye dy y - 1 index add % xs xe ys ye dy y - } - loop % xs xe ys ye dy y - pop pop pop pop pop pop % -- -} bind def -$!end -}; - - - -/** Pattern procedure. -*/ -static const char * const p09[] = { -$!string-table -/VerticalLines % xs xe ys ye dx -{ - 4 index % xs xe ys ye dx x - { - dup 5 index gt {exit} if % xs xe ys ye dx x - dup 3 index % xs xe ys ye dx x x ye - 1 index 6 index % xs xe ys ye dx x x ye x ys - newpath moveto % xs xe ys ye dx x x ye - lineto stroke % xs xe ys ye dx x - 1 index add % xs xe ys ye dx x - } - loop % xs xe ys ye dx x - pop pop pop pop pop pop % -- -} bind def -$!end -}; - - - -/** Pattern procedure. -*/ -static const char * const p10[] = { -$!string-table -/CrossHatch % xs xe ys ye dx -{ - 4 index % xs xe ys ye dx x - { - dup 5 index gt {exit} if % xs xe ys ye dx x - dup 3 index % xs xe ys ye dx x x ye - 1 index 6 index % xs xe ys ye dx x x ye x ys - newpath moveto % xs xe ys ye dx x x ye - lineto stroke % xs xe ys ye dx x - 1 index add % xs xe ys ye dx x - } - loop % xs xe ys ye dx x - pop % xs xe ys ye dy - 2 index % xs xe ys ye dy y - { - dup 3 index gt {exit} if % xs xe ys ye dy y - 4 index 1 index % xs xe ys ye dy y xe y - 7 index 1 index % xs xe ys ye dy y xe y xs y - newpath moveto % xs xe ys ye dy y xe y - lineto stroke % xs xe ys ye dy y - 1 index add % xs xe ys ye dy y - } - loop % xs xe ys ye dy y - pop pop pop pop pop pop % -- -} bind def -$!end -}; - - - -/** Pattern procedure. -*/ -static const char * const p11[] = { -$!string-table -/HorizontalShinglesLeft % xs xe ys ye dy -{ - 2 index % xs xe ys ye dy y - { - dup 3 index gt {exit} if % xs xe ys ye dy y - 4 index 1 index % xs xe ys ye dy y xe y - 7 index 1 index % xs xe ys ye dy y xe y xs y - newpath moveto % xs xe ys ye dy y xe y - lineto stroke % xs xe ys ye dy y - 1 index add % xs xe ys ye dy y - } - loop % xs xe ys ye dy y - pop % xs xe ys ye dy - 2 index 0 % xs xe ys ye dy y nr - { - 1 index 4 index gt {exit} if % xs xe ys ye dy y nr - 6 index % xs xe ys ye dy y nr x - 1 index 2 gt - { 3 index 0.5 mul add } - { - 1 index 1 gt - { 3 index add } - { - 1 index 0 gt - { 3 index 1.5 mul add } - if - } - ifelse - } - ifelse - { - dup 7 index gt {exit} if % xs xe ys ye dy y nr x - dup 4 index 0.5 mul add % xs xe ys ye dy y nr x x2 - 3 index 5 index add % xs xe ys ye dy y nr x x2 y2 - 2 index 5 index newpath moveto % xs xe ys ye dy y nr x x2 y2 - lineto stroke % xs xe ys ye dy y nr x - 3 index 2.0 mul add % xs xe ys ye dy y nr x - } - loop pop % xs xe ys ye dy y nr - exch 2 index add exch % xs xe ys ye dy y nr - 1 add dup 3 gt {pop 0} if % xs xe ys ye dy y nr - } - loop % xs xe ys ye dy y nr - pop pop pop pop pop pop pop -} bind def -$!end -}; - - - -/** Pattern procedure. -*/ -static const char * const p12[] = { -$!string-table -/HorizontalShinglesRight % xs xe ys ye dy -{ - 2 index % xs xe ys ye dy y - { - dup 3 index gt {exit} if % xs xe ys ye dy y - 4 index 1 index % xs xe ys ye dy y xe y - 7 index 1 index % xs xe ys ye dy y xe y xs y - newpath moveto % xs xe ys ye dy y xe y - lineto stroke % xs xe ys ye dy y - 1 index add % xs xe ys ye dy y - } - loop % xs xe ys ye dy y - pop % xs xe ys ye dy - 2 index 0 % xs xe ys ye dy y nr - { - 1 index 4 index gt {exit} if % xs xe ys ye dy y nr - 6 index % xs xe ys ye dy y nr x - 1 index 4 index 0.5 mul mul add % xs xe ys ye dy y nr x - { - dup 7 index gt {exit} if % xs xe ys ye dy y nr x - dup 3 index 5 index add % xs xe ys ye dy y nr x x y2 - 1 index 6 index 0.5 mul add % xs xe ys ye dy y nr x x y2 x2 - 5 index newpath moveto lineto % xs xe ys ye dy y nr x - stroke - 3 index 2.0 mul add % xs xe ys ye dy y nr x - } - loop pop % xs xe ys ye dy y nr - exch 2 index add exch % xs xe ys ye dy y nr - 1 add dup 3 gt {pop 0} if % xs xe ys ye dy y nr - } - loop % xs xe ys ye dy y nr - pop pop pop pop pop pop pop -} bind def -$!end -}; - - - -/** Pattern procedure. -*/ -static const char * const p13[] = { -$!string-table -/VerticalShinglesLeft % xs xe ys ye dx -{ - 4 index % xs xe ys ye dx x - { - dup 5 index gt {exit} if % xs xe ys ye dx x - dup 3 index % xs xe ys ye dx x x ye - 1 index 6 index % xs xe ys ye dx x x ye x ys - newpath moveto % xs xe ys ye dx x x ye - lineto stroke % xs xe ys ye dx x - 1 index add % xs xe ys ye dx x - } - loop % xs xe ys ye dx x - pop % xs xe ys ye dx - 4 index 0 % xs xe ys ye dx x nr - { - 1 index 6 index gt {exit} if % xs xe ys ye dx x nr - 4 index % xs xe ys ye dx x nr y - 3 index 2 index 0.5 mul mul add % xs xe ys ye dx x nr y - { - dup 5 index gt {exit} if % xs xe ys ye dx x nr y - 2 index 1 index % xs xe ys ye dx x nr y x y - 5 index 0.5 mul add % xs xe ys ye dx x nr y x y2 - 1 index 6 index add 3 index % xs xe ys ye dx x nr y x y2 x2 y - newpath moveto lineto stroke % xs xe ys ye dx x nr y - 3 index 2.0 mul add % xs xe ys ye dx x nr y - } - loop pop % xs xe ys ye dx x nr - exch 2 index add exch % xs xe ys ye dx x nr - 1 add dup 3 gt {pop 0} if % xs xe ys ye dx x nr - } - loop % xs xe ys ye dx x nr - pop pop pop pop pop pop pop % -- -} bind def -$!end -}; - - - -/** Pattern procedure. -*/ -static const char * const p14[] = { -$!string-table -/VerticalShinglesRight % xs xe ys ye dx -{ - 4 index % xs xe ys ye dx x - { - dup 5 index gt {exit} if % xs xe ys ye dx x - dup 3 index % xs xe ys ye dx x x ye - 1 index 6 index % xs xe ys ye dx x x ye x ys - newpath moveto % xs xe ys ye dx x x ye - lineto stroke % xs xe ys ye dx x - 1 index add % xs xe ys ye dx x - } - loop % xs xe ys ye dx x - pop % xs xe ys ye dx - 4 index 0 % xs xe ys ye dx x nr - { - 1 index 6 index gt {exit} if % xs xe ys ye dx x nr - 4 index % xs xe ys ye dx x nr y - 1 index 2 gt - { 3 index 0.5 mul add } - { - 1 index 1 gt - { 3 index add } - { - 1 index 0 gt - { 3 index 1.5 mul add } - if - } - ifelse - } - ifelse - { - dup 5 index gt {exit} if % xs xe ys ye dx x nr y - 2 index 1 index % xs xe ys ye dx x nr y x y - 1 index 6 index add % xs xe ys ye dx x nr y x y x2 - 1 index 7 index 0.5 mul add % xs xe ys ye dx x nr y x y x2 y2 - newpath moveto lineto stroke % xs xe ys ye dx x nr y - 3 index 2.0 mul add % xs xe ys ye dx x nr y - } - loop pop % xs xe ys ye dx x nr - exch 2 index add exch % xs xe ys ye dx x nr - 1 add dup 3 gt {pop 0} if % xs xe ys ye dx x nr - } - loop % xs xe ys ye dx x nr - pop pop pop pop pop pop pop % -- -} bind def -$!end -}; - - - -/** Pattern procedure. -*/ -static const char * const p15[] = { -$!string-table -/FishScales % xs xe ys ye dx dy r a1 a2 -{ - 6 index 0 % xs xe ys ye dx dy r a1 a2 y nr - { - 1 index 8 index gt {exit} if % xs xe ys ye dx dy r a1 a2 y nr - 10 index % xs xe ys ye dx dy r a1 a2 y nr x - 1 index 0 gt - { 7 index 0.5 mul add } - if - { - dup 11 index gt {exit} if % xs xe ys ye dx dy r a1 a2 y nr x - dup 3 index 8 index add % xs xe ys ye dx dy r a1 a2 y nr x x y+dy - newpath moveto % xs xe ys ye dx dy r a1 a2 y nr x - dup 8 index 0.5 mul add % xs xe ys ye dx dy r a1 a2 y nr x xm - 3 index 7 index add % xs xe ys ye dx dy r a1 a2 y nr x xm ym - 7 index 7 index 7 index % xs xe ys ye dx dy r a1 a2 y nr x xm ym r a1 a2 - arc stroke % xs xe ys ye dx dy r a1 a2 y nr x - 7 index add % xs xe ys ye dx dy r a1 a2 y nr x - } - loop pop % xs xe ys ye dx dy r a1 a2 y nr - exch 5 index add exch % xs xe ys ye dx dy r a1 a2 y nr - 1 add dup 1 gt {pop 0} if % xs xe ys ye dx dy r a1 a2 y nr - } - loop % xs xe ys ye dx dy r a1 a2 y nr - pop pop pop pop pop pop pop pop pop pop pop -} bind def -$!end -}; - - - -/** Pattern procedure. -*/ -static const char * const p16[] = { -$!string-table -/SmallFishScales % xs xe ys ye dx dy r a1 a2 -{ - 6 index 0 % xs xe ys ye dx dy r a1 a2 y nr - { - 1 index 8 index gt {exit} if % xs xe ys ye dx dy r a1 a2 y nr - 10 index % xs xe ys ye dx dy r a1 a2 y nr x - 1 index 0 gt - { 7 index 0.5 mul add } - if - { - dup 11 index gt {exit} if % xs xe ys ye dx dy r a1 a2 y nr x - dup 3 index 8 index add % xs xe ys ye dx dy r a1 a2 y nr x x y+dy - newpath moveto % xs xe ys ye dx dy r a1 a2 y nr x - dup 8 index 0.5 mul add % xs xe ys ye dx dy r a1 a2 y nr x xm - 3 index 7 index add % xs xe ys ye dx dy r a1 a2 y nr x xm ym - 7 index 7 index 7 index % xs xe ys ye dx dy r a1 a2 y nr x xm ym r a1 a2 - arc stroke % xs xe ys ye dx dy r a1 a2 y nr x - 7 index add % xs xe ys ye dx dy r a1 a2 y nr x - } - loop pop % xs xe ys ye dx dy r a1 a2 y nr - exch 5 index add exch % xs xe ys ye dx dy r a1 a2 y nr - 1 add dup 1 gt {pop 0} if % xs xe ys ye dx dy r a1 a2 y nr - } - loop % xs xe ys ye dx dy r a1 a2 y nr - pop pop pop pop pop pop pop pop pop pop pop -} bind def -$!end -}; - - - -/** Pattern procedure. -*/ -static const char * const p17[] = { -$!string-table -/Circles % xs xe ys ye r -{ - 2 index % xs xe ys ye r y - { - dup 3 index gt {exit} if - 5 index % xs xe ys ye r y x - { - dup 6 index gt {exit} if - dup 3 index add % xs xe ys ye r y x xm - 2 index 4 index add % xs xe ys ye r y x xm ym - 4 index 0 360 % xs xe ys ye r y x xm ym r a1 a2 - 4 index 3 index add % xs xe ys ye r y x xm ym r a1 a2 xr - 4 index % xs xe ys ye r y x xm ym r a1 a2 xr yr - newpath moveto arc - closepath stroke % xs xe ys ye r y x - 2 index dup add add - } - loop pop - 1 index dup add add % xs xe ys ye r y - } - loop % xs xe ys ye r y - pop pop pop pop pop pop % -- -} bind def -$!end -}; - - - -/** Pattern procedure. -*/ -static const char * const p18[] = { -$!string-table -/Hexagons % xs xe ys ye dx dy -{ - 1 index 3.0 div % xs xe ys ye dx dy r - 4 index % xs xe ys ye dx dy r y - { - dup 5 index gt {exit} if - 7 index % xs xe ys ye dx dy r y x - { - dup 8 index gt {exit} if - newpath - dup 3 index 3.0 mul add % xs xe ys ye dx dy r y x x0 - 2 index 5 index 0.5 mul add % xs xe ys ye dx dy r y x x0 y0 - moveto % xs xe ys ye dx dy r y x - dup 3 index 2.0 mul add % xs xe ys ye dx dy r y x x1 - 2 index 5 index 0.5 mul add % xs xe ys ye dx dy r y x x1 y1 - lineto % xs xe ys ye dx dy r y x - dup 3 index 1.5 mul add % xs xe ys ye dx dy r y x x2 - 2 index 5 index add % xs xe ys ye dx dy r y x x2 y2 - lineto % xs xe ys ye dx dy r y x - dup 3 index 0.5 mul add % xs xe ys ye dx dy r y x x3 - 2 index 5 index add % xs xe ys ye dx dy r y x x3 y3 - lineto % xs xe ys ye dx dy r y x - dup 2 index 5 index 0.5 mul add % xs xe ys ye dx dy r y x x4 y4 - lineto % xs xe ys ye dx dy r y x - dup 3 index 0.5 mul add 2 index % xs xe ys ye dx dy r y x x5 y5 - lineto % xs xe ys ye dx dy r y x - dup 3 index 1.5 mul add 2 index % xs xe ys ye dx dy r y x x6 y6 - lineto % xs xe ys ye dx dy r y x - dup 3 index 2.0 mul add % xs xe ys ye dx dy r y x x7 - 2 index 5 index 0.5 mul add % xs xe ys ye dx dy r y x x7 y7 - lineto stroke % xs xe ys ye dx dy r y x - 4 index add - } - loop pop - 2 index add - } - loop pop pop pop pop pop pop pop pop -} bind def -$!end -}; - - - -/** Pattern procedure. -*/ -static const char * const p19[] = { -$!string-table -/Octagons % xs xe ys ye dx co -{ - 3 index % xs xe ys ye dx co y - { - dup 4 index gt {exit} if - 6 index % xs xe ys ye dx co y x - { - dup 7 index gt {exit} if % xs xe ys ye dx co y x - newpath - dup 3 index add % xs xe ys ye dx co y x x0 - 2 index % xs xe ys ye dx co y x x0 y0 - moveto % xs xe ys ye dx co y x - dup 4 index add 3 index sub % xs xe ys ye dx co y x x1 - 2 index % xs xe ys ye dx co y x x1 y1 - lineto % xs xe ys ye dx co y x - dup 4 index add % xs xe ys ye dx co y x x2 - 2 index 4 index add % xs xe ys ye dx co y x x2 y2 - lineto % xs xe ys ye dx co y x - dup 4 index add % xs xe ys ye dx co y x x3 - 2 index 5 index add 4 index sub % xs xe ys ye dx co y x x3 y3 - lineto % xs xe ys ye dx co y x - dup 4 index add 3 index sub % xs xe ys ye dx co y x x4 - 2 index 5 index add % xs xe ys ye dx co y x x4 y4 - lineto % xs xe ys ye dx co y x - dup 3 index add % xs xe ys ye dx co y x x5 - 2 index 5 index add % xs xe ys ye dx co y x x5 y5 - lineto % xs xe ys ye dx co y x - dup % xs xe ys ye dx co y x x6 - 2 index 5 index add 4 index sub % xs xe ys ye dx co y x x6 y6 - lineto % xs xe ys ye dx co y x - dup % xs xe ys ye dx co y x x7 - 2 index 4 index add % xs xe ys ye dx co y x x7 y7 - lineto closepath stroke % xs xe ys ye dx co y x - 3 index add - } - loop pop - 2 index add - } - loop pop pop pop pop pop pop pop -} bind def -$!end -}; - - - -/** Pattern procedure. -*/ -static const char * const p20[] = { -$!string-table -/HorizontalTireTreads % xs xe ys ye dx -{ - dup 0.5 mul % xs xe ys ye dx r - 3 index % xs xe ys ye dx r y - { - dup 4 index gt {exit} if - 6 index % xs xe ys ye dx r y x - { - dup 7 index gt {exit} if % xs xe ys ye dx r y x - dup 4 index add 2 index % xs xe ys ye dx r y x x2 y2 - 2 index 5 index add % xs xe ys ye dx r y x x2 y2 x1 - 4 index 6 index add % xs xe ys ye dx r y x x2 y2 x1 y1 - 4 index 6 index % xs xe ys ye dx r y x x2 y2 x1 y1 x0 y0 - newpath moveto lineto lineto % xs xe ys ye dx r y x - stroke - 3 index add - } - loop pop % xs xe ys ye dx r y - 2 index add - } - loop % xs xe ys ye dx r y - pop pop pop pop pop pop pop -} bind def -$!end -}; - - - -/** Pattern procedure. -*/ -static const char * const p21[] = { -$!string-table -/VerticalTireTreads % xs xe ys ye dx -{ - dup 0.5 mul % xs xe ys ye dx r - 5 index % xs xe ys ye dx r x - { - dup 6 index gt {exit} if - 4 index % xs xe ys ye dx r x y - { - dup 5 index gt {exit} if - 1 index 1 index 5 index add % xs xe ys ye dx r x y x2 y2 - 3 index 5 index add % xs xe ys ye dx r x y x2 y2 x1 - 3 index 6 index add % xs xe ys ye dx r x y x2 y2 x1 y1 - 5 index 5 index % xs xe ys ye dx r x y x2 y2 x1 y1 x0 y0 - newpath moveto lineto lineto % xs xe ys ye dx r x y - stroke - 3 index add - } - loop pop - 2 index add - } - loop % xs xe ys ye dx r x - pop pop pop pop pop pop pop -} bind def -$!end -}; - - - -/** Pattern names. -*/ -static const char * const pnames[] = { -$!string-table -ThirtyLeft -ThirtyRight -ThirtyHatch -FourtyFiveLeft -FourtyFiveRight -FourtyFiveHatch -HorizontalBricks -VerticalBricks -HorizontalLines -VerticalLines -CrossHatch -HorizontalShinglesLeft -HorizontalShinglesRight -VerticalShinglesLeft -VerticalShinglesRight -FishScales -SmallFishScales -Circles -Hexagons -Octagons -HorizontalTireTreads -VerticalTireTreads -$!end -}; - - - -/** Pattern procedures. -*/ -static const char * const * pproc[] = { -p00, p01, p02, p03, p04, p05, p06, p07, p08, p09, -p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, -p20, p21 -}; - - - -const char * const * -dk4gra_eps_pattern_procedure(size_t i) -{ - const char * const *back = NULL; -#if DK4_USE_ASSERT - assert(DK4_GRA_PATTERN_MAX >= i); -#endif - if (DK4_GRA_PATTERN_MAX >= i) { - back = pproc[i]; - } - return back; -} - - - -const char * -dk4gra_eps_pattern_name(size_t i) -{ - const char *back = NULL; -#if DK4_USE_ASSERT - assert(DK4_GRA_PATTERN_MAX >= i); -#endif - if (DK4_GRA_PATTERN_MAX >= i) { - back = pnames[i]; - } - return back; -} - - -/* vim: set ai sw=4 ts=4 : */ |