Files
effects/identity/effect.py
gilesb f9d9e8c5fb Convert effects to new single-file format
- dog: Convert to whole-video API with PEP 723 metadata
- identity: Add as frame-by-frame effect

Both now use @-tag docstrings for AI-readable metadata.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 06:52:07 +00:00

36 lines
712 B
Python

# /// script
# requires-python = ">=3.10"
# dependencies = []
# ///
"""
@effect identity
@version 1.0.0
@author @giles@artdag.rose-ash.com
@temporal false
@description
Identity effect - returns input unchanged. This is the foundational
effect where identity(x) = x. Uses frame-by-frame API but simply
passes frames through unmodified.
@example
(fx identity)
"""
import numpy as np
def process_frame(frame: np.ndarray, params: dict, state) -> tuple:
"""
Identity: return frame unchanged.
Args:
frame: RGB frame as numpy array (H, W, 3)
params: Unused
state: Passed through unchanged
Returns:
(frame, state) - both unchanged
"""
return frame, state