2010-03-15 18:07:28 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
|
|
|
* Copyright (C) <2007> Wim Taymans <wim.taymans@collabora.co.uk>
|
|
|
|
* Copyright (C) <2007> Edward Hervey <edward.hervey@collabora.co.uk>
|
|
|
|
* Copyright (C) <2007> Jan Schmidt <thaytan@noraisin.net>
|
|
|
|
*
|
|
|
|
* 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-04 00:07:18 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
2010-03-15 18:07:28 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GST_ALPHA_H__
|
|
|
|
#define __GST_ALPHA_H__
|
|
|
|
|
|
|
|
#include <gst/gst.h>
|
|
|
|
#include <gst/video/video.h>
|
|
|
|
#include <gst/video/gstvideofilter.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2019-06-06 09:03:34 +00:00
|
|
|
#define GST_TYPE_ALPHA (gst_alpha_get_type ())
|
|
|
|
|
|
|
|
G_DECLARE_FINAL_TYPE (GstAlpha, gst_alpha, GST, ALPHA, GstVideoFilter)
|
|
|
|
|
2018-10-22 09:39:24 +00:00
|
|
|
/**
|
2010-04-08 13:51:27 +00:00
|
|
|
* GstAlphaMethod:
|
2010-04-08 11:13:34 +00:00
|
|
|
* @ALPHA_METHOD_SET: Set/adjust alpha channel
|
|
|
|
* @ALPHA_METHOD_GREEN: Chroma Key green
|
|
|
|
* @ALPHA_METHOD_BLUE: Chroma Key blue
|
|
|
|
* @ALPHA_METHOD_CUSTOM: Chroma Key on target_r/g/b
|
|
|
|
*/
|
2010-03-15 18:07:28 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
ALPHA_METHOD_SET,
|
|
|
|
ALPHA_METHOD_GREEN,
|
|
|
|
ALPHA_METHOD_BLUE,
|
|
|
|
ALPHA_METHOD_CUSTOM,
|
|
|
|
}
|
|
|
|
GstAlphaMethod;
|
|
|
|
|
|
|
|
GST_DEBUG_CATEGORY_STATIC (gst_alpha_debug);
|
|
|
|
#define GST_CAT_DEFAULT gst_alpha_debug
|
|
|
|
|
|
|
|
struct _GstAlpha
|
|
|
|
{
|
|
|
|
GstVideoFilter parent;
|
|
|
|
|
2010-03-19 17:18:08 +00:00
|
|
|
/* <private> */
|
|
|
|
|
2010-03-15 18:07:28 +00:00
|
|
|
/* caps */
|
2011-12-12 02:31:36 +00:00
|
|
|
GMutex lock;
|
2010-05-26 11:13:44 +00:00
|
|
|
|
2010-03-19 17:11:12 +00:00
|
|
|
gboolean in_sdtv, out_sdtv;
|
2010-03-15 18:07:28 +00:00
|
|
|
|
2010-03-19 17:18:08 +00:00
|
|
|
/* properties */
|
2010-03-15 18:07:28 +00:00
|
|
|
gdouble alpha;
|
|
|
|
|
|
|
|
guint target_r;
|
|
|
|
guint target_g;
|
|
|
|
guint target_b;
|
|
|
|
|
|
|
|
GstAlphaMethod method;
|
|
|
|
|
|
|
|
gfloat angle;
|
|
|
|
gfloat noise_level;
|
|
|
|
guint black_sensitivity;
|
|
|
|
guint white_sensitivity;
|
|
|
|
|
2010-05-26 11:13:44 +00:00
|
|
|
gboolean prefer_passthrough;
|
|
|
|
|
2010-03-19 17:18:08 +00:00
|
|
|
/* processing function */
|
2011-07-04 14:09:33 +00:00
|
|
|
void (*process) (const GstVideoFrame *in_frame, GstVideoFrame *out_frame, GstAlpha *alpha);
|
2010-03-19 17:18:08 +00:00
|
|
|
|
|
|
|
/* precalculated values for chroma keying */
|
2010-03-15 18:07:28 +00:00
|
|
|
gint8 cb, cr;
|
|
|
|
gint8 kg;
|
|
|
|
guint8 accept_angle_tg;
|
|
|
|
guint8 accept_angle_ctg;
|
|
|
|
guint8 one_over_kc;
|
|
|
|
guint8 kfgy_scale;
|
2010-03-19 17:18:08 +00:00
|
|
|
guint noise_level2;
|
2010-03-15 18:07:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __GST_ALPHA_H__ */
|