#pragma once #include "effects/video_effect.hpp" namespace effector { // The tiles effect in motion: the canvas is laid with tiles cut from the // source images, and each tile is swapped for another cut, at a moment of its // own, so the mosaic keeps changing piece by piece. // // The video effect built from the sources rather than transforming its input: // it answers needsSources() and writes compose(). The layout is drawn from // at.steady() and stays put; what a tile shows depends only on the tile and // how many times it has swapped, so it holds still between its swaps. class TileSwapEffect : public VideoEffect { public: std::string name() const override { return "tileswap"; } std::string title() const override { return "Tile swap"; } std::string description() const override { return "Lays tiles cut from the source images over the canvas, as Tiles does, and swaps " "each one for another cut at a moment of its own."; } const std::vector& params() const override; bool needsSources() const override { return true; } protected: Image compose(const std::vector& sources, int width, int height, const ParamValues& values, const Moment& at) const override; }; } // namespace effector