| function FilterRange(clip clip, int "start", int "end", string "filter") {
final_frame = clip.FrameCount() - 1
start = default(start, 0) end = default(end, final_frame) filter = default(filter, "") Assert(start <= final_frame, "'start' should be less than or equal to " + String(final_frame) + ".")
Assert(end <= final_frame, "'end' should be less than or equal to " + String(final_frame) + ".")
Assert((end >= start) || (end == 0), "'end' should be more than or equal to start or 0.")
Assert(filter != "", "'filter' should be specified.")
c = Eval("clip.trim(start, end)." + filter)
c = (start == 0) ? c
\ : (start == 1) ? clip.trim(0, -1) + c
\ : clip.trim(0, start - 1) + c
c = ((end == 0) || (end == final_frame)) ? c
\ : ((end == -1) && (start == final_frame)) ? c
\ : (end == -1) ? c + clip.trim(start + 1, 0)
\ : c + clip.trim(end + 1, 0)
return c
}
|