From 80d7832158a3f1ec2ebba1a9648ecaa97b36178f Mon Sep 17 00:00:00 2001 From: borisowww Date: Tue, 26 Aug 2025 17:33:57 +0200 Subject: [PATCH] Add option for custom resolution with width param --- src/capturer/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/capturer/mod.rs b/src/capturer/mod.rs index 04a189b..d065f2b 100644 --- a/src/capturer/mod.rs +++ b/src/capturer/mod.rs @@ -20,6 +20,7 @@ pub enum Resolution { _1440p, _2160p, _4320p, + Custom {width: u32}, #[default] Captured, @@ -34,6 +35,9 @@ impl Resolution { Resolution::_1440p => [2560, (2560_f32 / aspect_ratio).floor() as u32], Resolution::_2160p => [3840, (3840_f32 / aspect_ratio).floor() as u32], Resolution::_4320p => [7680, (7680_f32 / aspect_ratio).floor() as u32], + Resolution::Custom { width } => { + [width, (width / aspect_ratio).floor() as u32] + } Resolution::Captured => { panic!(".value should not be called when Resolution type is Captured") }