Advertisement
Guest User

Untitled

a guest
Mar 26th, 2018
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. /**
  2. * FixRowBrightnessProtect2
  3. * Usage: FixRowBrighnessProtect2(row, adj_val, prot_val) - prot_val can be left out
  4. * and the default of 16 will be used.
  5. *
  6. * row is the row you want to work on.
  7. *
  8. * adj_val should be a number x where -100 < x > 100. This parameter decides
  9. * how much the brightness should be affected. Numbers below 0 will make it darker
  10. * and number above 0 will make it brighter.
  11. *
  12. * prot_val is the protect value. This is what makes it behave differently than the
  13. * normal FixBrightness. Any luma above (255-prot_val) will not be affected which is
  14. * the basic idea of the protect script.
  15. */
  16. function FixRowBrightnessProtect2(clip c, int row, int adj_val, int "prot_val"){
  17. prot_val = Default(prot_val, 16)
  18. c
  19. 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 * +"
  20. mt_lut(myfunc)
  21. ConvertToY8().Crop(0,row,0,1)
  22. Overlay(c,last,0,row,mode="luma")
  23. }
  24.  
  25. function FixColumnBrightnessProtect2(clip c, int column, int adj_val, int "prot_val"){
  26. prot_val = Default(prot_val, 16)
  27. c
  28. 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 * +"
  29. mt_lut(myfunc)
  30. ConvertToY8().Crop(column,0,1,0)
  31. Overlay(c,last,column,0,mode="luma")
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement