Repository navigation
feat(slitscan0r): add slit scan filter with Scan and Stargate modes - #321
Merged
Merged
Conversation
Every frame contributes only the pixels under a thin slit, and the slits of consecutive frames are laid side by side so that one axis of the image becomes time. Scan shows the classic slit scan / photo-finish image. Stargate projects the same slit history onto two walls receding to a vanishing point, recalling the slit-scan photography of the Star Gate sequence in "2001: A Space Odyssey". Parameters: Mode, Position, Vertical, Width (1-64 px per frame), Reverse, and for Stargate Depth and Fade. The history is exactly one frame of slits, allocated at construction, so rendering never allocates; it is seeded from the first frame and restarts when time goes backwards or the orientation changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XnoxvoRbSLkQ3sTCkxgiyi
Check metadata, parameter defaults, round trip and clamping, invalid sizes and allocation failures at construction, the Scan image against an independent scrolling model (both orientations, reversed, wide and clamped slits, in place and out of place, across Stargate frames), restarts on backward seeks and orientation changes, and the symmetry, black hole, flow direction and fade of the Stargate projection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XnoxvoRbSLkQ3sTCkxgiyi
jaromil
previously requested changes
Nov 5, 2026
jaromil
left a comment
Member
There was a problem hiding this comment.
Found one reproducible temporal-state issue: re-rendering the same application timestamp advances the slit history, changing both the paused image and later output. Please avoid advancing history for repeated timestamps and add coverage for this case.
Validation at d959c0a: the native slitscan0r smoke test, slitscan0r-contract, and bundle-classification-coverage all passed; slitscan0r-contract also passed under combined AddressSanitizer/UndefinedBehaviorSanitizer. The new filter is correctly classified and selected by the core bundle. The duplicate-timestamp reproducer used the actual built module through its exported C API.
Push a new slit only when the application timestamp advances. Repeated timestamps still render the current history so Mode and Fade changes remain visible. Compare playback with and without duplicate renders across both orientations, both directions, in-place updates, and changes between Scan and Stargate projections.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
slitscan0r, a slit scan filter. Every frame contributes only the pixels under a thin slit, and the slits of consecutive frames are laid side by side, so one axis of the image becomes time. frei0r had no slit scan so far, and as far as I could find neither FFmpeg nor MLT ships one, so this makes the effect available to all frei0r hosts.Two compositions share the same slit history:
Preview
Rendered from an FFmpeg
testsrc2pattern (rotating, hue-shifting) at 640x360, frame at 5.5 s. Top: source, Scan. Bottom: Stargate with a vertical slit, Stargate with a horizontal slit.Stargate with a horizontal slit (
frei0r=slitscan0r:1|0.5|n|0.05|n|0.4|0.8):stargate_h.mp4
Parameters
< 0.5Scan,>= 0.5StargateParameters are stored as set, so they read back unchanged; values are clamped to [0, 1] and NaN is treated as 0.
Design notes
frei0r.hAPI, following the structure ofharris0r.width * heightpixels, ~8 MiB at 1080p), allocated inf0r_constructwith overflow checks; construction returnsNULLon failure. Rendering never allocates.delaygrabbelongs to the related "time displacement" family (each block from a different past frame) but keeps a fixed 71-frame queue and exposes no parameters, so this is a separate plugin rather than an extension of it.Tests
test/slitscan0r-contract.ccompiles the plugin with injectable allocators (same approach asharris0r-contract) and checks:Locally: full
ctest183/183, the contract test clean under ASan/UBSan, cpplint clean with the CI filter. Also tested on real footage withffplay -vf frei0r=slitscan0r:...on macOS.