about summary refs log tree commit diff
path: root/test/pamenlarge-pamscale-point.test
blob: f0f0948b89ee7dc5b10a719606530fd08523640f (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
#! /bin/bash
# This script tests: pamenlarge pamscale
# Also requires:

tmpdir=${tmpdir:-/tmp}
enlarge_ppm=${tmpdir}/enlarge.ppm

# When scale factor is an integer and the pamscale filter is point (default)
# pamenlarge and pamscale should produce identical output

for option in 1 "2 -filter=point" "3 -linear" "4 -nomix" 5
  do
  scale=${option% *}
  pamenlarge $scale testimg.ppm > ${enlarge_ppm}
  pamscale   $option testimg.ppm | cmp -s - ${enlarge_ppm}  
  echo $option ${PIPESTATUS[@]} ":" $?
  rm  ${enlarge_ppm}  
  done


pamenlarge -xscale=7 -yscale=7 testimg.ppm > ${enlarge_ppm}
pamscale   -xscale=7 -yscale=7 testimg.ppm | cmp -s - ${enlarge_ppm}  
echo 7 ${PIPESTATUS[@]} ":" $?
rm  ${enlarge_ppm}


enlarge_pbm=${tmpdir}/enlarge.pbm

for option in "6 -nomix" "15 -nomix -linear" "24 -nomix"
  do
  scale=${option%% *}
  pamenlarge $scale maze.pbm > ${enlarge_pbm}
  pamscale   $option maze.pbm | cmp -s - ${enlarge_pbm}  
  echo $option ${PIPESTATUS[@]} ":" $?
  rm  ${enlarge_pbm}
  done