Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

feat(project): add camera background removal settings

Richie McIlroy7e77bf7f17bd
diff --git a/apps/desktop/src/utils/tauri.ts b/apps/desktop/src/utils/tauri.ts
index c66d7500d..d9cae5629 100644
--- a/apps/desktop/src/utils/tauri.ts
+++ b/apps/desktop/src/utils/tauri.ts
@@ -709,7 +709,7 @@ export type AutomationRule = { id: string; name: string; enabled?: boolean; trig
export type AutomationTestReport = { ruleId: string; ruleName: string; actionChecks: AutomationActionCheck[] }
export type AutomationsStore = { version?: number; rules?: AutomationRule[] }
export type BackgroundBlurConfig = { mode: BackgroundBlurMode }
-export type BackgroundBlurMode = "off" | "light" | "heavy"
+export type BackgroundBlurMode = "off" | "light" | "heavy" | "remove"
export type BackgroundConfiguration = { source: BackgroundSource; blur: number; padding: number; rounding: number; roundingType: CornerStyle; inset: number; crop: Crop | null;
/**
* Normalized (0-1) center of the display rect in output-frame space.
diff --git a/crates/project/src/configuration.rs b/crates/project/src/configuration.rs
index 7b1aa21d9..3fd5847de 100644
--- a/crates/project/src/configuration.rs
+++ b/crates/project/src/configuration.rs
@@ -433,6 +433,7 @@ pub enum BackgroundBlurMode {
Off,
Light,
Heavy,
+ Remove,
}
#[derive(Debug, Clone, Serialize, Deserialize, Type)]
@@ -442,8 +443,15 @@ pub struct BackgroundBlurConfig {
}
impl BackgroundBlurConfig {
+ pub fn removes_background(&self) -> bool {
+ cfg!(target_os = "macos") && self.mode == BackgroundBlurMode::Remove
+ }
+
pub fn is_active(&self) -> bool {
- self.mode != BackgroundBlurMode::Off
+ matches!(
+ self.mode,
+ BackgroundBlurMode::Light | BackgroundBlurMode::Heavy
+ ) || self.removes_background()
}
}