PDA

View Full Version : Lines without overlay


tin3tin
28th September 2008, 23:26
I need to make a red dotted box shaped outline with changing sizes.

I guess I could make an alpha box with a colored border and overlay it on top of the background, but overlay is very slow on longer clips...

So my question is do you know of a way to draw lines directly on the frames without using the slow overlay function?

stickboy
29th September 2008, 05:51
If you only need it for some of the frames, Overlay with ApplyRange shouldn't be too slow.

tin3tin
29th September 2008, 09:21
I guess I was thinking something along the lines of Mohans Draw lines (http://avisynth.org/vcmohan/ColorIt/DrawLines.html) function. However it only draws greyscale lines and I couldn't get Color line (http://avisynth.org/vcmohan/ColorIt/ColorLine.html) to color the line afterwards.

Loadplugin("Colorit.dll")
B=blankclip(color=0)
drawlines(B,0,50,0,220,220,220,line="join",lval=128,brush=true)
Colorline(last,0,50,5,220,$ff0000)

So the alternative is something like this:

b=colorbars(720,480)#blankclip(color=0)
b
border=4
safex=72
safey=57

f=b.blankclip(last.framecount(),b.width()-safex*2,b.height()-safey*2, color=$000000)
fmask=f.addborders(border,border,border,border,$ffffff)
f=f.addborders(border,border,border,border,$ff0000)
overlay(b,f,safex,safey,mask=fmask,opacity=1)

mikeytown2
29th September 2008, 10:35
If you want to do a bunch of scripting, Use Crop with StackHorizontal/StackVertical. You can then place your BlankClip(width=1,height=10,color=$FF00000) and not use overlay. Not sure if it will be faster, but it's worth a shot... Making it into a function that replicates Overlay with opacity=1 would be interesting.

ps fix ur links

tin3tin
29th September 2008, 11:06
Actually drawlines is very close to what I'm after. As I mentioned it's only greyscale, and the sourcecode wasn't available(not that I ever tried to tinker with plugin code before, but that might have been a start. :))

[Corrected the links above.]