Blame test/pnmquantall.test
|
Packit |
78deda |
#! /bin/bash
|
|
Packit |
78deda |
# This script tests: pnmquantall
|
|
Packit |
78deda |
# Also requires: ppmtorgb3 pgmhist
|
|
Packit |
78deda |
|
|
Packit |
78deda |
tmpdir=${tmpdir:-/tmp}
|
|
Packit |
78deda |
test_ppm=${tmpdir}/testimg.ppm
|
|
Packit |
78deda |
|
|
Packit |
78deda |
cp testimg.ppm ${tmpdir} &&
|
|
Packit |
78deda |
ppmtorgb3 ${test_ppm}
|
|
Packit |
78deda |
|
|
Packit |
78deda |
test_red=${tmpdir}/testimg.red
|
|
Packit |
78deda |
test_grn=${tmpdir}/testimg.grn
|
|
Packit |
78deda |
test_blu=${tmpdir}/testimg.blu
|
|
Packit |
78deda |
|
|
Packit |
78deda |
pnmquantall 20 ${test_red} ${test_grn} ${test_blu}
|
|
Packit |
78deda |
|
|
Packit |
78deda |
for i in ${test_red} ${test_grn} ${test_blu}
|
|
Packit |
78deda |
do
|
|
Packit |
78deda |
cat $i | cksum
|
|
Packit |
78deda |
done
|
|
Packit |
78deda |
|
|
Packit |
78deda |
# Should print 1
|
|
Packit |
78deda |
|
|
Packit |
78deda |
pnmcat ${test_red} ${test_grn} ${test_blu} -tb | \
|
|
Packit |
78deda |
pgmhist -m | awk '$2>0 {s++}; END { print (s<=20) }'
|
|
Packit |
78deda |
|
|
Packit |
78deda |
rm ${test_red} ${test_grn} ${test_blu} ${test_ppm}
|