Pattern


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

This function creates some patterns on input which may be useful to test software.

Type of patterns available are dirac, circular, step, zcos and sine


dirac makes a single pixel at specified x,y location and color. Default is center of frame and white color.
circular creates a filled circle of specified radius and color with center at specified x and y. Part of circle must be atleast visible. If spk then x, y should be within frame.
step creates binary zones (step like pattern) in opted color and orientation. The zone color alternates between input frame and specified color. If opted, it overlays this pattern on input image..
zcos creates a cosine squared pattern in specified color and orientation. If opted, it overlays this pattern on input image.
sine creates sinusoidal function of specified color and orientation. If opted, it overlays this pattern on input image.
The patterns slowly move in a video if stat is set to false (default), otherwise it remains constant.
Details of parameters
Description Name Type Limits Default
Input clip clip none
type of pattern type string "dirac", "circular" "step" "zcos" and "sine" "sine"
x coordinate of pattern center x integer For dirac within frame. Rest reasonable value. width / 2
y coordinate of dirac y integer should be in frame for dirac. other patterns reasonable value height/2
radius of circular pattern r integer at least part of circle should be visible width/8
wave length of patterns of step, zcos and sine wl integer reasonable value width/16
orientation of pattern orient string "circ", "vert" and "hor" "circ"
Whether center of "circular" pattern have a spike? spk boolean false / true false
spike value spike floating point 0.004f to 0.99f 0.01f
overlay %age of input and pattern overlay integer 0 to 99 if 0 Color value is used 90
Is pattern static in the video? stat boolean true or false false
color of pattern if overlay = 0 color integer in RRGGBB format $ffffff

Usage examples
#avisource("c:\.............rl.avi")
#blankClip ( color = 0)
#blankClip ( color = $5500)
#Pattern()
#p = Pattern(type="step",orient = "circ",x = -2000, y = 250,wl = 24,color = $ff77ff, overlay = 95)
#p = Pattern(type="step",orient = "vert",x = 0, y = 250,wl = 64,color = $ff77ff)
#p = Pattern(type="step",orient = "hor", x = 200, y = 0,wl = 64,color = $ff77ff)
#p = Pattern(type="zcos",orient = "vert",x = -50, y = 250,wl = 64,color = $ff77ff, stat = true)
#p = Pattern(type="zcos",orient = "hor", x = 200, y = 50,wl = 64,color = $ff77ff)
#p = Pattern(type="zcos",orient = "circ",x = 2800, y = 50,wl = 124,color = $ff77ff, overlay = 50)
#p = Pattern(type="sine",orient = "vert",x = 200, y = 250,wl = 64,color = $ff77ff)
#p = Pattern(type="sine",orient = "hor", x = 200, y = 250,wl = 164,color = $ff77, stat = true)
#p = Pattern(type="sine",orient = "circ",x = -200, y = 250,wl = 24,color = $ffffff, overlay = 90)
To my index page down loadmanyPlus plugin To Avisynth