Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
FilteringApp.hpp
1#pragma once
2
3#include "PaintingTool.hpp"
4
5#include "processing/PoissonFiller.hpp"
6#include "processing/LaplacianIntegrator.hpp"
7#include "processing/GaussianBlur.hpp"
8#include "processing/BoxBlur.hpp"
9#include "processing/FloodFiller.hpp"
10
11#include "resources/Texture.hpp"
12#include "input/ControllableCamera.hpp"
13#include "system/Config.hpp"
14
15#include "Application.hpp"
16
17#include "Common.hpp"
18
25class FilteringApp final : public CameraApp {
26
27public:
32 explicit FilteringApp(RenderingConfig & config, Window & window);
33
35 void draw() override;
36
38 void update() override;
39
41 void physics(double fullTime, double frameTime) override;
42
44 void resize() override;
45
46private:
48 enum class Processing : int {
49 INPUT = 0,
50 FILL,
51 INTEGRATE,
52 BOXBLUR,
53 GAUSSBLUR,
54 FLOODFILL
55 };
56
58 enum class View : int {
59 SCENE = 0,
60 IMAGE,
61 PAINT
62 };
63
65 void showModeOptions();
66
69
70 std::unique_ptr<PoissonFiller> _pyramidFiller;
71 std::unique_ptr<LaplacianIntegrator> _pyramidIntegrator;
72 std::unique_ptr<GaussianBlur> _gaussianBlur;
73 std::unique_ptr<BoxBlur> _boxBlur;
74 std::unique_ptr<FloodFiller> _floodFill;
75 std::unique_ptr<PaintingTool> _painter;
76
79 const Mesh * _mesh;
80
81 Processing _mode = Processing::INPUT;
82 View _viewMode = View::SCENE;
83 Texture _image = Texture("image");
84
85 int _blurLevel = 3;
86 int _intDownscale = 1;
88 bool _showProcInput = false;
89};
double frameTime()
Definition: Application.cpp:87
Window & window()
Definition: Application.cpp:95
Application with an interactive camera.
Definition: Application.hpp:89
Apply multiple image filters on an interactive rendering of a scene.
Definition: FilteringApp.hpp:25
void physics(double fullTime, double frameTime) override
Definition: FilteringApp.cpp:218
void showModeOptions()
Definition: FilteringApp.cpp:182
int _blurLevel
Gaussian blur level.
Definition: FilteringApp.hpp:85
Program * _passthrough
Basic blit shader.
Definition: FilteringApp.hpp:77
int _fillDownscale
Poisson filling internal resolution downscaling.
Definition: FilteringApp.hpp:87
void resize() override
Definition: FilteringApp.cpp:221
Texture _image
The image to display in Image view mode.
Definition: FilteringApp.hpp:83
std::unique_ptr< FloodFiller > _floodFill
Flood filling.
Definition: FilteringApp.hpp:74
void draw() override
Definition: FilteringApp.cpp:36
bool _showProcInput
Option to show the input for both convolution filters.
Definition: FilteringApp.hpp:88
void update() override
Definition: FilteringApp.cpp:115
View _viewMode
Current view mode.
Definition: FilteringApp.hpp:82
Texture _sceneDepth
Scene rendering depth texture.
Definition: FilteringApp.hpp:68
std::unique_ptr< PaintingTool > _painter
The painting interface.
Definition: FilteringApp.hpp:75
std::unique_ptr< PoissonFiller > _pyramidFiller
Poisson filling.
Definition: FilteringApp.hpp:70
Processing
The filter to apply.
Definition: FilteringApp.hpp:48
std::unique_ptr< LaplacianIntegrator > _pyramidIntegrator
Laplacian integration.
Definition: FilteringApp.hpp:71
Program * _sceneShader
Object rendering shader.
Definition: FilteringApp.hpp:78
View
The viewing mode: either a rendering, a still image or a painting canvas.
Definition: FilteringApp.hpp:58
int _intDownscale
Integrator internal resolution downscaling.
Definition: FilteringApp.hpp:86
const Mesh * _mesh
Basic sphere mesh.
Definition: FilteringApp.hpp:79
Processing _mode
Current filter mode.
Definition: FilteringApp.hpp:81
std::unique_ptr< BoxBlur > _boxBlur
Box blur processing.
Definition: FilteringApp.hpp:73
std::unique_ptr< GaussianBlur > _gaussianBlur
Gaussian blur processing.
Definition: FilteringApp.hpp:72
Texture _sceneColor
Scene rendering color texture.
Definition: FilteringApp.hpp:67
Represents a geometric mesh composed of vertices, other attributes and triangles.
Definition: Mesh.hpp:15
Represents a group of shaders used for rendering.
Definition: Program.hpp:31
Configuration containing parameters for windows and renderers.
Definition: Config.hpp:113
Represents a texture containing one or more images, stored on the CPU and/or GPU.
Definition: Texture.hpp:12
Represent an OS window and its associated rendering context.
Definition: Window.hpp:14
@ FILL
As filled polygons.