GLIP-Lib
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
FFT.hpp
Go to the documentation of this file.
1 /* ************************************************************************************************************* */
2 /* */
3 /* GLIP-LIB */
4 /* OpenGL Image Processing LIBrary */
5 /* */
6 /* Author : R. Kerviche */
7 /* LICENSE : MIT License */
8 /* Website : glip-lib.net */
9 /* */
10 /* File : FFT.hpp */
11 /* Original Date : August 20th 2012 */
12 /* */
13 /* Description : FFT pipeline generators for gray level input (real and complex). */
14 /* */
15 /* ************************************************************************************************************* */
16 
24 #ifndef __FFT1D_INCLUDE__
25 #define __FFT1D_INCLUDE__
26 
27  // Includes
28  #include "Core/LibTools.hpp"
29  #include "Core/OglInclude.hpp"
31 
32 namespace Glip
33 {
34  using namespace Glip::CoreGL;
35  using namespace Glip::CorePipeline;
36 
37  namespace Modules
38  {
39  namespace FFTModules
40  {
42  enum Flag
43  {
45  Shifted = 0x00001,
47  Inversed = 0x00010,
49  ZeroPadding = 0x00100,
51  CompatibilityMode = 0x01000,
53  NoInput = 0x10000
54  // Update Flag getFlag(const std::string& str)
55  };
56 
57  GLIP_API_FUNC Flag getFlag(const std::string& str);
58  }
59 
95  class GLIP_API GenerateFFT1DPipeline : public LayoutLoaderModule
96  {
97  private :
98  static ShaderSource generateRadix2Code(int width, int currentLevel, int flags, const ShaderSource& pre);
99  static ShaderSource generateLastShuffleCode(int width, int flags, const ShaderSource& post);
100 
101  public :
102  GenerateFFT1DPipeline(void);
103 
104  void apply(LAYOUT_LOADER_ARGUMENTS_LIST);
105 
106  static const std::string getInputPortName(void);
107  static const std::string getOutputPortName(void);
108  static PipelineLayout generate(int width, int flags = 0, const ShaderSource& pre=std::string(), const ShaderSource& post=std::string());
109  };
110 
147  {
148  private :
149  static ShaderSource generateRadix2Code(int width, int oppositeWidth, int currentLevel, int flags, bool horizontal, const ShaderSource& pre);
150  static ShaderSource generateLastShuffleCode(int width, int oppositeWidth, int flags, bool horizontal, const ShaderSource& post);
151 
152  public :
153  GenerateFFT2DPipeline(void);
154 
155  void apply(LAYOUT_LOADER_ARGUMENTS_LIST);
156 
157  static const std::string getInputPortName(void);
158  static const std::string getOutputPortName(void);
159  static PipelineLayout generate(int width, int height, int flags = 0, const ShaderSource& pre=std::string(), const ShaderSource& post=std::string());
160  };
161  }
162 }
163 
164 #endif
165 
Specific defines for the API structure.
Module description for the LayoutLoader class.
Definition: LayoutLoaderModules.hpp:746
Definition: Component.hpp:32
Definition: Component.hpp:41
Generate a 1D FFT PipelineLayout.
Definition: FFT.hpp:95
Shader source code and infos.
Definition: ShaderSource.hpp:55
#define LAYOUT_LOADER_ARGUMENTS_LIST
Definition: LayoutLoaderModules.hpp:848
Pipeline layout.
Definition: Pipeline.hpp:185
Generate a 2D FFT PipelineLayout.
Definition: FFT.hpp:146
OpenGL includes and tools.
Definition: Component.hpp:34
Layout Loader Modules.