Log in

View Full Version : OOP notation


N_F
13th March 2003, 13:21
A couple of days ago I found myself in a situation where I wanted to do something like this.

mpeg2source("%source%")
crop(%values%)
movie=trim(0,203197).lanczosresize(640,272).asharp(1.4,6).convolution3d("movielq")
credits=trim(203198,0).bilinearresize(640,272).convolution3d(0,18,32,12,10,2.8)
return movie+credits

My question is: Will this script to what I want in the order I expect? Is it as simple as reading from left to right?

If it’s not obvious in what order I want them in I’ll make it plain:

Movie
trim(0,203197)
lanczosresize(640,272)
asharp(1.4,6)
convolution3d("movielq")

Credits
trim(203198,0)
bilinearresize(640,272)
convolution3d(0,18,32,12,10,2.8)


So, (1) will my script above do what I want and (2) is there another way than OOP notation to do what I want (other than creating two separate scripts)?

sh0dan
13th March 2003, 13:27
Yes ;)

Longer answer:

You can also do:
all = mpeg2source("%source%")
trim(all,0,203197)
lanczosresize(640,272)
asharp(1.4,6)
film = convolution3d("movielq")

trim(all,203198,0)
bilinearresize(640,272)
credits = convolution3d(0,18,32,12,10,2.8)

film + credits

N_F
13th March 2003, 13:28
Quick, short and to the point :)

Thanks.

N_F
13th March 2003, 13:54
So when you specify the clip argument in trim() the way you did you kinda reset the whole thing and you can start on a new? That brings my (admittedly basic) understandment of Avisynth to a new level :)

It's interesting just how much more there is to Avisynth than the basics of adding simple filters.