diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile | 2 | ||||
-rwxr-xr-x | scripts/bin2png.sh | 25 |
2 files changed, 26 insertions, 1 deletions
diff --git a/scripts/Makefile b/scripts/Makefile index 8c452f4..6586b29 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -1,4 +1,4 @@ -SCRIPTS=logger.sh vsp-lib.sh +SCRIPTS=$(wildcard *.sh) all: diff --git a/scripts/bin2png.sh b/scripts/bin2png.sh new file mode 100755 index 0000000..88726aa --- /dev/null +++ b/scripts/bin2png.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +FILE="$1" + +PNM=${FILE/%bin/pnm} +PNG=${FILE/%bin/png} + +fmt=$(echo $FILE | sed -e 's|.*-\([[:alnum:]]*\)-\([0-9]*x[0-9]*\).*.bin|\1|' | tr '[:lower:]' '[:upper:]') +size=$(echo $FILE | sed -e 's|.*-\([[:alnum:]]*\)-\([0-9]*x[0-9]*\).*.bin|\2|') + +case $fmt in + yuv*|yvu*) + fmt=$(echo $fmt | tr 'M' 'P') + ;; + nv*) + fmt=$(echo $fmt | tr -d 'M') + ;; + *rgb*) + fmt=$(echo $fmt | tr -d 'AX') + ;; +esac + +raw2rgbpnm -s $size -f $fmt $FILE $PNM && \ + convert $PNM $PNG +rm $PNM |