# This script tests: ppmtopi1 pi1toppm ppmtoneo neotoppm # Also requires: pgmramp pamscale pbmmake rgb3toppm alias ppmtopi1="${PBM_TESTPREFIX}ppmtopi1" alias pi1toppm="${PBM_TESTPREFIX}pi1toppm" alias ppmtoneo="${PBM_TESTPREFIX}ppmtoneo" alias neotoppm="${PBM_TESTPREFIX}neotoppm" alias pgmramp="${PBM_BINPREFIX}pgmramp" alias pamscale="${PBM_BINPREFIX}pamscale" alias pbmmake="${PBM_BINPREFIX}pbmmake" alias rgb3toppm="${PBM_BINPREFIX}rgb3toppm" shopt -s expand_aliases # Atari pi1 and neo files have the following characteristics: # Size: 320x200 # Maxval: 7 # Color palette: at most 16 entries tmpdir=${tmpdir:-/tmp} t_red=${tmpdir}/t.red t_grn=${tmpdir}/t.grn t_blu=${tmpdir}/t.blu t_ppm=${tmpdir}/t.ppm pgmramp -lr -maxval=3 4 1 | \ pamscale -xscale=80 -yscale=200 -nomix > ${t_red} pbmmake -g 16 10 | pamenlarge 20 > ${t_grn} pbmmake -g 8 5 | pamenlarge 40 > ${t_blu} rgb3toppm ${t_red} ${t_grn} ${t_blu} | pamdepth 7 > ${t_ppm} #Test 0. Should print: 3583332118 192013 cksum < ${t_ppm} #Test 1. Should print: 3583332118 192013 ppmtopi1 ${t_ppm} | pi1toppm | cksum #Test 2. Should print: 3583332118 192013 ppmtoneo ${t_ppm} | neotoppm | cksum rm ${t_red} ${t_grn} ${t_blu} ${t_ppm}