H3D API  2.4.1
GaussianFilterShader.h
Go to the documentation of this file.
1 // Copyright 2004-2019, SenseGraphics AB
3 //
4 // Any use, or distribution, of this file without permission from the
5 // copyright holders is strictly prohibited. Please contact SenseGraphics,
6 // www.sensegraphics.com, for more information.
7 //
8 //
12 //
14 #ifndef __GAUSSIANFILTERSHADER_H__
15 #define __GAUSSIANFILTERSHADER_H__
16 
17 #include <H3D/MFFloat.h>
19 
20 namespace H3D {
49  class H3DAPI_API GaussianFilterShader :
52  public:
53 
54  class H3DAPI_API MFWeights :
55  public TypedField< MFFloat, void, AnyNumber< Field > > {
56  protected:
57  virtual void update();
58  };
59 
61  GaussianFilterShader( Inst< DisplayList > _displayList = 0,
62  Inst< SFNode > _metadata = 0,
63  Inst< SFBool > _isSelected = 0,
64  Inst< SFBool > _isValid = 0,
65  Inst< SFBool > _activate = 0,
66  Inst< SFString > _language = 0,
67  Inst< MFShaderPart > _parts = 0,
68  Inst< SFBool > _suppressUniformWarnings = 0,
69  Inst< MFString > _fragmentShaderString = 0,
70  Inst< MFString > _vertexShaderString = 0,
71  Inst< SFTexture2DNode > _texture = 0,
72  Inst< SFString > _type = 0,
73  Inst< MFWeights > _weights = 0,
74  Inst< SFInt32 > _kernelSize = 0,
75  Inst< SFFloat > _sigma = 0,
76  Inst< SFFloat > _pixelStepOffset = 0,
77  Inst< SFInt32> _width = 0,
78  Inst< SFInt32> _height = 0,
79  Inst< TextureMonitor> _widthInUse = 0,
80  Inst< TextureMonitor> _heightInUse = 0);
81 
89  H3DUniquePtr< SFFloat > sigma;
90 
91 
94  protected:
95 
96  virtual bool canBuildShader();
97  std::vector<float> gauss2D( int x, int y, float _sigma );
98  std::vector<float> gauss1D( int x, float _sigma );
99 
101  //virtual void generateKernel();
102 
103 
104 
105  };
106 }
107 
108 #endif
Header file for ConvolutionFilterShader.
Contains the MFFloat field class.
The ConvolutionFilterShader node generates a shader that applies a convolution filter kernel to the i...
Definition: ConvolutionFilterShader.h:75
Specialized field that reCalculate the kernel when it updates.
Definition: GaussianFilterShader.h:55
The GaussianFilterShader is a ConvolutionFilterShader node where the weights are automatically calcul...
Definition: GaussianFilterShader.h:50
H3DUniquePtr< SFFloat > sigma
The sigma field is the sigma value in the gaussian function and decides how much blur the result will...
Definition: GaussianFilterShader.h:89
static H3DNodeDatabase database
The H3DNodeDatabase for this node.
Definition: GaussianFilterShader.h:93
A template modifier class for adding type checking on the routes to any Field class.
Definition: TypedField.h:84
H3DDouble x
H3D API namespace.
Definition: Anchor.h:38
The H3DNodeDatabase contains a mapping between a name of a Node and the constructor for the Node with...
Definition: H3DNodeDatabase.h:194