about summary refs log tree commit diff
path: root/test/pammixmulti-identity.test
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2023-06-28 17:21:21 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2023-06-28 17:21:21 +0000
commit0d513aca5cbbb8db0a9d127e101ac3b534cc8bf0 (patch)
tree3e8db9f13fb33464324c6986e7d80540a42a86c7 /test/pammixmulti-identity.test
parent7dd37058c4c8e0f6ca272e329162a52f958e4951 (diff)
downloadnetpbm-mirror-0d513aca5cbbb8db0a9d127e101ac3b534cc8bf0.tar.gz
netpbm-mirror-0d513aca5cbbb8db0a9d127e101ac3b534cc8bf0.tar.xz
netpbm-mirror-0d513aca5cbbb8db0a9d127e101ac3b534cc8bf0.zip
promote Stable to Super Stable
git-svn-id: http://svn.code.sf.net/p/netpbm/code/super_stable@4557 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/pammixmulti-identity.test')
-rwxr-xr-xtest/pammixmulti-identity.test77
1 files changed, 77 insertions, 0 deletions
diff --git a/test/pammixmulti-identity.test b/test/pammixmulti-identity.test
new file mode 100755
index 00000000..d205c359
--- /dev/null
+++ b/test/pammixmulti-identity.test
@@ -0,0 +1,77 @@
+#! /bin/bash
+# This script tests: pammixmulti
+# Also requires: pgmnoise pnminvert pamsumm
+
+tmpdir=${tmpdir:-/tmp}
+
+# Test 1.  Should print 1926073387 101484 six times
+echo Test 1.
+
+pammixmulti testimg.ppm | cksum
+pammixmulti testimg.ppm testimg.ppm | cksum
+pammixmulti testimg.ppm testimg.ppm testimg.ppm | cksum
+pammixmulti -blend=average testimg.ppm testimg.ppm | cksum
+pammixmulti -blend=average testimg.ppm testimg.ppm testimg.ppm | cksum
+pammixmulti -blend=random -randomseed=1 \
+    testimg.ppm testimg.ppm testimg.ppm | cksum
+
+
+# Test 2.  Should print 1926073387 101484 three times
+echo Test 2.
+
+mask_pgm=${tmpdir}/mask.pgm
+pgmnoise -maxval=2 -randomseed=1 227 149 > ${mask_pgm}
+
+for sd in 0.5 1.2 3.0 
+  do
+  pammixmulti -blend=mask -maskfile=${mask_pgm} -stdev=${sd} \
+      testimg.ppm testimg.ppm testimg.ppm | cksum
+  done
+rm ${mask_pgm}
+
+# Test 3.  Should print
+echo Test 3.
+
+noise_pgm=${tmpdir}/noise.pgm
+pgmnoise --randomseed=1 227 149 > ${noise_pgm}
+
+pammixmulti -blend=mask -maskfile=${noise_pgm} \
+    testimg.ppm testimg.ppm | cksum
+pammixmulti -blend=mask -maskfile=${noise_pgm} \
+    testimg.ppm testimg.ppm testimg.ppm | cksum
+pammixmulti -blend=mask -maskfile=${noise_pgm} \
+    testimg.ppm testimg.ppm testimg.ppm testimg.ppm | cksum
+rm ${noise_pgm}
+
+
+# Test 4.
+
+# Mix image with its own inverse.
+# Output should be a monotone gray sheet.
+#  Should print 127 six times
+echo Test 4.
+
+invert_ppm=${tmpdir}/invert.ppm
+monotone_ppm=${tmpdir}/monotone.ppm
+
+pnminvert testimg.ppm > ${invert_ppm}
+
+pammixmulti -blend=average testimg.ppm ${invert_ppm} | tee ${monotone_ppm} | \
+  pamsumm -brief -max &&
+  pamsumm -brief -min ${monotone_ppm}
+rm ${monotone_ppm}
+
+pammixmulti -blend=average \
+    testimg.ppm ${invert_ppm} testimg.ppm ${invert_ppm} | \
+  tee ${monotone_ppm} | \
+  pamsumm -brief -max &&
+  pamsumm -brief -min ${monotone_ppm}
+rm ${monotone_ppm}
+
+pammixmulti -blend=average \
+    testimg.ppm testimg.ppm ${invert_ppm} ${invert_ppm} | \
+  tee ${monotone_ppm} | \
+  pamsumm -brief -max &&
+  pamsumm -brief -min ${monotone_ppm}
+
+rm ${monotone_ppm} ${invert_ppm}