Identify the size and format from the test output filename, and pass
to raw2rgbpnm for conversion to a PNM file.
From there we can convert easily to a PNG output file.
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-SCRIPTS=logger.sh vsp-lib.sh
+SCRIPTS=$(wildcard *.sh)
all:
--- /dev/null
+#!/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