# Automatically derive both Active and Armed state from base image
#!/bin/sh +xv
#set -o verbose
export IMAGE=$1
export TmpDIR=$2

export EICONH_GAIN=1.4
export VERBOSE=

export ICON128ACTIVE_DROPSHADOW="-o 12 12 -b 12  -B 32 32 32 0  -S 0 0 0 96"
export ICON128ARM_DROPSHADOW="-o 3 3 -b 5     -B 32 32 32 0  -S 0 0 0 96"

# The more we crop here, the bigger the icon image will be,
# because it is then scaled to a fixed size...
#

export ICON128_CROP="0 0 0 0"

export ICON128ACTIVE_CROP="-12 -12 -12 -12"

export ICON128ARM_CROP="3 0 3 0"

export ICON128BIG_CROP="0 0 0 0"


$iCS -c 0.0 Icons/images/$IMAGE.sgi $TmpDIR/$IMAGE.sgi
$iDS  -o 12 12  -b 16  -B 32 32 32 0  -S 0 0 0 255  $TmpDIR/$IMAGE.sgi $TmpDIR/.sgi
$iCR $EITHREADS -c $ICON128_CROP $TmpDIR/$IMAGE.sgi $TmpDIR/.sgi
$iS -ma $EITHREADS -s 36 36 -b 0.75 $TmpDIR/$IMAGE.sgi $TmpDIR/.c
$iCN $EITHREADS -c $EICONH_GAIN Icons/images/$IMAGE.sgi $TmpDIR/.sgi
$iDS $ICON128ACTIVE_DROPSHADOW $TmpDIR/$IMAGE.sgi $TmpDIR/.sgi
$iCR $EITHREADS -c $ICON128ACTIVE_CROP $TmpDIR/$IMAGE.sgi $TmpDIR/.sgi
$iS -ma $EITHREADS -s 36 36 -b 0.75 $TmpDIR/$IMAGE.sgi $TmpDIR/$IMAGE-Active.c
$iCN $EITHREADS -c 1.1 Icons/images/$IMAGE.sgi $TmpDIR/.sgi
$iDS $ICON128ARM_DROPSHADOW $TmpDIR/$IMAGE.sgi $TmpDIR/.sgi
$iCR $EITHREADS -c $ICON128ARM_CROP $TmpDIR/$IMAGE.sgi $TmpDIR/.sgi
$iS -ma $EITHREADS -s 36 36 -b 0.75 $TmpDIR/$IMAGE.sgi $TmpDIR/$IMAGE-Armed.c;rm $TmpDIR/$IMAGE.sgi
cat $TmpDIR/$IMAGE.c $TmpDIR/$IMAGE-Active.c $TmpDIR/$IMAGE-Armed.c > $TmpDIR/$IMAGE-all.c;rm -f $TmpDIR/$IMAGE.c $TmpDIR/$IMAGE-Active.c $TmpDIR/$IMAGE-Armed.c
