#! /bin/csh -f -e set usage = "$0 [ SCALESPECS ] OPTIONS BLACKFILE.ppm WHITEFILE.ppm > OUTFILE.gif" # Same as linear-ppm-pair-to-gif (q.v.), but applies pnmscale # first, with arguments SCALESPECS (see the pnmscale manpage) if ( ( $#argv >= 3 ) && ( "x$1" !~ x-* ) ) then set scalespecs = ( "$1" ); shift; else if ( ( $#argv >= 4 ) && ( \ ( "x$1" == "x-xsize" ) || \ ( "x$1" == "x-ysize" ) || \ ( "x$1" == "x-xscale" ) || \ ( "x$1" == "x-yscale" ) || \ ( "x$1" == "x-width" ) || \ ( "x$1" == "x-height" ) || \ ( "x$1" == "x-pixels" ) || \ ) ) then set scalespecs = ( "$1" "$2" ); shift; shift; else if ( ( $#argv >= 5 ) && ( "x$1" == "x-xysize" ) ) then set scalespecs = ( "$1" "$2" "$3" ); shift; shift; shift; else echo "usage: ${usage}"; exit 1 endif if ( $#argv < 2 ) then echo "usage: ${usage}"; exit 1 endif @ wi = $#argv @ bi = $#argv - 1 @ nopt = $#argv - 2 set options = ( $argv[1-$nopt] ) set bimg = $argv[$bi] set wimg = $argv[$wi] set btmp = "/tmp/$$-${bimg}" set wtmp = "/tmp/$$-${wimg}" cat ${bimg} | pnmscale ${scalespecs} > ${btmp} cat ${wimg} | pnmscale ${scalespecs} > ${wtmp} linear-ppm-pair-to-gif ${options} ${btmp} ${wtmp} /bin/rm ${btmp} ${wtmp}