1 /*
2  * GStreamer
3  * Copyright (C) 2008 Julien Isorce <julien.isorce@gmail.com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef _GST_GL_FILTERCUBE_H_
22 #define _GST_GL_FILTERCUBE_H_
23 
24 #include <gst/gl/gstglfilter.h>
25 #include <gst/gl/gstglfuncs.h>
26 
27 G_BEGIN_DECLS
28 
29 #define GST_TYPE_GL_FILTER_CUBE            (gst_gl_filter_cube_get_type())
30 #define GST_GL_FILTER_CUBE(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GL_FILTER_CUBE,GstGLFilterCube))
31 #define GST_IS_GL_FILTER_CUBE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_GL_FILTER_CUBE))
32 #define GST_GL_FILTER_CUBE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass) ,GST_TYPE_GL_FILTER_CUBE,GstGLFilterCubeClass))
33 #define GST_IS_GL_FILTER_CUBE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) ,GST_TYPE_GL_FILTER_CUBE))
34 #define GST_GL_FILTER_CUBE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj) ,GST_TYPE_GL_FILTER_CUBE,GstGLFilterCubeClass))
35 
36 typedef struct _GstGLFilterCube GstGLFilterCube;
37 typedef struct _GstGLFilterCubeClass GstGLFilterCubeClass;
38 
39 struct _GstGLFilterCube
40 {
41     GstGLFilter filter;
42 
43     GstGLShader *shader;
44     GstGLMemory *in_tex;
45 
46     /* background color */
47     gfloat red;
48     gfloat green;
49     gfloat blue;
50 
51     /* perspective */
52     gdouble fovy;
53     gdouble aspect;
54     gdouble znear;
55     gdouble zfar;
56 
57     GLuint             vao;
58     GLuint             vbo_indices;
59     GLuint             vertex_buffer;
60     GLint              attr_position;
61     GLint              attr_texture;
62 
63     GLfloat            xrot, yrot, zrot;
64 };
65 
66 struct _GstGLFilterCubeClass
67 {
68     GstGLFilterClass filter_class;
69 };
70 
71 GType gst_gl_filter_cube_get_type (void);
72 
73 G_END_DECLS
74 
75 #endif /* _GST_GLFILTERCUBE_H_ */
76