90 void setProgram(std::string
const & vertex_shader, std::string
const & frag_shader);
109 void process(cv::Mat
const & src, cv::Mat & dst);
113 std::string itsVshader, itsFshader;
114 volatile bool itsProgramChanged;
116 std::shared_ptr<GPUtexture> itsSrcTex;
117 std::shared_ptr<GPUprogram> itsProgram;
118 GLuint itsQuadVertexBuffer;
119 EGLDisplay itsDisplay;
121 EGLContext itsContext;
122 EGLSurface itsSurface;
123 GLuint itsFramebufferId;
124 GLuint itsRenderbufferId;
125 GLuint itsRenderWidth, itsRenderHeight;
127 enum paramtype { F2, I2, F1, I1 };
128 struct param { paramtype type;
float val[2]; };
130 std::map<std::string, param> itsProgramParams;
132 mutable std::mutex itsMutex;
Simple image filtering using OpenGL-ES on the GPU.
void setProgramParam2f(std::string name, float val1, float val2)
Set some program parameters, 2 float version.
void setProgramParam1i(std::string name, int val)
Set some program parameters, 1 int version.
void setProgram(std::string const &vertex_shader, std::string const &frag_shader)
Set an image processing program.
void setProgramParam1f(std::string name, float val)
Set some program parameters, 1 float version.
void setProgramParam2i(std::string name, int val1, int val2)
Set some program parameters, 2 int version.
void process(cv::Mat const &src, cv::Mat &dst)
Process an image. The dst image should be allocated with correct image size and pixel type.