Add Sort sweep, a video effect that sweeps Pixel sort's window over the brightness

The run sorting moves to effects/sort_runs.hpp so both share it; Pixel sort
renders exactly as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Si
2026-09-26 20:37:30 +02:00
co-authored by Claude Opus 5.5
parent 0377cd4abb
commit 37c02a8a7b
8 changed files with 277 additions and 70 deletions
+29
View File
@@ -0,0 +1,29 @@
#pragma once
#include "effects/video_effect.hpp"
namespace effector {
// The pixel sort in motion: only pixels inside a window of brightness are
// sorted, and the window sweeps from the dark end to the bright end and back,
// so the sorted streaks spread over one part of the picture after another,
// melt away and return.
//
// Which lines are sorted, and how their runs are cut, is drawn from
// at.steady() and stays put; the window alone moves, there and back once a
// cycle, so the clip loops without a jump.
class SweepEffect : public VideoEffect {
public:
std::string name() const override { return "sweep"; }
std::string title() const override { return "Sort sweep"; }
std::string description() const override {
return "Sorts runs of pixels as Pixel sort does, only within a window of brightness that "
"sweeps from dark to bright and back.";
}
const std::vector<ParamSpec>& params() const override;
protected:
Image animate(Image input, const ParamValues& values, const Moment& at) const override;
};
} // namespace effector