Files
effectcraft/crates/effects/src/catalog.rs
T
Brandon ThomasandClaude Opus 5.5 355a6255a2 M9.12: effect parameter fidelity – all categories
Align every effect's display name, category, parameter names, order,
twirl-down groups, popup options, units, defaults and ranges with the
public After Effects effect reference, and implement controls that were
ignored or missing where cheap. One commit because the categories share
the registry, migration tables and GPU kernels (only green states).

Infrastructure
- effects::migrate: saved instances are upgraded on project open
  (Session::replace_project → upgrade_effects): renamed ids
  (PARAM_ID_ALIASES), params moved into twirl-down groups, popup values
  remapped by label (POPUP_LABEL_ALIASES), refreshed names/UI hints,
  added params created with legacy_default values that keep old renders.
- flatten_params also keys nested props by match path (group/param), so
  effects declare grouped params with `group/param` ids; layer-source
  companions sit next to grouped layer params.
- lookup() resolves old effect names (EFFECT_NAME_ALIASES).
- Registry-wide test: unique ids/names, non-empty names, defaults in
  range, popup defaults within options, value kinds match UI.
- docs/effects.md generated from the registry (catalog.rs) with GPU /
  32-bpc badges and per-effect status; a test keeps it current.

Batches
- Blur & Sharpen, Channel, 3D Channel, Perspective, Text, Utility:
  Camera Lens Blur iris/highlight groups, Compound Blur layer, Camera-
  Shake Deblur method/strength, Invert full channel list (CPU HLS/YIQ),
  Set Channels/Set Matte layers, Channel Combiner targets, 3D Channel
  Extract clamp/invert.
- Color Correction: temporal smoothing + scene detect for Auto Color/
  Contrast/Levels and Shadow/Highlight, Brightness & Contrast legacy
  switch, Change to Color tolerance group, Leave Color, Photo Filter
  presets, Exposure channels, Levels clip popups, Colorama phase source,
  Color Link sample list, Lumetri groups (CPU + GPU kernels).
- Distort: Bulge, Displacement Map layer/behaviour, Magnify, Optics
  Compensation resize, Ripple conversion, Transform sampling, Turbulent
  Displace types/pinning/evolution, Wave Warp types/pinning, Twirl and
  Ripple radius fixes.
- Generate: 4-Color Gradient, Checkerboard, Grid, Circle size/feather/
  blending, Advanced Lightning types, Cell Pattern, Radio Waves, Fractal
  palettes, Scribble/Vegas names.
- Keying, Matte, Obsolete: Color Difference Key partials/views, Unmult
  controls, Key Light groups, Refine Soft/Hard Matte, Roto Brush groups,
  Mocha shape moved to Matte, Spill Suppressor accuracy, Basic/Path Text
  groups.
- Noise & Grain, Immersive Video, Audio, Time: Fractal/Turbulent Noise
  full control set (noise3.rs, GPU), grain look groups, Remove Grain,
  VR effects, Compressor/Gate/Distortion controls, Timewarp groups,
  VR Sphere to Plane name.
- Simulation: AE twirl-down groups for all simulations, Foam strength,
  Particle Playground barrel radius and mapper targets.
- Stylize, Transition: Glow looping/dimensions/alpha (CPU + GPU),
  Mosaic averaging, Cartoon groups, Roughen Edges evolution, Texturize
  layer, Gradient Wipe layer, Radial Wipe both, Card Wipe options.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 00:15:06 -04:00

133 lines
7.1 KiB
Rust

