47 #include <ACG/Config/ACGDefines.hh> 48 #include <ACG/Math/GLMatrixT.hh> 49 #include <ACG/GL/gl.hh> 51 #include <QStringList> 104 bool execute(GLuint _srcTexture,
ACG::FBO* _dstFBO = 0, GLuint _dstColorAttachment = GL_COLOR_ATTACHMENT0, GLuint _tempColorAttachment = 0);
112 void resizeInput(
int _texWidth,
int _texHeight);
134 virtual GLSL::Program* setupPass(
int _pass, GLuint _srcTex) = 0;
140 virtual void updateKernel() = 0;
172 GaussianBlurFilter(
int _texWidth,
int _texHeight,
int _blurRadius,
float _blurSigma = 1.0f, GLenum _internalfmt = GL_RGBA);
182 void setKernel(
int _blurRadius,
float _blurSigma);
194 const std::vector<ACG::Vec2f>&
offsetsX()
const {
return offsetsX_;}
197 const std::vector<ACG::Vec2f>&
offsetsY()
const {
return offsetsY_;}
200 const std::vector<float>&
weights()
const {
return weights_;}
204 virtual GLSL::Program* setupPass(
int _pass, GLuint _srcTex)
override;
206 void updateKernel()
override;
221 std::vector<ACG::Vec2f> offsetsY_;
242 BilateralBlurFilter(
int _texWidth,
int _texHeight,
int _blurRadius,
float _blurSigmaS = 1.0f,
float blurSigmaR = 1.0f, GLenum _internalfmt = GL_RGBA);
256 depthTex_ = _depthTex;
266 void setKernel(
int _blurRadius,
float _blurSigmaS,
float _blurSigmaR);
279 const std::vector<ACG::Vec2f>&
offsetsX()
const {
return offsetsX_;}
282 const std::vector<ACG::Vec2f>&
offsetsY()
const {
return offsetsY_;}
285 virtual GLSL::Program* setupPass(
int _pass, GLuint _srcTex)
override;
287 void updateKernel()
override;
302 std::vector<ACG::Vec2f> offsetsY_;
338 bool execute(GLuint _srcTexture,
float _blurRadius = 1.0f,
float _blurIntensity = 0.0025f,
const ACG::Vec2f& _blurCenter =
ACG::Vec2f(0.5f, 0.5f));
345 void setKernel(
int _numSamples);
370 PoissonBlurFilter(
float _radius,
float _sampleDistance,
int _numTries = 30,
bool _disk =
true,
bool _tilingCheck =
false);
382 bool execute(GLuint _srcTex,
float _kernelScale = 1.0f);
398 bool disk()
const {
return disk_; }
401 const std::vector<ACG::Vec2f>&
samples()
const {
return samples_;}
404 void dumpSamples(
const char* _filename);
407 void plotSamples(QImage* _image);
413 float sampleDistance_;
418 std::vector<ACG::Vec2f> samples_;
421 std::vector<ACG::Vec2f> samplesScaled_;
const std::vector< float > & weights() const
sample weights
const std::vector< ACG::Vec2f > & offsetsY() const
sample offsets along y direction
int texWidth() const
input texture width
const std::vector< ACG::Vec2f > & offsetsX() const
sample offsets along x direction
float sampleDistance() const
min distance between two samples
int numSamples() const
number of samples
Namespace providing different geometric functions concerning angles.
const std::vector< ACG::Vec2f > & offsetsY() const
sample offsets along y direction
const ACG::Vec2f & texelSize() const
texel size in uv space
GLenum internalFormat() const
internal format of the input texture
int texHeight() const
input texture height
virtual ~RadialBlurFilter()
Class destructor.
int sigma() const
blur sigma
QStringList macros_
shader macros
std::vector< float > weights_
kernel weights
const std::vector< ACG::Vec2f > & offsetsX() const
sample offsets along x direction
ACG::Vec2f sigma_
(sigmaS, sigmaR)
float radius() const
radius
std::vector< float > spatialKernel_
precomputed sample -r^2 / (2 * sigma_s^2)
int samples() const
number of samples
This namespace contains all the classes and functions for handling GLSL shader and program objects...
bool disk() const
samples inside disk or square area
int samples() const
number of samples
std::vector< ACG::Vec2f > offsetsX_
filter taps
ACG::Vec2f sigma2Rcp_
-1 / (2 * sigma^2)
const std::vector< ACG::Vec2f > & samples() const
disk sample offsets
int numTries() const
number of iterations per sample
int samples() const
number of samples
const ACG::Vec2f & sigma() const
blur (sigmaS, sigmaR)
QStringList macros_
shader macros
std::vector< ACG::Vec2f > offsetsX_
filter taps