Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
FloodFiller.hpp
1#pragma once
2#include "resources/Texture.hpp"
3#include "resources/ResourcesManager.hpp"
4#include "Common.hpp"
5
12
13public:
16 enum class Output {
17 COLOR,
18 DISTANCE
19 };
20
25 FloodFiller(uint width, uint height);
26
31 void process(const Texture& texture, Output mode);
32
37 void resize(uint width, uint height);
38
42 const Texture * texture() const { return &_final; }
43
44private:
50
55
59
61};
Perform an approximate flood fill on the GPU, outputing a color filled image or a distance map....
Definition: FloodFiller.hpp:11
Program * _compositeDist
Generate the normalized distance map from the flood-fill seed map.
Definition: FloodFiller.hpp:54
Texture * extractAndPropagate(const Texture &texture)
Definition: FloodFiller.cpp:44
Program * _compositeColor
Generate the color image from the flood-fill seed map.
Definition: FloodFiller.hpp:53
Texture _final
Texture containing the result.
Definition: FloodFiller.hpp:58
Output
Output mode: either the color of the input seeds propagated, or the normalized distance to the closes...
Definition: FloodFiller.hpp:16
Texture _pong
Second flooding texture.
Definition: FloodFiller.hpp:57
void resize(uint width, uint height)
Definition: FloodFiller.cpp:77
Texture _ping
First flooding texture.
Definition: FloodFiller.hpp:56
void process(const Texture &texture, Output mode)
Definition: FloodFiller.cpp:19
Program * _extract
Extract the flood fill seeds.
Definition: FloodFiller.hpp:51
int _iterations
Number of iterations to perform (derived from input size).
Definition: FloodFiller.hpp:60
Program * _floodfill
Perform one pass of the flood fill.
Definition: FloodFiller.hpp:52
const Texture * texture() const
Definition: FloodFiller.hpp:42
Represents a group of shaders used for rendering.
Definition: Program.hpp:31
Represents a texture containing one or more images, stored on the CPU and/or GPU.
Definition: Texture.hpp:12