#!/usr/bin/perl -w # LEFT HAND TILES IN SEQUENCE #2 # # Greg Ercolano 2008 # my $frm = 546; # start frame my $efrm = -1; # end frame (-1=entire range) my $filename = defined($ARGV[0]) ? $ARGV[0] : "out"; my $comp = "$filename-left-seq2-comp.jpg"; my $stripw = 15; # width of resulting image strips my $compw = 500; # comp image's width my $comph = 400; # comp image's height my $x = 0; # starting X position (at right of comp image) # CREATE EMPTY COMP IMAGE unlink($comp); system("convert -size ${compw}x${comph} 'XC:#000000' $comp"); while ( 1 ) { my $in = sprintf("$filename-persp-left-%04d.bmp", $frm); if ( $frm++ > $efrm && $efrm != -1 ) { print "--- REACHED SPECIFIED END FRAME $efrm\n"; exit(0); } if ( ! -r $in ) { print "--- NO MORE FRAMES\n"; exit(0); } print STDERR "Reading $in\n"; my $compcmd = "composite -geometry +$x+0 $in $comp $comp"; print STDERR " Executing: $compcmd\n"; if ( system($compcmd) != 0 ) { print STDERR "--- COMP FAILED\n"; exit(1); } $x += $stripw; if ( $x >= $compw ) { print "HIT END OF TILED IMAGE\n"; exit(0); } }