diff options
Diffstat (limited to 'dundundun.sh')
| -rwxr-xr-x | dundundun.sh | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/dundundun.sh b/dundundun.sh new file mode 100755 index 0000000..e3e93e5 --- /dev/null +++ b/dundundun.sh | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | source ./shakeoffsets.sh | ||
| 4 | |||
| 5 | declare -a shakeOffsets | ||
| 6 | getShakeOffsets shakeOffsets | ||
| 7 | |||
| 8 | SOURCEBASE=$1 | ||
| 9 | SOURCESVG=`printf "%s.svg" $SOURCEBASE` | ||
| 10 | TARGETSVG=`printf "export/%s.png" $SOURCEBASE` | ||
| 11 | |||
| 12 | mkdir -p export_tmp | ||
| 13 | rm -f export_tmp/* | ||
| 14 | |||
| 15 | |||
| 16 | inkscape -z -e "export_tmp/1.png" `printf "%s1.png" $SOURCEBASE` | ||
| 17 | inkscape -z -e "export_tmp/2.png" `printf "%s2.png" $SOURCEBASE` | ||
| 18 | inkscape -z -e "export_tmp/3.png" `printf "%s3.png" $SOURCEBASE` | ||
| 19 | inkscape -z -e "export_tmp/4.png" `printf "%s4.png" $SOURCEBASE` | ||
| 20 | |||
| 21 | counter=5 | ||
| 22 | while [ $counter -le 79 ] | ||
| 23 | do | ||
| 24 | offset=${shakeOffsets[counter-5]} | ||
| 25 | file=`printf "export_tmp/%s.png" $counter` | ||
| 26 | source=`printf "%s4.png" $SOURCEBASE` | ||
| 27 | inkscape -z -e $file -a $offset $source | ||
| 28 | ((counter++)) | ||
| 29 | done | ||
| 30 | |||
| 31 | |||
| 32 | declare -a args | ||
| 33 | args+=(export_tmp/1.png 50:50) | ||
| 34 | args+=(export_tmp/2.png 12:50) | ||
| 35 | args+=(export_tmp/3.png 12:50) | ||
| 36 | |||
| 37 | counter=4 | ||
| 38 | while [ $counter -le 79 ] | ||
| 39 | do | ||
| 40 | file=`printf "export_tmp/%s.png" $counter` | ||
| 41 | args+=($file 1:50) | ||
| 42 | ((counter++)) | ||
| 43 | done | ||
| 44 | |||
| 45 | apngasm -o $TARGETSVG ${args[@]} | ||
| 46 | rm -f export_tmp/* | ||
