Add eight effects that throw something chaotic into the chain

Slit shift, channel split, pixel sort, corruption, shatter, warp, bit
crush and feedback: tearing bands sideways, knocking the colour planes
out of register, sorting runs of pixels, damaging blocks the way a broken
stream does, breaking the picture into shards, pushing it along a noise
field, mangling its bytes and laying it over itself again and again.

All eight are pure transforms. None needs sources, so any of them can
lead a chain, and like blur they start from a crop of a random source
when they do and photographs are loaded. canvasFromSources holds that
start once for them.

Each draws its whole plan from the rng before touching a pixel, and
pixel sort hands every line a seed of its own, so the parallel work
never decides anything. The rotations in shatter and feedback take their
sine and cosine from a short series of plain multiplications rather than
libm, so a seed lands on the same pixels whatever the machine's maths
library makes of std::sin.

The tests hold every one of them to the same things -- a seed
reproduces it, it runs without sources and as a later stage, a sliver
of a canvas does not trip it, turned right down it leaves its input
alone -- plus a check of what each actually does, and the registry now
checks that no two effects declare the same param key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Si
2026-09-23 20:36:09 +02:00
co-authored by Claude Opus 5.5
parent 8113a06da7
commit ce3a422f6a
21 changed files with 1548 additions and 0 deletions
+16
View File
@@ -1,12 +1,20 @@
#include "core/registry.hpp"
#include "effects/bitcrush.hpp"
#include "effects/blur.hpp"
#include "effects/channelsplit.hpp"
#include "effects/corrupt.hpp"
#include "effects/feedback.hpp"
#include "effects/grain.hpp"
#include "effects/monochrome.hpp"
#include "effects/overlay.hpp"
#include "effects/pixelsort.hpp"
#include "effects/scanlines.hpp"
#include "effects/shatter.hpp"
#include "effects/slitshift.hpp"
#include "effects/text.hpp"
#include "effects/tiles.hpp"
#include "effects/warp.hpp"
namespace effector {
@@ -20,6 +28,14 @@ const std::vector<EffectPtr>& effects() {
std::make_shared<OverlayEffect>(),
std::make_shared<TextEffect>(),
std::make_shared<TilesEffect>(),
std::make_shared<SlitShiftEffect>(),
std::make_shared<ChannelSplitEffect>(),
std::make_shared<PixelSortEffect>(),
std::make_shared<CorruptEffect>(),
std::make_shared<ShatterEffect>(),
std::make_shared<WarpEffect>(),
std::make_shared<BitCrushEffect>(),
std::make_shared<FeedbackEffect>(),
};
return registry;
}