1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-11-29 12:32:28 +02:00
ben-wpan/scripts/schps2ppm
Werner Almesberger 78f6cfbfda Attempt at avoiding the false changes seen on Xue. Seems that alpha-blending
produces minute differences where there should be none.

- scripts/ppmdiff/ppmdiff.c (diff): instead of looking for all or noting
  changes, also detect gradual changes
- scripts/ppmdiff/ppmdiff.c (diff, main): don't mark areas with differences
  in the main images if using shadow images
- scripts/schps2ppm: new option to disable alpha blending
- scripts/schhist2web: cache pixmaps with default line thickness and no
  alpha blending in hard_*
- scripts/schhist2web: base marking of areas with differences exclusively
  on the hard_* pixmaps
2010-08-30 15:11:43 -03:00

58 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
#
# schps2ppm - Generate PPM files from normalized Eeschema Postscript
#
# Written 2010 by Werner Almesberger
# Copyright 2010 Werner Almesberger
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
RES=1280x850
usage()
{
cat <<EOF 1>&2
usage: $0 [options] [file.ps [file.ppm]]
-n disable alpha blending
-r XxY image resolution (default: $RES)
EOF
exit 1
}
alpha=true
while true; do
case "$1" in
-n) alpha=false
shift;;
-r) [ -z "$2" ] && usage
RES="$2"
shift 2;;
-) break;;
-*) usage;;
*) break;;
esac
done
[ ! -z "$3" ] && usage
in=${1:--}
out=${2:-/dev/stdout}
X=`echo $RES | sed 's/x.*//'`
Y=`echo $RES | sed 's/.*x//'`
IRES=${Y}x$X
res=`expr 72 \* $X / 800`
cat "$in" |
gs -sDEVICE=ppmraw -sOutputFile=- -g$IRES -r$res \
`$alpha && echo '' -dTextAlphaBits=4 -dGraphicsAlphaBits=4` \
-q - |
pnmflip -r270 >"$out"