Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function DeHalo_alpha(clip clp, float "rx", float "ry", float "darkstr", float "brightstr", float "lowsens", float "highsens", float "ss") {
  2.     rx        = default( rx,        2.0 )
  3.     ry        = default( ry,        2.0 )
  4.     darkstr   = default( darkstr,   1.0 )
  5.     brightstr = default( brightstr, 1.0 )
  6.     lowsens   = default( lowsens,    50 )
  7.     highsens  = default( highsens,   50 )
  8.     ss        = default( ss,        1.5 )
  9.  
  10.     LOS = string(lowsens)
  11.     HIS = string(highsens/100.0)
  12.     DRK = string(darkstr)
  13.     BRT = string(brightstr)
  14.     ox  = clp.width()
  15.     oy  = clp.height()
  16.     uv  = 1
  17.     uv2 = (uv==3) ? 3 : 2
  18.  
  19.     halos  = clp.bicubicresize(m4(ox/rx),m4(oy/ry)).bicubicresize(ox,oy,1,0)
  20.     are    = mt_lutxy(clp.mt_expand(U=uv,V=uv),clp.mt_inpand(U=uv,V=uv),"x y -","x y -","x y -",U=uv,V=uv)
  21.     ugly   = mt_lutxy(halos.mt_expand(U=uv,V=uv),halos.mt_inpand(U=uv,V=uv),"x y -","x y -","x y -",U=uv,V=uv)
  22.     so     = mt_lutxy( ugly, are, "y x - y 0.001 + / 255 * "+LOS+" - y 256 + 512 / "+HIS+" + *" )
  23.     lets   = mt_merge(halos,clp,so,U=uv,V=uv)
  24.     remove = (ss==1.0) ? clp.repair(lets,1,0)
  25.           \        : clp.lanczosresize(m4(ox*ss),m4(oy*ss))
  26.           \             .mt_logic(lets.mt_expand(U=uv,V=uv).bicubicresize(m4(ox*ss),m4(oy*ss)),"min",U=uv2,V=uv2)
  27.           \             .mt_logic(lets.mt_inpand(U=uv,V=uv).bicubicresize(m4(ox*ss),m4(oy*ss)),"max",U=uv2,V=uv2)
  28.           \             .lanczosresize(ox,oy)
  29.     them   = mt_lutxy(clp,remove,"x y < x x y - "+DRK+" * - x x y - "+BRT+" * - ?",U=2,V=2)
  30.  
  31.     return( them )
  32. }
  33.  
  34. function m4(float x) {
  35.     return (x<16?16:int(round(x/4.0)*4))
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement