2 # Copyright 2011 Paul Hänsch
3 # This file is part of Stereofy
5 # Stereofy is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # Stereofy is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with Stereofy. If not, see <http://www.gnu.org/licenses/>.
18 algo="d" #algorythm, Dubois by default
19 model="rc" #color model, red-cyan by default
20 param="" #leave blank, will be -$algo$model
27 -d|--dubois) algo="d";;
28 -f|--full|--full-color) algo="f";;
29 -h|--half|--half-color) algo="d";;
30 -rc|--rc|--red-cyan) model="rc";;
31 -mc|--mc|--magenta-cyan) model="mc";;
32 -gm|--gm|--green-magenta) model="gm";;
33 -ab|--ab|--amber-blue|--yellow-blue) model="ab";;
34 -[dfh]rc|-[dfh]gm|-[fe]mc|-dab) param="$1";;
35 -*) echo "no such color model" >/dev/stderr; exit 1;;
36 *) if [ -z "$left" ]; then
38 elif [ -z "$right" ]; then
40 elif [ -z "$stereo" ]; then
48 [ -z "$param" ] && param="-$algo$model"
49 [ -z "$stereo" ] && stereo="${left}_stereo.jpg"
51 geom=$(identify "$left" |sed -rn 's:^.* ([0-9]+x[0-9]+) .*$:\1:gp')
54 stream "$left" "$left.bts"
55 stream "$right" "$right.bts"
57 echo -n anaglyphing...
58 anaglyph "$param" "$left.bts" "$right.bts" "$stereo.bts"
62 convert -depth 8 -size "$geom" "rgb:$stereo.bts" "$stereo"
66 rm "$left.bts" "$right.bts" "$stereo.bts" 2>/dev/null