#!/bin/sh

# file: $USFS/util/pcd_to_ppm/v1.0/pcd_to_ppm.sh
#
# this is a shellscript that converts pcd files to pcm.
#

# important definitions
#
IMAGE_EXE="$USFS/bin/$ISIP_BINARY/hpcdtoppm";
IMAGE_FORMAT="-4";
PPM_EXT=".ppm";

# loop over all arguments
#
for arg do

    # convert the filename from the pcd to ppm extension
    #
    name_dir=`dirname $arg`;
    name_file=`basename $arg`;
    name_file=`echo $name_file | cut -f1 -d'.'`;
    output_file="$name_dir""/""$name_file""$PPM_EXT";

    # run the conversion
    #
    echo "converting $arg to $output_file""..."
    $IMAGE_EXE $IMAGE_FORMAT $arg $output_file

done

# end of file
#

