about summary refs log tree commit diff
path: root/test/pamstereogram.test
blob: 02da972495ab03262752bd140e3a57771ed9ff89 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#! /bin/sh
# This script tests: pamstereogram
# Also requires: pamdepth

tmpdir=${tmpdir:-/tmp}
testgrid_pgm=${tmpdir}/testgrid.pgm

# Make input file

echo "Test 00. Should print 729348909 237"
pamdepth -quiet 255 testgrid.pbm | tee ${testgrid_pgm} | cksum


# Random pattern

echo "Test 01. Should print 3308667841 293"
pamstereogram -randomseed=1 testgrid.pbm | cksum 
echo "Test 02. Should print 3308667841 293"
pamstereogram -randomseed=1 -blackandwhite testgrid.pbm | cksum 
echo "Test 03. Should print 748200469 170"
pamseq -tupletype=GRAYSCALE 1 100 | pamstereogram -randomseed=1 | cksum 
echo "Test 04. Should print 1538641408 1070"
pamgauss 100 10 -maxval=10000 -sigma 20 | pamfunc -multiplier=500 | \
  pamstereogram -randomseed=1 -dpi=10 | cksum

# Makemask

echo "Test 10. Should print 1266273778 293"
pamstereogram -randomseed=1 -makemask testgrid.pbm | cksum 

echo "Test 11. Should print 55276708 1070"
pamgauss 100 10 -maxval=10000 -sigma 20 | pamfunc -multiplier=500 | \
  pamstereogram -randomseed=1 -dpi=10 -makemask | cksum

# Grayscale

echo "Test 20. Should print 1920539795 289"
pamstereogram -randomseed=1 -grayscale testgrid.pbm | cksum 
echo "Test 21. Should print 4069109690 4068"
pamseq 1 100 | pnmtile 200 20 | \
  pamstereogram -randomseed=1 -dpi=10 -grayscale | \
  cksum
echo "Test 22. Should print 1163376052 4068"
pamseq 1 100 | pnmtile 200 20 | \
  pamstereogram -randomseed=1 -dpi=10 -grayscale -maxval 255 | \
  cksum

# Color

echo "Test 30. Should print 2127252909 731"
pamstereogram -randomseed=1 -color testgrid.pbm | cksum 
echo "Test 31. Should print 858421050 12062"
pamseq 1 100 | pnmtile 200 20 | \
  pamstereogram -randomseed=1 -dpi=10 -color | \
  cksum

# Pattern file

echo "Test 40. Should print 1236679620 660"
pamgradient black gray50 white gray50 100 50 | \
  pamstereogram -patfile testgrid.pbm -eyesep=.1 -crosseyed | cksum

echo "Test 41. Should print 1022068930 5014"
pamgradient black gray50 white gray50 100 50 | \
  pamstereogram -patfile  ${testgrid_pgm} -eyesep=.1 -crosseyed | cksum

# drawguides

echo "Test 51. Should print 3784833098 11071"
pamgradient black gray50 white gray50 100 50 | \
  pamstereogram -randomseed=1 -dpi 10 -guidesize=20 -guidetop | cksum

echo "Test 52. Should print 1419662425 1441"
pamgradient black gray50 white gray50 100 50 | \
  pamstereogram -patfile=testgrid.pbm -dpi 10 -guidesize=20 -guidetop | cksum


# Clean up files we created
rm  ${testgrid_pgm}