using ytLive.Models; namespace ytLive.Services.BackgroundEffects; /// Identifies one rendered variant of a camera's frames (TASK 51): the effect plus its /// strength, rounded to 2 decimals so a slider drag doesn't spawn a variant per pixel of travel. /// always normalizes to strength 0 — the raw path. public readonly record struct WebcamEffectKey(BackgroundEffect Effect, double Strength) { public static WebcamEffectKey None => new(BackgroundEffect.None, 0); public static WebcamEffectKey For(BackgroundEffect effect, double strength) => effect == BackgroundEffect.None ? None : new WebcamEffectKey(effect, Math.Round(Math.Clamp(strength, 0, 1), 2)); }