Spinner


Author V. C. Mohan
Date Aug 2014
EMail: mohanvc

Spinner plugin for Avisynth 2.5+ version, is free to use under GPL 3 licence.

Spinner plugin rotates a frame or selected part of it about the given axis coordinates in floating point precision. It displays the common area of the rotated disc and a specified rectangular area. Thus a thin strip can be rotated about an axis situated outside of it (appears as cartwheeling). Either the original clip or a different clip can be used as background or a chosen color can be painted in areas not undergoing rotation.

Quality of processing q can be Nearest neighbour, bilinear,Lagrange and Lanczos interpolations. Location precision p in quantiles can be specified.

Facility to linearly vary over the clip most of the parameters is provided. The variation will be from starting input frame to ending input frame. If opted it checks whether the axis and the rotating disc are outside the frame. and whether atleast a part of the rectangular strip to be shown cartwheeling is within the rotating disc. Eventhough a part of rotating disc can be located outside frame by choosing the axis coordinates beyond frame boundary, it will not make much sense as parts of the display will go blank. However the radius of disc can be choosen larger to ensure the full frame is rotated. In that case specify check as false

This plugin works in all avisynth version supported color spaces.


Details of parameters
Description Name Type Limits Default
Input clip clip none
(initial) radius of rotating disc r integer more than 0 if check is true half of smaller side of frame, otherwise half of diagonal of frame
(initial) angle of rotation in degrees angle float no limit. +ve clockwise 90
(initial) x coordinate of rotation axis x float atleast part of disc should be in frame width/2
(initial) y coordinate of rotation axis y float atleast part of disc should be in frame height/2
interpolation quality q integer 0 : nearest neighbour, 1 : bilinear, 2 :Lagrange 4 point 3 : Lagrange 6 point, 4 : Lanczos 4 point, 5 : Lanczos 6 point 5{lanczos 6 pt)
Is background clip frame (original or different) or colored bg boolean true for clip frame, false for painting color true
background color if background coloring is opted color integer in RRGGBB format 0
clip for background tclip clip if not specified and bg is true then original clip is used as backgound none.
end radius of rotating disc er integer more than 0 r
end angle of rotation in degrees eangle float no limit. -ve clockwise angle
end x coordinate of rotation axis ex float atleast part of disc should be in frame x
end y coordinate of rotation axis ey float atleast part of disc should be in frame y
(initial) left x coordinate of rctangle to display lx integer should be in frame 0
(initial) right x coordinate of rectangle to display rx integer should be in frame width - 1
(initial) top y coordinate of rctangle to display ty integer should be in frame 0
(initial) bottom y coordinate of rectangle to display by integer should be in frame height - 1
end left x coordinate of rctangle to display elx integer should be in frame lx
end right x coordinate of rectangle to display rx integer should be in frame rx
end top y coordinate of rctangle to display ety integer should be in frame ty
end bottom y coordinate of rectangle to display eby integer should be in frame by
location percentile accuracy p integer should be 5 to 100 50
do you need a error message if this rectangle is outside rotation disc and if even part of disc is out of frame? check boolean true for yes, false for do not check true

Usage examples
#Spinner()
im1 = imagereader("E:\images\canyon.jpg", end = 21).converttoRGB24()
r1=Spinner(im1,q = 0, angle = 240, eangle = 4800, lx = 100, rx = 400, ty = 200, by = 250, check = false)
r2=Spinner(im1,q = 2, angle = 240,  x = 210.4, y = 188.6, r=140)


Images with above script.
r1


r2
To my index page
To Avisynth