From b53924ca320e6ac8607a76d66cf7a7249f7b248a Mon Sep 17 00:00:00 2001 From: paul Date: Tue, 8 Nov 2011 19:27:54 +0000 Subject: [PATCH] parallelization of jpg-conversion to make use of multiple processors svn path=/trunk/; revision=7 --- stereofy.sh | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/stereofy.sh b/stereofy.sh index a97e5b9..51cbfb1 100755 --- a/stereofy.sh +++ b/stereofy.sh @@ -48,19 +48,15 @@ done [ -z "$param" ] && param="-$algo$model" [ -z "$stereo" ] && stereo="${left}_stereo.jpg" +echo -n preparing... geom=$(identify "$left" |sed -rn 's:^.* ([0-9]+x[0-9]+) .*$:\1:gp') +tmp=$(tempfile -d /tmp -p strfy) +rm "$tmp" +mkfifo "$tmp" -echo -n bitmapping... -stream "$left" "$left.bts" -stream "$right" "$right.bts" - +convert "$left" rgb:- >"$tmp" & echo -n anaglyphing... -anaglyph "$param" "$left.bts" "$right.bts" "$stereo.bts" - -if [ $? = 0 ]; then - echo -n converting... - convert -depth 8 -size "$geom" "rgb:$stereo.bts" "$stereo" -fi +convert "$right" rgb:- |anaglyph "$param" "$tmp" /dev/stdin /dev/stdout |convert -depth 8 -size "$geom" rgb:- "$stereo" echo cleaning... -rm "$left.bts" "$right.bts" "$stereo.bts" 2>/dev/null +rm "$tmp" -- 2.39.2