1 | #!/bin/sh |
---|
2 | # |
---|
3 | # Tests for the GIFLIB utilities. |
---|
4 | # Usage: |
---|
5 | # test-unx [display_prgm] |
---|
6 | # |
---|
7 | # This test assumes the gif_lib utilities are available from one of the |
---|
8 | # path directories, and that GIF_DIR is set (directly or through command line) |
---|
9 | # to the directory holding these gif files: |
---|
10 | # 1. solid2.gif |
---|
11 | # 2. cover.gif |
---|
12 | # 3. porsche.gif |
---|
13 | # In addition, set GIF_DISPLAY ( directly or through command line) to the |
---|
14 | # program to display gif files in our system. |
---|
15 | # |
---|
16 | # Gershon Elber, Feb 90. Rewritten by Eric Raymond, December 1995. |
---|
17 | # Revised by Toshio Kuratomi December 1998. |
---|
18 | PATH=$PATH:./util:${SRCDIR}/util |
---|
19 | GIF_DIR=${SRCDIR}./pic |
---|
20 | GIF_DISPLAY=${1:-xv -} |
---|
21 | GIF_DISPLAY=${GIF_DISPLAY:-gif2x11} |
---|
22 | #GIF_DIR=${1:-./pic} |
---|
23 | #GIF_DISPLAY=${2:-gif2x11} |
---|
24 | |
---|
25 | echo "The Porsche." |
---|
26 | echo "$GIF_DISPLAY <$GIF_DIR/porsche.gif" |
---|
27 | |
---|
28 | echo "The Porsche composited with a generated background" |
---|
29 | util/gifbg -d tl -s 320 200 -c 255 255 255 -l 64 > bg1.gif |
---|
30 | util/gifcomb $GIF_DIR/porsche.gif bg1.gif | $GIF_DISPLAY |
---|
31 | rm -f bg1.gif |
---|
32 | |
---|
33 | echo "Color density report on the TNHD cover image" |
---|
34 | util/gifhisto -t $GIF_DIR/cover.gif | sort -r | more |
---|
35 | |
---|
36 | echo "Color histogram of the Porsche image" |
---|
37 | util/gifhisto -b -s 200 512 $GIF_DIR/porsche.gif | util/gifflip -l | $GIF_DISPLAY |
---|
38 | |
---|
39 | echo "The #2 solid flipped on its side" |
---|
40 | util/gifflip -r $GIF_DIR/solid2.gif | util/gifrsize | $GIF_DISPLAY |
---|
41 | |
---|
42 | echo "TNHD cover flipped on its side" |
---|
43 | util/gifflip -x $GIF_DIR/cover.gif | $GIF_DISPLAY |
---|
44 | |
---|
45 | echo "Scale the #2 solid by 0.45" |
---|
46 | cp $GIF_DIR/solid2.gif sall.gif |
---|
47 | util/gifrsize -s 0.45 sall.gif | $GIF_DISPLAY |
---|
48 | rm -f s?.gif sall.gif |
---|
49 | |
---|
50 | echo "Reposition the Porsche image" |
---|
51 | util/gifpos -s 720 348 -i 400 148 $GIF_DIR/porsche.gif | $GIF_DISPLAY |
---|
52 | |
---|
53 | echo "Resize the #2 solid image" |
---|
54 | util/gifrsize -S 800 600 $GIF_DIR/solid2.gif | $GIF_DISPLAY |
---|
55 | |
---|
56 | echo "Clip, crop, and resize the #2 solid image" |
---|
57 | util/gifclip -i 222 0 390 134 $GIF_DIR/solid2.gif | util/gifpos -s 169 135 | util/gifrsize -s 2.0 | $GIF_DISPLAY |
---|
58 | |
---|
59 | echo "Rotate the cover image by 45 degrees" |
---|
60 | util/gifrotat -a 45 $GIF_DIR/cover.gif | $GIF_DISPLAY |
---|
61 | |
---|
62 | echo "Copy the Porsche image (test DGifSlurp and DGifSpew)" |
---|
63 | util/gifspnge <$GIF_DIR/porsche.gif | $GIF_DISPLAY |
---|
64 | |
---|
65 | echo "Copy a transparent image (test extensions)" |
---|
66 | util/gifspnge <$GIF_DIR/x-trans.gif |$GIF_DISPLAY |
---|
67 | |
---|
68 | # echo "Copy an animated gif, that has shared colour maps" |
---|
69 | # util/gifspnge <$GIF_DIR/welcome2.gif | $GIF_DISPLAY |
---|