1//! `AutoMatte` (`#49`) and diverging Fusion `MagicMask` (`#7`) GPU matting system.
2//!
3//! Architecture:
4//! - **Unified prompt extraction** ([`prompts`]): parses both Fission `AutoMatte` click points /
5//! modes and real Fusion `MagicMask` `MagicMaskStrokes` (`BezierSpline` keyframes or inline) +
6//! matte controls (`MatteBlur`, `MatteContractExpand`, `Invert`, `OutputMode`, `ShowMask`).
7//! - **Stage 1 & 2** ([`cache`]): checks [`AutoMatteCache`] (in-memory + optional disk PNG sequence
8//! from SAM 2 + MatAnyone 2 / VideoMaMa), exposes a zero-hardcoded-dependency native
9//! [`AutoMatteRunner`] worker launcher, and falls back to a real-time WebGPU-safe multi-seed
10//! Oklab color-affinity segmentation + joint-bilateral edge refinement pass when no cached neural
11//! matte is available yet.
12//! - **Stage 3** ([`gpu`]): real-time GPU port of Clover's `polish_alpha` (floor `0.045`, ceiling
13//! `0.985`, toe gamma `1.35` below `0.15`) and `hair_safe_decontaminate` (3-scale normalized-
14//! convolution Gaussian foreground color extrapolation at `sigma = 28, 12, 4` scaled by
15//! `proxy_scale`).
16
17mod cache;
18mod gpu;
19mod prompts;
20#[cfg(test)]
21mod tests;
22
23pub use cache::{AutoMatteCache, CachedMatteFrame};
24#[cfg(not(target_arch = "wasm32"))]
25pub use cache::{AutoMatteJobRequest, AutoMatteJobState, AutoMatteRunner, AutoMatteWorkerConfig};
26pub(crate) use gpu::AutoMattePipelines;
27pub use prompts::{
28 AutoMatteParams, OutputMode, PromptMode, PromptPoint, QualityTier, extract_auto_matte_params,
29 extract_magic_mask_params, parse_magic_mask_strokes_table,
30};