1
1
#! /bin/bash
2
2
# This script tests: pamcrater pamshadedrelief
3
- # Also requires: pamslice pamvalidate
3
+ # Also requires: pamstack pamvalidate pamcut pamflip
4
4
5
5
alias pamcrater=" ${PBM_TESTPREFIX} pamcrater"
6
- alias pamslice=" ${PBM_TESTPREFIX} pamshadedrelief"
7
- alias pamslice=" ${PBM_BINPREFIX} pamslice"
8
- alias pamvalidate=" ${PBM_TESTPREFIX} pamvalidate"
6
+ alias pamshadedrelief=" ${PBM_TESTPREFIX} pamshadedrelief"
7
+ alias pamstack=" ${PBM_BINPREFIX} pamstack"
8
+ alias pamvalidate=" ${PBM_BINPREFIX} pamvalidate"
9
+ alias pamcut=" ${PBM_BINPREFIX} pamcut"
10
+ alias pamflip=" ${PBM_BINPREFIX} pamflip"
11
+
9
12
shopt -s expand_aliases
10
13
14
+ # We use the undocumented --test and --radius options of pamcrater.
15
+ # pamcrater --test --radius=N
16
+ # The above draws a single crater of radius N.
17
+ # The resulting image should be symmetric.
18
+
11
19
tmpdir=${tmpdir:-/ tmp}
12
20
13
21
test_pam=${tmpdir} /test.pam
@@ -29,11 +37,11 @@ pamstack ${test10_pam} ${test50_pam} ${test100_pam} ${test150_pam} |
29
37
30
38
for i in 1 10 70
31
39
do
32
- ( pamslice -row =$(( 128 + $i )) ${test_pam} | cksum &&
33
- pamslice -row =$(( 128 - $i )) ${test_pam} | cksum &&
34
- pamslice -col =$(( 128 + $i )) ${test_pam} | cksum &&
35
- pamslice -col =$(( 128 - $i )) ${test_pam} | cksum
36
- ) | uniq -c | awk ' {print $1}'
40
+ ( pamcut -top =$(( 128 + $i )) -height=1 ${test_pam} | cksum &&
41
+ pamcut -top =$(( 128 - $i )) -height=1 ${test_pam} | cksum &&
42
+ pamcut -left =$(( 128 + $i )) -width=1 ${test_pam} | pamflip -xy | cksum &&
43
+ pamcut -left =$(( 128 - $i )) -width=1 ${test_pam} | pamflip -xy | cksum
44
+ ) | uniq -c | awk ' {print $1}'
37
45
done
38
46
39
47
rm ${test_pam} ${test10_pam} ${test50_pam}
@@ -42,12 +50,12 @@ rm ${test_pam} ${test10_pam} ${test50_pam}
42
50
43
51
pamshadedrelief ${test100_pam} > ${testshaded_pam}
44
52
45
- ( pamslice -row =$(( 128 + 12 )) ${testshaded_pam} | cksum &&
46
- pamslice -row =$(( 128 - 12 )) ${testshaded_pam} | cksum &&
47
- pamslice -row =$(( 128 + 31 )) ${testshaded_pam} | cksum &&
48
- pamslice -row =$(( 128 - 31 )) ${testshaded_pam} | cksum &&
49
- pamslice -row =$(( 128 + 99 )) ${testshaded_pam} | cksum &&
50
- pamslice -row =$(( 128 - 99 )) ${testshaded_pam} | cksum
53
+ ( pamcut -top =$(( 128 + 12 )) -height=1 ${testshaded_pam} | cksum &&
54
+ pamcut -top =$(( 128 - 12 )) -height=1 ${testshaded_pam} | cksum &&
55
+ pamcut -top =$(( 128 + 31 )) -height=1 ${testshaded_pam} | cksum &&
56
+ pamcut -top =$(( 128 - 31 )) -height=1 ${testshaded_pam} | cksum &&
57
+ pamcut -top =$(( 128 + 99 )) -height=1 ${testshaded_pam} | cksum &&
58
+ pamcut -top =$(( 128 - 99 )) -height=1 ${testshaded_pam} | cksum
51
59
) | uniq -c | awk ' {print $1}'
52
60
53
61
rm ${testshaded_pam} ${test100_pam}
0 commit comments