//! The public effects catalogue (`docs/effects.md`), generated from the registry.
//!
//! Regenerate with `UPDATE_DOCS=1 cargo test -p effectcraft-effects --lib effects_doc_is_current`.
use crate::{CATEGORIES, registry};
/// Effects whose implementation is known to fall short of the reference behaviour:
/// `(effect id, what is missing)`. Everything else in the registry is implemented in full as far
/// as the public behaviour documentation describes it.
pub const PARTIAL: &[(&str, &str)] = &[
("ec.blur.cameralens", "no Diffraction Fringe or Blur Map layer"),
("ec.channel.minimax", "no Don't Shrink Edges option"),
("ec.channel.combiner", "no Saturation Multiplied target"),
("ec.3d.channelextract", "no anti-alias option"),
("ec.color.huesaturation", "no per-range Channel Control"),
("ec.color.levels", "master channel only (no Channel popup)"),
("ec.color.curves", "no Channel popup"),
("ec.color.colorama", "no Add Phase, editable Output Cycle, Modify, Pixel Selection or Masking"),
("ec.color.lumetri", "no HSL Secondary, hue/saturation curves, HDR mode or look files"),
("ec.color.selectivecolor", "simplified Colors / Details layout"),
("ec.distort.turbulentdisplace", "no locked pinning variants"),
("ec.distort.opticscompensation", "no Optimal Pixels"),
("ec.distort.transform", "no shutter-angle motion blur"),
("ec.distort.reshape", "no correspondence points"),
("ec.distort.rollingshutterrepair", "Pixel Motion Detail has no effect"),
("ec.generate.fill", "no Fill Mask / All Masks / feather"),
("ec.generate.advancedlightning", "no Alpha Obstacle; most Expert Settings missing"),
("ec.generate.radiowaves", "no Image Contours or Mask wave types, Parameters Are Set At, reflection or stroke profile"),
("ec.generate.scribble", "no caps, joins or Start/End Apply To"),
("ec.generate.cellpattern", "HQ variants render like the standard ones"),
("ec.key.innerouter", "one additional mask per side; no cleanup strokes"),
("ec.key.advancedspill", "no Tolerance, Desaturate or Spill Color Correction"),
("ec.keying.keylight", "no Source Crops X/Y Method or Edge Colour; no colour suppression / balancing"),
("ec.matte.refinesoft", "no Reduce Chatter or motion blur"),
("ec.matte.refinehard", "no Reduce Chatter or motion blur"),
("ec.obsolete.pathtext", "no kerning, shear/scale, line spacing, fade time or jitter"),
("ec.noise.addgrain", "no preview region, presets, channel balance or temporal controls"),
("ec.noise.matchgrain", "no preview region, presets, sampling or temporal controls"),
("ec.noise.removegrain", "no preview region, sampling or temporal filtering"),
("ec.vr.digitalglitch", "reduced control set"),
("ec.vr.converter", "common layouts only"),
("ec.time.timewarp", "Pixel Motion blends frames (no optical flow); no matte, warp or crop controls"),
("ec.sim.carddance", "no camera system, corner pins or lighting/material controls"),
("ec.sim.shatter", "no custom shatter map, gradient, textures or extrusion rendering"),
("ec.sim.caustics", "no Sky group or light type"),
("ec.sim.foam", "no wobble, pop velocity, custom bubble texture, environment map or flow map"),
("ec.sim.particleplayground", "no Particle Exploder, Ephemeral Property Mapper, Affects groups or text particles"),
("ec.sim.waveworld", "no wireframe controls, dry-area rendering or ground group"),
("ec.stylize.glow", "no Glow Operation or arbitrary colour map"),
("ec.stylize.cartoon", "no Edge Enhancement"),
("ec.transition.cardwipe", "2D flip only; no back layer picker, camera, lighting or jitter"),
("ec.transition.blockdissolve", "no Soft Edges option"),
];
/// Implementation status of effect `id` (`Implemented` or `Partial: …`).
pub fn status(id: &str) -> String {
match PARTIAL.iter().find(|(e, _)| *e == id) {
Some((_, note)) => format!("Partial: {note}"),
None => "Implemented".to_string(),
}
}
/// `docs/effects.md`.
pub fn effects_markdown() -> String {
let r = registry();
let mut s = String::new();
s.push_str("# Effects\n\n");
s.push_str("<!-- Generated from the effect registry (crates/effects/src/catalog.rs); do not edit by hand.\n");
s.push_str(" Regenerate: UPDATE_DOCS=1 cargo test -p effectcraft-effects --lib effects_doc_is_current -->\n\n");
let params: usize = r.iter().map(|e| e.params.len()).sum();
let gpu = r.iter().filter(|e| e.gpu).count();
let float = r.iter().filter(|e| e.float).count();
let partial = r.iter().filter(|e| PARTIAL.iter().any(|(id, _)| *id == e.id)).count();
s.push_str(&format!(
"EffectCraft ships {} effects with {} parameters in total, grouped into the same categories as the Effects & Presets \
panel. Every effect is our own implementation, written from public behaviour descriptions and standard \
image-processing literature. Parameter names, order, popup options, units, defaults and ranges follow the \
reference application so that projects, expressions and muscle memory carry over.\n\n",
r.len(),
params
));
s.push_str(&format!(
"- **GPU**: {gpu} effects also run on the GPU compositor with identical results.\n\
- **32**: {float} effects process 32-bit float (HDR, overbright) pixels without clamping.\n\
- **Status**: {} implemented in full, {partial} partial (what is missing is listed).\n\n",
r.len() - partial
));
s.push_str("Effects are addressed by id (`ec.<category>.<name>`) or display name in commands, scripts and the control channel, and every parameter by its id (`effects/#1/blurriness`).\n\n");
for cat in CATEGORIES {
let list: Vec<_> = r.iter().filter(|e| e.category == *cat).collect();
if list.is_empty() {
continue;
}
s.push_str(&format!("## {cat}\n\n| Effect | Id | Params | GPU | 32 | Status |\n|---|---|---:|:-:|:-:|---|\n"));
for e in list {
s.push_str(&format!(
"| {} | `{}` | {} | {} | {} | {} |\n",
e.name.replace('|', "\\|"),
e.id,
e.params.iter().filter(|p| !matches!(p.ui, effectcraft_project::ParamUi::Hidden)).count(),
if e.gpu { "GPU" } else { "" },
if e.float { "32" } else { "" },
status(e.id).replace('|', "\\|"),
));
}
s.push('\n');
}
s
}
#[cfg(test)]
mod tests {
#[test]
fn effects_doc_is_current() {
let path = concat!(env!("CARGO_MANIFEST_DIR"), "/../../docs/effects.md");
let want = super::effects_markdown();
if std::env::var_os("UPDATE_DOCS").is_some() {
std::fs::write(path, &want).unwrap();
return;
}
let have = std::fs::read_to_string(path).unwrap_or_default();
assert!(have == want, "docs/effects.md is stale: UPDATE_DOCS=1 cargo test -p effectcraft-effects --lib effects_doc_is_current");
}
#[test]
fn partial_notes_name_registered_effects() {
for (id, note) in super::PARTIAL {
assert!(crate::find(id).is_some(), "PARTIAL names unknown effect {id}");
assert!(!note.trim().is_empty());
}
}
}