2008-08-13 18:58:49 +00:00
|
|
|
/*
|
|
|
|
* GStreamer
|
|
|
|
* Copyright (C) 2008 Filippo Argiolas <filippo.argiolas@gmail.com>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
2012-11-08 11:53:56 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
2008-08-13 18:58:49 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GST_GL_EFFECTS_H__
|
|
|
|
#define __GST_GL_EFFECTS_H__
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <gstglfilter.h>
|
2008-08-13 20:36:13 +00:00
|
|
|
#include <gstgleffectssources.h>
|
2008-08-13 18:58:49 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2008-08-13 20:36:13 +00:00
|
|
|
|
2008-08-13 18:58:49 +00:00
|
|
|
#define GST_TYPE_GL_EFFECTS (gst_gl_effects_get_type())
|
|
|
|
#define GST_GL_EFFECTS(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_GL_EFFECTS,GstGLEffects))
|
|
|
|
#define GST_IS_GL_EFFECTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_GL_EFFECTS))
|
|
|
|
#define GST_GL_EFFECTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass) , GST_TYPE_GL_EFFECTS,GstGLEffectsClass))
|
|
|
|
#define GST_IS_GL_EFFECTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) , GST_TYPE_GL_EFFECTS))
|
|
|
|
#define GST_GL_EFFECTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj) , GST_TYPE_GL_EFFECTS,GstGLEffectsClass))
|
|
|
|
|
|
|
|
typedef struct _GstGLEffects GstGLEffects;
|
|
|
|
typedef struct _GstGLEffectsClass GstGLEffectsClass;
|
|
|
|
|
|
|
|
typedef void (* GstGLEffectProcessFunc) (GstGLEffects *effects);
|
|
|
|
|
2010-04-29 10:59:42 +00:00
|
|
|
#define NEEDED_TEXTURES 5
|
2008-08-13 18:58:49 +00:00
|
|
|
|
2008-08-14 09:31:09 +00:00
|
|
|
enum {
|
|
|
|
GST_GL_EFFECTS_CURVE_HEAT,
|
|
|
|
GST_GL_EFFECTS_CURVE_SEPIA,
|
2008-08-14 10:09:39 +00:00
|
|
|
GST_GL_EFFECTS_CURVE_XPRO,
|
2008-08-14 19:29:02 +00:00
|
|
|
GST_GL_EFFECTS_CURVE_LUMA_XPRO,
|
2008-10-15 14:18:22 +00:00
|
|
|
GST_GL_EFFECTS_CURVE_XRAY,
|
2008-08-14 09:31:09 +00:00
|
|
|
GST_GL_EFFECTS_N_CURVES
|
|
|
|
};
|
|
|
|
|
2008-08-13 18:58:49 +00:00
|
|
|
struct _GstGLEffects
|
|
|
|
{
|
|
|
|
GstGLFilter filter;
|
|
|
|
|
|
|
|
GstGLEffectProcessFunc effect;
|
|
|
|
gint current_effect;
|
|
|
|
|
|
|
|
GLuint intexture;
|
|
|
|
GLuint midtexture[NEEDED_TEXTURES];
|
|
|
|
GLuint outtexture;
|
|
|
|
|
2008-08-14 09:31:09 +00:00
|
|
|
GLuint curve[GST_GL_EFFECTS_N_CURVES];
|
|
|
|
|
2008-08-13 18:58:49 +00:00
|
|
|
GHashTable *shaderstable;
|
2008-08-14 20:28:19 +00:00
|
|
|
|
|
|
|
gboolean horizontal_swap; /* switch left to right */
|
2009-11-21 20:40:14 +00:00
|
|
|
|
|
|
|
#ifdef OPENGL_ES2
|
|
|
|
GLint draw_attr_position_loc;
|
|
|
|
GLint draw_attr_texture_loc;
|
|
|
|
#endif
|
2008-08-13 18:58:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GstGLEffectsClass
|
|
|
|
{
|
|
|
|
GstGLFilterClass filter_class;
|
|
|
|
};
|
|
|
|
|
2008-08-13 20:36:13 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
PROP_0,
|
2008-08-14 20:28:19 +00:00
|
|
|
PROP_EFFECT,
|
|
|
|
PROP_HSWAP
|
2008-08-13 20:36:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-08-13 18:58:49 +00:00
|
|
|
GType gst_gl_effects_get_type (void);
|
|
|
|
|
2012-09-25 08:06:14 +00:00
|
|
|
void gst_gl_effects_draw_texture (GstGLEffects * effects, GLuint tex, guint width, guint height);
|
2008-08-13 18:58:49 +00:00
|
|
|
|
2008-08-13 20:36:13 +00:00
|
|
|
void gst_gl_effects_identity (GstGLEffects *effects);
|
2008-08-13 18:58:49 +00:00
|
|
|
void gst_gl_effects_mirror (GstGLEffects *effects);
|
2008-08-13 22:07:20 +00:00
|
|
|
void gst_gl_effects_squeeze (GstGLEffects *effects);
|
2008-08-14 06:03:49 +00:00
|
|
|
void gst_gl_effects_stretch (GstGLEffects *effects);
|
2008-08-14 12:08:23 +00:00
|
|
|
void gst_gl_effects_tunnel (GstGLEffects *effects);
|
|
|
|
void gst_gl_effects_fisheye (GstGLEffects *effects);
|
|
|
|
void gst_gl_effects_twirl (GstGLEffects *effects);
|
|
|
|
void gst_gl_effects_bulge (GstGLEffects *effects);
|
|
|
|
void gst_gl_effects_square (GstGLEffects *effects);
|
2008-08-14 09:31:09 +00:00
|
|
|
void gst_gl_effects_heat (GstGLEffects *effects);
|
|
|
|
void gst_gl_effects_sepia (GstGLEffects *effects);
|
2008-08-14 10:09:39 +00:00
|
|
|
void gst_gl_effects_xpro (GstGLEffects *effects);
|
2008-10-15 14:18:22 +00:00
|
|
|
void gst_gl_effects_xray (GstGLEffects *effects);
|
2008-08-14 19:29:02 +00:00
|
|
|
void gst_gl_effects_luma_xpro (GstGLEffects *effects);
|
2008-08-16 07:13:39 +00:00
|
|
|
void gst_gl_effects_sin (GstGLEffects *effects);
|
2008-08-14 07:26:23 +00:00
|
|
|
void gst_gl_effects_glow (GstGLEffects *effects);
|
2008-08-13 18:58:49 +00:00
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /*__GST_GL_EFFECTS_H__ */
|