PICCANTE  0.4
The hottest HDR imaging library!
filter_laplacian.hpp
Go to the documentation of this file.
1 /*
2 
3 PICCANTE
4 The hottest HDR imaging library!
5 http://vcg.isti.cnr.it/piccante
6 
7 Copyright (C) 2014
8 Visual Computing Laboratory - ISTI CNR
9 http://vcg.isti.cnr.it
10 First author: Francesco Banterle
11 
12 This Source Code Form is subject to the terms of the Mozilla Public
13 License, v. 2.0. If a copy of the MPL was not distributed with this
14 file, You can obtain one at http://mozilla.org/MPL/2.0/.
15 
16 */
17 
18 #ifndef PIC_GL_FILTERING_FILTER_LAPLACIAN_HPP
19 #define PIC_GL_FILTERING_FILTER_LAPLACIAN_HPP
20 
21 #include "../../gl/filtering/filter.hpp"
22 
23 namespace pic {
24 
29 {
30 protected:
34  void initShaders()
35  {
37  (
38  uniform sampler2D u_tex; \n
39  out vec4 f_color; \n
40 
41  void main(void) {
42  \n
43  ivec2 coords = ivec2(gl_FragCoord.xy);\n
44  vec3 color = -4.0 * texelFetch(u_tex, coords, 0).xyz;\n
45  color += texelFetch(u_tex, coords + ivec2(1, 0), 0).xyz;\n
46  color += texelFetch(u_tex, coords - ivec2(1, 0), 0).xyz;\n
47  color += texelFetch(u_tex, coords + ivec2(0, 1), 0).xyz;\n
48  color += texelFetch(u_tex, coords - ivec2(0, 1), 0).xyz;\n
49  f_color = vec4(color, 1.0);
50  }\n
51  );
52 
53  //
54  //
55  //
56 
57  technique.initStandard("330", vertex_source, fragment_source, "FilterGLLaplacian");
58  }
59 
60 public:
61 
66  {
67  //protected values are assigned/computed
68  initShaders();
69  }
70 
72  {
73  release();
74  }
75 };
76 
77 } // end namespace pic
78 
79 #endif /* PIC_GL_FILTERING_FILTER_LAPLACIAN_HPP */
80 
TechniqueGL technique
Definition: display.hpp:45
~FilterGLLaplacian()
Definition: filter_laplacian.hpp:71
#define MAKE_STRING(input_string)
void initShaders()
initShaders
Definition: filter_laplacian.hpp:34
The FilterGL class.
Definition: filter.hpp:35
FilterGLLaplacian()
FilterGLLaplacian.
Definition: filter_laplacian.hpp:65
bool initStandard(std::string version_number, std::string vertex_shader_source, std::string fragment_shader_source, std::string name)
initStandard
Definition: display.hpp:114
std::string vertex_source
Definition: display.hpp:57
Definition: bilateral_separation.hpp:25
std::string fragment_source
Definition: display.hpp:57
The FilterGLLaplacian class.
Definition: filter_laplacian.hpp:28
void release()
release
Definition: display.hpp:85