#pragma once #include "core/effect.hpp" namespace effector { // Mangles the bytes of its input band by band: posterising, xoring with a // random mask, rotating the bits or shuffling the channels. // A pure transform: it needs no source images, and leading a chain with // sources loaded it starts from a crop of a randomly chosen one. class BitCrushEffect : public Effect { public: std::string name() const override { return "bitcrush"; } std::string title() const override { return "Bit crush"; } std::string description() const override { return "Mangles the bytes of random bands: posterises them, xors them with a random " "mask, rotates their bits or shuffles their channels."; } const std::vector& params() const override; bool needsSources() const override { return false; } Image render(const std::vector& sources, int width, int height, Rng& rng, const ParamValues& values) const override; }; } // namespace effector