|
1 | 1 | local opts = { |
2 | 2 | mode = "hard", -- can be "hard" or "soft". If hard, apply a crop filter, if soft zoom + pan. Or a bonus "delogo" mode |
3 | 3 | draw_shade = true, |
4 | | - shade_opacity = "77", |
| 4 | + shade_opacity = "44", |
| 5 | + light_opacity = "CC", |
5 | 6 | draw_frame = false, |
6 | 7 | frame_border_width = 2, |
7 | 8 | frame_border_color = "EEEEEE", |
@@ -111,14 +112,14 @@ function position_to_ensure_ratio(moving, fixed, ratio) |
111 | 112 | } |
112 | 113 | end |
113 | 114 |
|
114 | | -function draw_shade(ass, unshaded, window) |
| 115 | +function draw_shade(ass, unshaded, window, color, opacity) |
115 | 116 | ass:new_event() |
116 | 117 | ass:pos(0, 0) |
117 | 118 | ass:append("{\\an7}") |
118 | 119 | ass:append("{\\bord0}") |
119 | 120 | ass:append("{\\shad0}") |
120 | | - ass:append("{\\c&H000000&}") |
121 | | - ass:append("{\\1a&H" .. opts.shade_opacity .. "}") |
| 121 | + ass:append("{\\c&H" .. color .. "&}") |
| 122 | + ass:append("{\\1a&H" .. opacity .. "}") |
122 | 123 | ass:append("{\\2a&HFF}") |
123 | 124 | ass:append("{\\3a&HFF}") |
124 | 125 | ass:append("{\\4a&HFF}") |
@@ -231,7 +232,8 @@ function draw_crop_zone() |
231 | 232 | top_left = { x = 0, y = 0 }, |
232 | 233 | bottom_right = { x = dim.w, y = dim.h }, |
233 | 234 | } |
234 | | - draw_shade(ass, frame, window) |
| 235 | + if opts.light_opacity:lower() ~= "ff" then draw_shade(ass, frame, window, "FFFFFF", opts.light_opacity) end |
| 236 | + if opts.light_opacity:lower() ~= "ff" then draw_shade(ass, frame, window, "000000", opts.shade_opacity) end |
235 | 237 | end |
236 | 238 | if opts.draw_frame then |
237 | 239 | draw_frame(ass, frame) |
|
0 commit comments