2 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
3 * Copyright (C) <2007> Wim Taymans <wim.taymans@collabora.co.uk>
4 * Copyright (C) <2007> Edward Hervey <edward.hervey@collabora.co.uk>
5 * Copyright (C) <2007> Jan Schmidt <thaytan@noraisin.net>
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
23 #ifndef __GST_ALPHA_H__
24 #define __GST_ALPHA_H__
27 #include <gst/video/video.h>
28 #include <gst/video/gstvideofilter.h>
29 #include <gst/controller/gstcontroller.h>
33 #define GST_TYPE_ALPHA \
34 (gst_alpha_get_type())
35 #define GST_ALPHA(obj) \
36 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ALPHA,GstAlpha))
37 #define GST_ALPHA_CLASS(klass) \
38 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_ALPHA,GstAlphaClass))
39 #define GST_IS_ALPHA(obj) \
40 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ALPHA))
41 #define GST_IS_ALPHA_CLASS(klass) \
42 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ALPHA))
44 typedef struct _GstAlpha GstAlpha;
45 typedef struct _GstAlphaClass GstAlphaClass;
49 * @ALPHA_METHOD_SET: Set/adjust alpha channel
50 * @ALPHA_METHOD_GREEN: Chroma Key green
51 * @ALPHA_METHOD_BLUE: Chroma Key blue
52 * @ALPHA_METHOD_CUSTOM: Chroma Key on target_r/g/b
63 GST_DEBUG_CATEGORY_STATIC (gst_alpha_debug);
64 #define GST_CAT_DEFAULT gst_alpha_debug
68 GstVideoFilter parent;
73 #if !GLIB_CHECK_VERSION (2, 31, 0)
79 GstVideoFormat in_format, out_format;
81 gboolean in_sdtv, out_sdtv;
90 GstAlphaMethod method;
94 guint black_sensitivity;
95 guint white_sensitivity;
97 gboolean prefer_passthrough;
99 /* processing function */
100 void (*process) (const guint8 *src, guint8 *dest, gint width, gint height, GstAlpha *alpha);
102 /* precalculated values for chroma keying */
105 guint8 accept_angle_tg;
106 guint8 accept_angle_ctg;
112 struct _GstAlphaClass
114 GstVideoFilterClass parent_class;
117 GType gst_alpha_get_type (void);
121 #endif /* __GST_ALPHA_H__ */