Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * FixRowBrightnessProtect2
- * Usage: FixRowBrighnessProtect2(row, adj_val, prot_val) - prot_val can be left out
- * and the default of 16 will be used.
- *
- * row is the row you want to work on.
- *
- * adj_val should be a number x where -100 < x > 100. This parameter decides
- * how much the brightness should be affected. Numbers below 0 will make it darker
- * and number above 0 will make it brighter.
- *
- * prot_val is the protect value. This is what makes it behave differently than the
- * normal FixBrightness. Any luma above (255-prot_val) will not be affected which is
- * the basic idea of the protect script.
- */
- function FixRowBrightnessProtect2(clip c, int row, int adj_val, int "prot_val"){
- prot_val = Default(prot_val, 16)
- c
- myfunc="x 16 - " + string(100-adj_val) + " / 100 * 16 + x " + string(255-prot_val) + " - -10 / 0 max 1 min * x x " + string(245-prot_val) + " - 10 / 0 max 1 min * +"
- mt_lut(myfunc)
- ConvertToY8().Crop(0,row,0,1)
- Overlay(c,last,0,row,mode="luma")
- }
- function FixColumnBrightnessProtect2(clip c, int column, int adj_val, int "prot_val"){
- prot_val = Default(prot_val, 16)
- c
- myfunc="x 16 - " + string(100-adj_val) + " / 100 * 16 + x " + string(255-prot_val) + " - -10 / 0 max 1 min * x x " + string(245-prot_val) + " - 10 / 0 max 1 min * +"
- mt_lut(myfunc)
- ConvertToY8().Crop(column,0,1,0)
- Overlay(c,last,column,0,mode="luma")
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement