Perform an approximate flood fill on the GPU, outputing a color filled image or a distance map. Implement the method described in Jump Flooding in GPU with Applications to Voronoi Diagram and Distance Transform, Rong et al., 2006.
More...
#include <FloodFiller.hpp>
|
enum class | Output { COLOR
, DISTANCE
} |
| Output mode: either the color of the input seeds propagated, or the normalized distance to the closest seed at each pixel.
|
|
|
Program * | _extract |
| Extract the flood fill seeds.
|
|
Program * | _floodfill |
| Perform one pass of the flood fill.
|
|
Program * | _compositeColor |
| Generate the color image from the flood-fill seed map.
|
|
Program * | _compositeDist |
| Generate the normalized distance map from the flood-fill seed map.
|
|
Texture | _ping |
| First flooding texture.
|
|
Texture | _pong |
| Second flooding texture.
|
|
Texture | _final |
| Texture containing the result.
|
|
int | _iterations |
| Number of iterations to perform (derived from input size).
|
|
Perform an approximate flood fill on the GPU, outputing a color filled image or a distance map. Implement the method described in Jump Flooding in GPU with Applications to Voronoi Diagram and Distance Transform, Rong et al., 2006.
◆ FloodFiller()
FloodFiller::FloodFiller |
( |
uint |
width, |
|
|
uint |
height |
|
) |
| |
Constructor.
- Parameters
-
width | internal processing width |
height | internal processing height |
◆ extractAndPropagate()
Extract seeds from the input texture and propagate them so that each pixel contains the coordinates of the closest seed (approximately). The result will be stored in _ping.
- Parameters
-
- Returns
- the internal texture containing the final result
◆ process()
void FloodFiller::process |
( |
const Texture & |
texture, |
|
|
Output |
mode |
|
) |
| |
Fill a given input texture.
- Parameters
-
texture | the GPU ID of the texture |
mode | the output mode (color or distance) |
◆ resize()
void FloodFiller::resize |
( |
uint |
width, |
|
|
uint |
height |
|
) |
| |
Resize the internal buffers.
- Parameters
-
width | the new width |
height | the new height |
◆ texture()
const Texture * FloodFiller::texture |
( |
| ) |
const |
|
inline |
The GPU ID of the filter result.
- Returns
- the ID of the result texture
The documentation for this class was generated from the following files:
- src/engine/processing/FloodFiller.hpp
- src/engine/processing/FloodFiller.cpp