#!/usr/bin/perl -w # RIGHT HAND TILES -- SEQUENCE 3 # # Greg Ercolano 2008 # my $frm = 1; my $filename = defined($ARGV[0]) ? $ARGV[0] : "out"; my $comp = "$filename-right-comp.jpg"; my $stripw = 7; # width of resulting image strips my $compw = 3000; # comp image's width my $comph = 400; # comp image's height my $x = $compw-7; # 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-%04d.bmp", $frm); $frm++; 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); } # if ( $count++ > 15 ) { exit(0); } $x -= $stripw; if ( $x <= 0 ) { print "HIT END OF TILED IMAGE\n"; exit(0); } }