]> git.plutz.net Git - stereofy/commitdiff
bugfix for magenta cyan parameter parsing, also change working of vjust and hjust...
authorpaul <paul@plutz.net>
Mon, 10 Dec 2012 22:38:36 +0000 (22:38 +0000)
committerpaul <paul@plutz.net>
Mon, 10 Dec 2012 22:38:36 +0000 (22:38 +0000)
svn path=/trunk/; revision=9

stereofy.sh

index 9b54bb70bf41b0e86d2251e654b9b3d736b3da38..4e2da59f3e5077b3acc85307fd7557c23e6a4a0c 100755 (executable)
@@ -32,7 +32,7 @@ while [ -n "$1" ]; do
   case "$1" in
     -d|--dubois) algo="d";;
     -f|--full|--full-color) algo="f";;
   case "$1" in
     -d|--dubois) algo="d";;
     -f|--full|--full-color) algo="f";;
-    -h|--half|--half-color) algo="d";;
+    -h|--half|--half-color) algo="h";;
     -rc|--rc|--red-cyan) model="rc";;
     -mc|--mc|--magenta-cyan) model="mc";;
     -gm|--gm|--green-magenta) model="gm";;
     -rc|--rc|--red-cyan) model="rc";;
     -mc|--mc|--magenta-cyan) model="mc";;
     -gm|--gm|--green-magenta) model="gm";;
@@ -52,6 +52,13 @@ while [ -n "$1" ]; do
   esac
   shift 1;
 done
   esac
   shift 1;
 done
+
+if [ "$model" = 'mc' -a "$algo" != 'f' ]; then
+  echo 'INFO: using experimental color optimizations for magenta cyan anaglyph images.'
+  echo '      Specify --full to generate a full-color magenta cyan image.'
+  algo="e"
+fi
+
 if (echo $vert |egrep -qx '[+-]*[0-9]*[02468]'); then true
 else
   echo 'vertical alignment must be an even number'
 if (echo $vert |egrep -qx '[+-]*[0-9]*[02468]'); then true
 else
   echo 'vertical alignment must be an even number'
@@ -73,17 +80,17 @@ height=$(echo $geom |cut -dx -f2)
 
 if [ "$vert" -gt 0 ]; then
   height=$(($height - $vert / 2))
 
 if [ "$vert" -gt 0 ]; then
   height=$(($height - $vert / 2))
-  lvoff=$(($vert / 3))
+  rvoff=$(($vert / 2))
 elif [ "$vert" -lt 0 ]; then
   height=$(($height - $vert / -2))
 elif [ "$vert" -lt 0 ]; then
   height=$(($height - $vert / -2))
-  rvoff=$(($vert / -2))
+  lvoff=$(($vert / -2))
 fi
 if [ "$hor" -gt 0 ]; then
   width=$(($width - $hor / 2))
 fi
 if [ "$hor" -gt 0 ]; then
   width=$(($width - $hor / 2))
-  lhoff=$(($hor / 2))
+  rhoff=$(($hor / 2))
 elif [ "$hor" -lt 0 ]; then
   width=$(($width - $hor / -2))
 elif [ "$hor" -lt 0 ]; then
   width=$(($width - $hor / -2))
-  rhoff=$(($hor / -2))
+  lhoff=$(($hor / -2))
 fi
 geom="${width}x${height}"
 lcrop="${geom}+${lhoff}+${lvoff}"
 fi
 geom="${width}x${height}"
 lcrop="${geom}+${lhoff}+${lvoff}"