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, 20)
- c
- 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")
- CombinePlanes(last, c, planes="YUV", pixel_type="YV12")
- }
- function FixColumnBrightnessProtect2(clip c, int column, int adj_val, int "prot_val"){
- prot_val = Default(prot_val, 20)
- c
- 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")
- CombinePlanes(last, c, planes="YUV", pixel_type="YV12")
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement