Tucano
0.1
A library for rapid prototyping with modern OpenGL and GLSL
|
A simple mean filter for image processing. More...
#include <meanfilter.hpp>
Public Member Functions | |
MeanFilter (void) | |
Default Constructor. More... | |
virtual void | initialize () |
Initializes the effect, creating and loading the shader. More... | |
void | renderTexture (Tucano::Texture &tex, Eigen::Vector2i viewport) |
Applies the mean filter to an image. More... | |
void | setKernel (int kernel) |
Set kernel size. More... | |
int | getKernelSize (void) |
Returns the current size of the kernel. More... | |
Public Member Functions inherited from Tucano::Effect | |
Effect (string shadersDir="shaders/") | |
Default constructor. More... | |
virtual Shader * | loadShader (string shader_name) |
Loads a shader by filename, initializes it, and inserts in shaders list. More... | |
virtual void | loadShader (Shader &shader, string shader_name) |
virtual Shader * | loadShader (string shader_name, string vertex_name, string frag_name, string geom_name) |
Loads a shader by complete filenames (with extensions), initializes it, and inserts in shaders list. More... | |
void | setShadersDir (string dir) |
virtual void | reloadShaders (void) |
Reloads all shaders needed for effect usage. More... | |
Private Attributes | |
Tucano::Shader | shader |
The mean filter shader. More... | |
int | kernelsize = 3 |
The size of the mean filter kernel (window size to apply convolution) More... | |
Tucano::Mesh | quad |
A quad to be rendered forcing one call of the fragment shader per image pixel. More... | |
Additional Inherited Members | |
Protected Attributes inherited from Tucano::Effect | |
std::vector< Shader * > | shaders_list |
Vector of pointers to shaders used in this effect, in case the user needs multiple pass rendering. More... | |
string | shaders_dir |
Directory in which the shader files are stored. More... | |
A simple mean filter for image processing.
No weights are taken in consideration, averages all neighbors equally.
|
inline |
Default Constructor.
Default kernel size is 3.
|
inline |
Returns the current size of the kernel.
|
inlinevirtual |
Initializes the effect, creating and loading the shader.
Implements Tucano::Effect.
|
inline |
Applies the mean filter to an image.
|
inline |
Set kernel size.
kernel | Given kernel size. |
|
private |
The size of the mean filter kernel (window size to apply convolution)
|
private |
A quad to be rendered forcing one call of the fragment shader per image pixel.
|
private |
The mean filter shader.