|
1 | 1 | local opts = { |
2 | 2 | mode = "hard", -- can be "hard" or "soft". If hard, use video-crop, if soft use 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", |
@@ -118,14 +119,14 @@ function video_norm_to_screen(point, dim) |
118 | 119 | } |
119 | 120 | end |
120 | 121 |
|
121 | | -function draw_shade(ass, unshaded, window) |
| 122 | +function draw_shade(ass, unshaded, window, color, opacity) |
122 | 123 | ass:new_event() |
123 | 124 | ass:pos(0, 0) |
124 | 125 | ass:append("{\\an7}") |
125 | 126 | ass:append("{\\bord0}") |
126 | 127 | ass:append("{\\shad0}") |
127 | | - ass:append("{\\c&H000000&}") |
128 | | - ass:append("{\\1a&H" .. opts.shade_opacity .. "}") |
| 128 | + ass:append("{\\c&H" .. color .. "&}") |
| 129 | + ass:append("{\\1a&H" .. opacity .. "}") |
129 | 130 | ass:append("{\\2a&HFF}") |
130 | 131 | ass:append("{\\3a&HFF}") |
131 | 132 | ass:append("{\\4a&HFF}") |
@@ -236,7 +237,8 @@ function draw_crop_zone() |
236 | 237 | top_left = { x = 0, y = 0 }, |
237 | 238 | bottom_right = { x = dim.w, y = dim.h }, |
238 | 239 | } |
239 | | - draw_shade(ass, frame, window) |
| 240 | + if opts.light_opacity:lower() ~= "ff" then draw_shade(ass, frame, window, "FFFFFF", opts.light_opacity) end |
| 241 | + if opts.shade_opacity:lower() ~= "ff" then draw_shade(ass, frame, window, "000000", opts.shade_opacity) end |
240 | 242 | end |
241 | 243 | if opts.draw_frame then |
242 | 244 | draw_frame(ass, frame) |
|
0 commit comments