Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # santiag v1.1
- # Simple antialiasing
- # This program is free software. It comes without any warranty, to
- # the extent permitted by applicable law. You can redistribute it
- # and/or modify it under the terms of the Do What The Fuck You Want
- # To Public License, Version 2, as published by Sam Hocevar. See
- # http://sam.zoy.org/wtfpl/COPYING for more details.
- # type = "nnedi3", "eedi2", "eedi3" or "sangnom"
- Function santiag (clip c, int "strh", int "strv", string "type", int "nns", int "aa", int "threads", int "nsize", int "vcheck")
- {
- strh = Default (strh, 1)
- strv = Default (strv, 1)
- type = Default (type, "nnedi3")
- c
- (strh >= 0) ? santiag_dir (strh, type, nns=nns, aa=aa, threads=threads, nsize=nsize, vcheck=vcheck) : last
- (strv >= 0) ? TurnLeft ().santiag_dir (strv, type, nns=nns, aa=aa, threads=threads, nsize=nsize, vcheck=vcheck).TurnRight () : last
- }
- Function santiag_dir (clip c, int strength, string type, int "nns", int "aa", int "threads", int "nsize", int "vcheck")
- {
- c
- w = Width ()
- h = Height ()
- santiag_stronger (strength, type, nns=nns, aa=aa, threads=threads, nsize=nsize, vcheck=vcheck)
- Spline36Resize (w, h, 0, 0.5, w, h * 2)
- }
- Function santiag_stronger (clip c, int strength, string type, int "nns", int "aa", int "threads", int "nsize", int "vcheck")
- {
- strength = (strength < 0) ? 0 : strength
- field = strength % 2
- dh = (strength <= 0)
- (! dh) ? c.santiag_stronger (strength - 1, type) : c
- (type == "nnedi3" ) ? santiag_nnedi3 (dh, field, nns=nns, threads=threads, nsize=nsize)
- \ : (type == "eedi2" ) ? santiag_eedi2 (dh, field)
- \ : (type == "eedi3" ) ? santiag_eedi3 (dh, field, nns=nns, threads=threads, nsize=nsize, vcheck=vcheck)
- \ : (type == "sangnom") ? santiag_sangnom (dh, field, aa=aa)
- \ : Assert (false, "Santiag: unexpected value for type.")
- }
- Function santiag_nnedi3 (clip c, bool dh, int field, int "nns", int "threads", int "nsize")
- {
- c.nnedi3 (dh=dh, field=field, nns=nns, threads=threads, nsize=nsize)
- }
- Function santiag_eedi2 (clip c, bool dh, int field)
- {
- c
- w = Width ()
- h = Height ()
- (dh) ? last : PointResize (w, h / 2, 0, 1-field, w, h)
- eedi2 (field=field)
- }
- Function santiag_eedi3 (clip c, bool dh, int field, int "nns", int "threads", int "nsize", int "vcheck")
- {
- sclip = c.santiag_nnedi3 (dh, field, nns=nns, threads=threads, nsize=nsize)
- c.eedi3 (dh=dh, field=field, threads=threads, vcheck=vcheck, sclip=sclip)
- }
- Function santiag_sangnom (clip c, bool dh, int field, int "aa")
- {
- c
- w = Width ()
- h = Height ()
- (dh) ? Spline36Resize (w, h * 2, 0, -0.25, w, h) : last
- SangNom (order=field, aa=aa)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement