halsboss
22nd November 2008, 02:57
Searched but couldn't find the right syntax. Am modifying LimitedSharpenFaster to incorporate mp4guy's changes as extra modes (for my own use) and can't find out how to return a null clip.
I need it to go something like from
OLD
Str=string(float(strength)/100.0)
normsharp = Smode==1 ? unsharpmask(strength,radius,0)
\ : Smode==2 ? sharpen(float(strength)/100.0)
\ : Smode==3 ? mt_lutxy(tmp,minmaxavg,yexpr="x x y - "+Str+" * +")
\ : mt_lutxy(tmp,tmpsoft,"x y == x x x y - abs 16 / 1 2 / ^ 16 * "+Str+
\ " * x y - 2 ^ x y - 2 ^ "+Str+" 100 * 25 / + / * x y - x y - abs / * + ?")
NEW
dfg = Smode==1 ?
\ MT_lutxy(last, fq2d("bcl", 256, 0, gamma=1, rescale=false), "y "+string(round(strength/100))+" * 127 + X + 127 -", u=2, v=2).invert
: null
Str=string(float(strength)/100.0)
normsharp = Smode==1 ? MT_lutxy(dfg, fq2d(dfg, "bcl", 256, 0, gamma=1, rescale=false), "y "+string(round(strength/100))+" * 127 + X + 127 -", u=2, v=2).invert
\ : Smode==2 ? unsharp(vary=1.5, varc=1.5, strength=1)
\ : Smode==3 ? mt_lutxy(tmp,minmaxavg,yexpr="x x y - "+Str+" * +")
\ : mt_lutxy(tmp,tmpsoft,"x y == x x x y - abs 16 / 1 2 / ^ 16 * "+Str+
\ " * x y - 2 ^ x y - 2 ^ "+Str+" 100 * 25 / + / * x y - x y - abs / * + ?")
I guess I could put each part of each mode into sub-functions, however to make minimal changes, what's the best way to get it to do nothing for the dfg clip ?
PS, what's fq2d (I'll search but a hint would be good.
I need it to go something like from
OLD
Str=string(float(strength)/100.0)
normsharp = Smode==1 ? unsharpmask(strength,radius,0)
\ : Smode==2 ? sharpen(float(strength)/100.0)
\ : Smode==3 ? mt_lutxy(tmp,minmaxavg,yexpr="x x y - "+Str+" * +")
\ : mt_lutxy(tmp,tmpsoft,"x y == x x x y - abs 16 / 1 2 / ^ 16 * "+Str+
\ " * x y - 2 ^ x y - 2 ^ "+Str+" 100 * 25 / + / * x y - x y - abs / * + ?")
NEW
dfg = Smode==1 ?
\ MT_lutxy(last, fq2d("bcl", 256, 0, gamma=1, rescale=false), "y "+string(round(strength/100))+" * 127 + X + 127 -", u=2, v=2).invert
: null
Str=string(float(strength)/100.0)
normsharp = Smode==1 ? MT_lutxy(dfg, fq2d(dfg, "bcl", 256, 0, gamma=1, rescale=false), "y "+string(round(strength/100))+" * 127 + X + 127 -", u=2, v=2).invert
\ : Smode==2 ? unsharp(vary=1.5, varc=1.5, strength=1)
\ : Smode==3 ? mt_lutxy(tmp,minmaxavg,yexpr="x x y - "+Str+" * +")
\ : mt_lutxy(tmp,tmpsoft,"x y == x x x y - abs 16 / 1 2 / ^ 16 * "+Str+
\ " * x y - 2 ^ x y - 2 ^ "+Str+" 100 * 25 / + / * x y - x y - abs / * + ?")
I guess I could put each part of each mode into sub-functions, however to make minimal changes, what's the best way to get it to do nothing for the dfg clip ?
PS, what's fq2d (I'll search but a hint would be good.