anh doan
6cbc8d9d1b
test(effects): add unit tests for chromatic aberration, glitch, sharpen, and vignette effects
...
- Implement tests for chromatic aberration effect definition, verifying type, name, category, parameters, and renderer behavior.
- Add tests for glitch effect definition, covering type, name, parameters, and rendering logic.
- Create tests for sharpen effect definition, ensuring correct parameter defaults and rendering.
- Introduce tests for vignette effect definition, validating parameters and rendering behavior.
These tests enhance coverage for the new effects introduced in the @opencut/effects package.
2026-03-23 15:21:10 +07:00
anh doan
81adac6e1e
feat(effects): add @opencut/effects package with 24 effects and presets
...
Add a standalone effects package that extracts effect definitions,
GLSL shaders, and registry from @opencut/web into a reusable package.
## Package (@opencut/effects)
- Registry: register/get/has/getAll effects with Map-based lookup
- Categories: COLOR_TONE, ARTISTIC, BEAUTY with display metadata
- Types: Effect, EffectDefinition, EffectContext, WebGLEffectPass
### Effects (24 total)
**Color & Tone (8):** brightness, contrast, saturation, hue-shift,
temperature, exposure, gamma, color-balance
**Artistic (10):** blur, vignette, film-grain, sharpen, pixelate,
chromatic-aberration, glitch (2-pass), neon-glow (2-pass),
sketch (2-pass), oil-paint (2-pass)
**Beauty (6):** skin-smooth (bilateral filter), face-brighten,
eye-enhance, teeth-whiten, blush, slim-face
### Presets (12)
- Instagram: clarendon, juno, lark, gingham, valencia, nashville
- Cinematic: teal-and-orange, vintage-film, noir, bleach-bypass
- Beauty: soft-glow, portrait
## Web App Integration
- Migrate blur effect from web app to package
- Update imports via re-export pattern (backward compatible)
- Pass time param for animated effects (film-grain, glitch)
- Add face-mesh service using MediaPipe Face Mesh (lazy-loaded)
- Beauty effects auto-detect faces and pass EffectContext
- Async renderVisual for face detection pipeline
## Tests
152 unit tests covering registry, all effect definitions, and presets
2026-03-23 13:32:46 +07:00