#pragma once #include "core/effect.hpp" namespace effector { // Finds runs of pixels whose brightness lies between two thresholds and sorts // each run by brightness, hue or saturation, which makes the image drip. // 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 PixelSortEffect : public Effect { public: std::string name() const override { return "pixelsort"; } std::string title() const override { return "Pixel sort"; } std::string description() const override { return "Sorts the runs of pixels whose brightness lies between two thresholds, along " "rows or columns, so the image melts and drips."; } 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