# Automatically derive both Active and Armed state from base image and Active image (2 in 3 out)
#!/bin/sh +xv
#set -o verbose
export IMAGE=$1
export SIZEX=$3
export SIZEY=$4
export TmpDIR=$5
export VERBOSE=

export EICONH_GAIN=1.4

export ICON128ACTIVE_DROPSHADOW="-o 12 12 -b 12  -B 0 0 0 0  -S 0 0 0 96"
export ICON128ARM_DROPSHADOW="-o 3 3 -b 5     -B 0 0 0 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="-c 0 0 0 0  -B 0 0 0 0"

export ICON128ACTIVE_CROP="-c -12 -12 -12 -12  -B 0 0 0 0"

export ICON128ARM_CROP="-c 3 0 3 0  -B 0 0 0 0"


$iDS  -o 12 12  -b 16  -B 0 0 0 0  -S 16 16 16 96  Icons/images/$IMAGE.sgi $TmpDIR/.sgi
$iCR $EITHREADS $ICON128_CROP $TmpDIR/$IMAGE.sgi $TmpDIR/.sgi
$iS -ma $EITHREADS -s $SIZEX $SIZEY  $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 $ICON128ACTIVE_CROP $TmpDIR/$IMAGE.sgi $TmpDIR/.sgi
$iS -ma $EITHREADS -s $SIZEX $SIZEY  $TmpDIR/$IMAGE.sgi $TmpDIR/$IMAGE-Active.c
$iCN $EITHREADS -c $EICONH_GAIN  Icons/images/$IMAGE-Active.sgi $TmpDIR/$IMAGE.sgi
$iDS $ICON128ARM_DROPSHADOW $TmpDIR/$IMAGE.sgi $TmpDIR/.sgi
$iCR $EITHREADS $ICON128ARM_CROP $TmpDIR/$IMAGE.sgi $TmpDIR/.sgi
$iS -ma $EITHREADS -s $SIZEX $SIZEY $TmpDIR/$IMAGE.sgi $TmpDIR/$IMAGE-Armed.c
cat $TmpDIR/$IMAGE.c $TmpDIR/$IMAGE-Active.c $TmpDIR/$IMAGE-Armed.c > $TmpDIR/$IMAGE-all.c
