Advertisement
Guest User

Untitled

a guest
Mar 26th, 2018
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 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, 20)
  18. c
  19. Overlay(ExtractY(),ExtractY().mt_lut("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 * +").Crop(0,row,0,1),0,row,mode="luma")
  20. CombinePlanes(last, c, planes="YUV", pixel_type="YV12")
  21. }
  22.  
  23. function FixColumnBrightnessProtect2(clip c, int column, int adj_val, int "prot_val"){
  24. prot_val = Default(prot_val, 20)
  25. c
  26. Overlay(ExtractY(),ExtractY().mt_lut("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 * +").Crop(column,0,1,0),column,0,mode="luma")
  27. CombinePlanes(last, c, planes="YUV", pixel_type="YV12")
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement