Skip to content

Commit f3add49

Browse files
author
borisowww
committed
Add option for custom resolution with width param
1 parent c03f15a commit f3add49

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/capturer/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ pub enum Resolution {
2020
_1440p,
2121
_2160p,
2222
_4320p,
23+
Custom {width: u32},
2324

2425
#[default]
2526
Captured,
@@ -34,6 +35,9 @@ impl Resolution {
3435
Resolution::_1440p => [2560, (2560_f32 / aspect_ratio).floor() as u32],
3536
Resolution::_2160p => [3840, (3840_f32 / aspect_ratio).floor() as u32],
3637
Resolution::_4320p => [7680, (7680_f32 / aspect_ratio).floor() as u32],
38+
Resolution::Custom { width } => {
39+
[width, width / aspect_ratio.floor() as u32]
40+
}
3741
Resolution::Captured => {
3842
panic!(".value should not be called when Resolution type is Captured")
3943
}

0 commit comments

Comments
 (0)