about summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xconverter/ppm/hpcdtoppm/pcdovtoppm25
-rwxr-xr-xeditor/pnmindex.sh32
-rwxr-xr-xeditor/pnmmargin5
-rwxr-xr-xeditor/pnmquantall5
-rwxr-xr-xgenerator/ppmrainbow7
5 files changed, 46 insertions, 28 deletions
diff --git a/converter/ppm/hpcdtoppm/pcdovtoppm b/converter/ppm/hpcdtoppm/pcdovtoppm
index b86048cc..7d8eb5c2 100755
--- a/converter/ppm/hpcdtoppm/pcdovtoppm
+++ b/converter/ppm/hpcdtoppm/pcdovtoppm
@@ -144,7 +144,7 @@ tempdir=$(mktemp -d "${TMPDIR:-/tmp}/pcdovtoppm.XXXXXXXX") ||
     { echo "Could not create temporary file. Exiting." 1>&2; exit 1; }
 trap 'rm -rf $tempdir' 0
 
-tmpfile=`tempfile -p pi -m 600`
+tmpfile=$(tempfile -p pi -m 600)
 
 # Convert the PCD overview file to many PPM images
 if [ -f $1 ] ; then
@@ -183,11 +183,12 @@ do
     ttext="$i:t"
 
     if [ "$back" = "-white" ] ; then
-        pbmtext $font "$ttext" | pnmcrop -quiet | pnmmargin -white 2| \
-        pnmcat $back -tb $tmpfile - > $imagefile
+        pbmtext $font "$ttext" | pnmcrop -quiet | pnmmargin -white 2 | \
+        pamcat -extendplane $back -topbottom $tmpfile - > $imagefile
     else
         pbmtext $font "$ttext" | pnmcrop -quiet | pnmmargin -white 2 | \
-        pnminvert | pnmcat $back -tb $tmpfile - > $imagefile
+          pnminvert | \
+          pamcat -extendplane $back -topbottom $tmpfile - > $imagefile
     fi
 
     rm -f $tmpfile
@@ -199,9 +200,9 @@ do
         rowfile=${tempdir}/pi.${row}
         rm -f $rowfile
     if [ "$colors" = "n" ] ; then
-        pnmcat $back -lr -jbottom $imagefiles > $rowfile
+        pamcat -extendplane $back -leftright -jbottom $imagefiles > $rowfile
     else
-        pnmcat $back -lr -jbottom $imagefiles | \
+        pamcat -extendplane $back -leftright -jbottom $imagefiles | \
         ppmquant -quiet $colors > $rowfile
     fi
     rm -f $imagefiles
@@ -219,10 +220,10 @@ if [ -n $imagefiles ] ; then
     rowfile=${tempdir}/pi.${row}
     rm -f $rowfile
     if [ "$colors" = "n" ] ; then
-        pnmcat $back -lr -jbottom $imagefiles > $rowfile
+        pamcat -extendplane $back -leftright -jbottom $imagefiles > $rowfile
     else
-        pnmcat $back -lr -jbottom $imagefiles | \
-        ppmquant -quiet $colors > $rowfile
+        pamcat -extendplane $back -leftright -jbottom $imagefiles | \
+          ppmquant -quiet $colors > $rowfile
     fi
     rm -f $imagefiles
     rowfiles="$rowfiles $rowfile"
@@ -232,9 +233,11 @@ if [ $(echo $rowfiles|wc -w) -eq 1 ] ; then
     ppmtoppm $plainopt < $rowfiles
 else
     if [ "$colors" = "n" ] ; then
-        pnmcat $back -tb $plainopt $rowfiles
+        pamcat -extendplane $back -topbottom $rowfiles | \
+          ppmtoppm $plainopt
     else
-        pnmcat $back -tb $rowfiles | ppmquant $plainopt -quiet $colors
+        pamcat -extendplane $back -tb $rowfiles | \
+          ppmquant $plainopt -quiet $colors
     fi
 fi
 
diff --git a/editor/pnmindex.sh b/editor/pnmindex.sh
index dfc5b82a..ef468fc3 100755
--- a/editor/pnmindex.sh
+++ b/editor/pnmindex.sh
@@ -155,9 +155,12 @@ for i in "$@"; do
     imagefile=$tempdir/pi.${row}.${col}
     rm -f $imagefile
     if [ "$back" = "-white" ]; then
-        pbmtext "$i" | pnmcat $back -tb $tmpfile - > $imagefile
+        pbmtext "$i" | \
+          pamcat -extendplane $back -topbottom $tmpfile - > $imagefile
     else
-        pbmtext "$i" | pnminvert | pnmcat $back -tb $tmpfile - > $imagefile
+        pbmtext "$i" | \
+          pnminvert | \
+          pamcat -extendplane $back -topbottom $tmpfile - > $imagefile
     fi
     imagefiles=( ${imagefiles[*]} $imagefile )
 
