Log in

View Full Version : [function] move one field pixelwise


hanfrunz
31st May 2003, 23:26
hello,

here's a little function to move a field (0 or 1) of an interlaced video pixelwise. If x>0 then move to the right. If y>0 move to the top (and via verca). Maybe someone needs it...

hanfrunz


function movefield(clip c, int field, int x, int y)
{
separatefields(c)

a=selectodd()
b=selecteven()

d = (field==0) ? a : b
d= (x>0) ? crop(d,0,0,-x,0).addborders(x,0,0,0) : crop(d,-x,0,0,0).addborders(0,0,-x,0)
d= (y>0) ? crop(d,0,y,0,0).addborders(0,0,0,y) : crop(d,0,0,0,y).addborders(0,-y,0,0)
d = (field==0) ? interleave(d,b) : interleave(a,d)
d=weave(d)
return d
}

sh0dan
31st May 2003, 23:40
You could also add it to the ShareFunctions (http://www.avisynth.org/index.php?page=ShareFunctions) page on avisynth.org!