Turn


Author V. C. Mohan
1 Oct 2020
EMail: mohanvc

Turn function rotates a frame or selected part of it about the specified fulcrum. The function accepts all avisynth+ supported RGB, YUY2 and Planar YUV in all bit depths. This is thread safe. MT_NICE_FILTER . It displays the the rotated disc visible in specified rectangule. 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.

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

Many of the parameters may be linearly varied over the clip length. The variation will be from starting input frame to ending input frame. it checks whether atleast a part of the rotating area is within frame. 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.
Details of parameters
Description Name Type Limits Default
Input clip clip none
clip for background bg clip if not specified original clip is used as backgound none.
(initial) radius of rotating disc r integer more than 0 half of diagonal of frame
(initial) angle of rotation in degrees angle float no limit. +ve clockwise 45
(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 type q integer 1 : nearest neighbour, 2 : bilinear 2x2, 3 : Bicubic 4x4 4 :Lanczos 6x6 3 (Bicubic)
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 2 to 10 4
Are coordinates normalized? norm boolean true, false false

Usage examples


im1 = imagereader(................).converttoRGB24()
r1=Turn(im1,q = 0, angle = 240, eangle = 4800, lx = 100, rx = 400, ty = 200, by = 250)
r2=Turn(im1,q = 2, angle = 240,  x = 210.4, y = 188.6, r=140)


Images examples.
r1


r2
To my index page down loadmanyPlus plugin To Avisynth