Script file generated from LiVES
|1.7
SpinWithDirection
1
William|
Spin Video from Spot|Video appearing from point can spin|1|1|
convert
szoom|_Start zoom eg.2% |num0|2|1|100|
cx|Start Centre on _X|num0|0|0|10000|
cy|Start Centre on _Y|num0|0|0|10000|
spin|_Add spin to frames|bool|1|
nrot|_Number of full rotations|num0|1|1|10|
cw|Spin Clockwise|bool|1|
0x0001
0xF0
$antialias="false";
$resize_ext=$out_ext;
#start by setting zoom to number of frames as this will be used to ccount down to full size pic
$zoom=$end-$start+1;
#calculate how much to grow each time
$xgrowth=(($width/100.0)*(100.0-$p0))/($end-$start+1);
$ygrowth=(($height/100.0)*(100.0-$p0))/($end-$start+1);
#create a blank backing canvas
$bgcolour=&rc_get("bgcolour");
system("$convert_command -size $width!x$height! xc:$bgcolour blank$img_ext");
#calculate degrees to rotate each time and which direction
if ($p3==1)
{
$rotateeachtime=(360.*$p4)/($end-$start+1);
}
if ($p5==1)
{
$rotateeachtime=0.-$rotateeachtime;
}
#calculate where to centre frames and how much to step towards the centre each time
$c_x=$p1;
$c_y=$p2;
$xstep=(($width/2)-$c_x)/($end-$start+1);
$ystep=(($height/2)-$c_y)/($end-$start+1);
$zoom--;
$newwidth=int($width-($xgrowth*$zoom));
$newheight=int($height-($ygrowth*$zoom));
#add step towards centre
$c_x=$c_x+$xstep;
$c_y=$c_y+$ystep;
$s_x=int($c_x-($newwidth/2));
if ($s_x<0) {
$s_x=0;
}
if ($s_x+$newwidth>$width)
{
$s_x=int($width-$newwidth);
}
$s_y=int($c_y-($newheight/2));
if ($s_y<0) {
$s_y=0;
}
if ($s_y+$newheight>$height)
{
$s_y=int($height-$newheight);
}
&resize_frame($name,$newwidth,$newheight);
#if asked for spin
if ($p3==1)
{
$rotateamount=$rotateeachtime*($zoom-1.);
system ("$convert_command -background \"$bgcolour\" $out -rotate $rotateamount $out");
}
system("$composite_command -compose plus -dissolve 100 -geometry $newwidth!x$newheight!+$s_x!+$s_y! $out blank$img_ext $out");
init|$p1_max=$width;$p1=$width/2;$p2_max=$height;$p2=$height/2;