@@ -166,10 +169,12 @@ for i in "$@"; do
         rm -f $rowfile
 
         if [ $maxformat != PPM -o "$doquant" = "false" ]; then
-            pnmcat $back -lr -jbottom ${imagefiles[*]} > $rowfile
+            pamcat -extendplane $back -leftright -jbottom ${imagefiles[*]} \
+              > $rowfile
         else
-            pnmcat $back -lr -jbottom ${imagefiles[*]} | \
-            pnmquant -quiet $colors > $rowfile
+            pamcat -extendplane $back -leftright -jbottom ${imagefiles[*]} | \
+              pnmquant -quiet $colors \
+              > $rowfile
         fi
 
         rm -f ${imagefiles[*]}
@@ -190,22 +195,27 @@ if [ ${#imagefiles[*]} -gt 0 ]; then
     rowfile=$tempdir/pi.${row}
     rm -f $rowfile
     if [ $maxformat != PPM -o "$doquant" = "false" ]; then
-        pnmcat $back -lr -jbottom ${imagefiles[*]} > $rowfile
+        pamcat -extendplane $back -leftright -jbottom ${imagefiles[*]} \
+          > $rowfile
     else
-        pnmcat $back -lr -jbottom ${imagefiles[*]} | \
-        pnmquant -quiet $colors > $rowfile
+        pamcat -extendplane $back -leftright -jbottom ${imagefiles[*]} | \
+          pnmquant -quiet $colors > \
+          $rowfile
     fi
     rm -f ${imagefiles[*]}
     rowfiles=( ${rowfiles[*]} $rowfile )
 fi
 
 if [ ${#rowfiles[*]} -eq 1 ]; then
-    cat $rowfiles
+    pnmtopnm $rowfiles
 else
     if [ $maxformat != PPM -o "$doquant" = "false" ]; then
-        pnmcat $back -tb ${rowfiles[*]}
+        pamcat -extendplane $back -topbottom ${rowfiles[*]} |\
+          pnmtopnm
     else
-        pnmcat $back -tb ${rowfiles[*]} | pnmquant -quiet $colors
+        pamcat -extendplane $back -topbottom ${rowfiles[*]} | \
+          pnmquant -quiet $colors | \
+          pnmtopnm
     fi
 fi
 rm -f ${rowfiles[*]}
diff --git a/editor/pnmmargin b/editor/pnmmargin
index e8851bda..6b30c074 100755
--- a/editor/pnmmargin
+++ b/editor/pnmmargin
@@ -101,8 +101,9 @@ else
     pamflip -rotate90 $tmp2 > $tmp3
 
     # Cat things together.
-    pnmcat -lr $tmp2 $tmp1 $tmp2 > $tmp4
-    pnmcat -tb $plainopt $tmp3 $tmp4 $tmp3
+    pamcat -extendplane -leftright $tmp2 $tmp1 $tmp2 > $tmp4
+    pamcat -extendplane -topbottom $tmp3 $tmp4 $tmp3 | \
+      pnmtopnm $plainopt
 fi
 
 
diff --git a/editor/pnmquantall b/editor/pnmquantall
index 5f434fc2..b818ef07 100755
--- a/editor/pnmquantall
+++ b/editor/pnmquantall
@@ -145,11 +145,12 @@ sub tempFile($) {
 sub makeColorMap($$$$) {
     my ($fileNamesR, $newColorCt, $colorMapFileName, $errorR) = @_;
 
-    my $pnmcatCmd = "pnmcat -topbottom -white -jleft @{$fileNamesR}";
+    my $pamcatCmd = \
+       "pamcat -extendplane -topbottom -white -jleft @{$fileNamesR}";
 
     my $pnmcolormapCmd = "pnmcolormap $newColorCt";
 
-    my $makeMapCmd = "$pnmcatCmd | $pnmcolormapCmd >$colorMapFileName";
+    my $makeMapCmd = "$pamcatCmd | $pnmcolormapCmd >$colorMapFileName";
 
     my $termStatus = system($makeMapCmd);
 
diff --git a/generator/ppmrainbow b/generator/ppmrainbow
index a5c2689d..10b1f7ae 100755
--- a/generator/ppmrainbow
+++ b/generator/ppmrainbow
@@ -126,8 +126,11 @@ while (@colorlist >= 2) {
     shift @colorlist;
 }
 
-0 == system qq{$verboseCommand pnmcat -lr @outlist}
-    or exit 1;
+my $termStat =
+    system("$verboseCommand pamcat -leftright @outlist | ppmtoppm");
+if ($termStat != 0) {
+    exit 1;
+}
 
 exit 0;