Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
WoWDisplayShader.hh
1 /*
2  * WoWDisplayShader.hh
3  *
4  * Created on: Feb 9, 2010
5  * Author: africk
6  */
7 
8 #ifndef __WOW_DISPLAY_SHADER_HH__
9 #define __WOW_DISPLAY_SHADER_HH__
10 
11 #include <OpenGLFramework/Base/glfTexture2D.hh>
12 #include <OpenGLFramework/Base/glfBatch.hh>
13 #include <OpenGLFramework/Base/glfFramebufferObject.hh>
14 #include <OpenGLFramework/SpecializedBatches/PerPixelProcessingBase.hh>
15 
16 #include <bias_config.h>
17 
18 namespace BIAS {
19 
20 class BIASOpenGLFramework_EXPORT WoWDisplayShader: public PerPixelProcessingBase {
21 public:
23  virtual ~WoWDisplayShader();
24 
25  void SetDisparityImage(glfTexture2D* dispImage);
26  void SetColorImage(glfTexture2D* colorImage);
27 
28  void Init(int mode = 0);
29 
30  void Draw();
31 
32  void FlipColorImage(bool flip) {
33  if (flip) {
34  flip_ = 1;
35  } else {
36  flip_ = 0;
37  }
38  }
39 
40  void SetScale(float scale) {
41  scale_ = scale;
42  }
43 
44  void UseOcclLayer(bool occlLayer) {
45  if (occlLayer) {
46  withOcclLayer_ = 1;
47  } else {
48  withOcclLayer_ = 0;
49  }
50  }
51 
52  void SetHeader(std::vector<int>& header) {
53  header_ = header;
54  }
55 
56 private:
57 
58  int mode_;
59 
60  int flip_;
61 
62  int withOcclLayer_;
63 
64  float scale_;
65 
66  unsigned int width_, height_;
67 
68  int wowFactor_, wowOffset_;
69 
70  int fullheader_[256];
71  int newFullHeader_[512];
72  std::vector<int> header_;
73 
74  glfTexture2D* dispImageP_;
75  glfTexture2D* colorImageP_;
76 
77  std::string fragmentShaderCode_;
78  std::string fragmentShaderCode1_;
79 
80  void CreateHeader_(int* fullheader, int wowFactor, int wowOffset);
81  void CreateHeader2_(int* header, int wowFactor, int wowOffset);
82 };
83 }
84 
85 #endif /* __WOW_DISPLAY_SHADER_HH__ */
void SetHeader(std::vector< int > &header)
A 2D texture.
Definition: glfTexture2D.hh:40
void SetScale(float scale)
void UseOcclLayer(bool occlLayer)
void FlipColorImage(bool flip)
this class can be used as a simple base class for specialized batches