1 /*
2  * Copyright (C) 2009 Sebastian Dröge <sebastian.droege@collabora.co.uk>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19 
20 #ifndef __BLEND_H__
21 #define __BLEND_H__
22 
23 #include <gst/gst.h>
24 #include <gst/video/video.h>
25 
26 typedef void (*BlendFunction) (GstVideoFrame *srcframe, gint xpos, gint ypos, gdouble src_alpha, GstVideoFrame * destframe);
27 typedef void (*FillCheckerFunction) (GstVideoFrame * frame);
28 typedef void (*FillColorFunction) (GstVideoFrame * frame, gint c1, gint c2, gint c3);
29 
30 extern BlendFunction gst_video_mixer_blend_argb;
31 extern BlendFunction gst_video_mixer_blend_bgra;
32 #define gst_video_mixer_blend_ayuv gst_video_mixer_blend_argb
33 #define gst_video_mixer_blend_abgr gst_video_mixer_blend_argb
34 #define gst_video_mixer_blend_rgba gst_video_mixer_blend_bgra
35 extern BlendFunction gst_video_mixer_overlay_argb;
36 extern BlendFunction gst_video_mixer_overlay_bgra;
37 #define gst_video_mixer_overlay_ayuv gst_video_mixer_overlay_argb
38 #define gst_video_mixer_overlay_abgr gst_video_mixer_overlay_argb
39 #define gst_video_mixer_overlay_rgba gst_video_mixer_overlay_bgra
40 extern BlendFunction gst_video_mixer_blend_i420;
41 #define gst_video_mixer_blend_yv12 gst_video_mixer_blend_i420
42 extern BlendFunction gst_video_mixer_blend_nv12;
43 extern BlendFunction gst_video_mixer_blend_nv21;
44 extern BlendFunction gst_video_mixer_blend_y41b;
45 extern BlendFunction gst_video_mixer_blend_y42b;
46 extern BlendFunction gst_video_mixer_blend_y444;
47 extern BlendFunction gst_video_mixer_blend_rgb;
48 #define gst_video_mixer_blend_bgr gst_video_mixer_blend_rgb
49 extern BlendFunction gst_video_mixer_blend_rgbx;
50 #define gst_video_mixer_blend_bgrx gst_video_mixer_blend_rgbx
51 #define gst_video_mixer_blend_xrgb gst_video_mixer_blend_rgbx
52 #define gst_video_mixer_blend_xbgr gst_video_mixer_blend_rgbx
53 extern BlendFunction gst_video_mixer_blend_yuy2;
54 #define gst_video_mixer_blend_uyvy gst_video_mixer_blend_yuy2;
55 #define gst_video_mixer_blend_yvyu gst_video_mixer_blend_yuy2;
56 
57 extern FillCheckerFunction gst_video_mixer_fill_checker_argb;
58 #define gst_video_mixer_fill_checker_abgr gst_video_mixer_fill_checker_argb
59 extern FillCheckerFunction gst_video_mixer_fill_checker_bgra;
60 #define gst_video_mixer_fill_checker_rgba gst_video_mixer_fill_checker_bgra
61 extern FillCheckerFunction gst_video_mixer_fill_checker_ayuv;
62 extern FillCheckerFunction gst_video_mixer_fill_checker_i420;
63 #define gst_video_mixer_fill_checker_yv12 gst_video_mixer_fill_checker_i420
64 extern FillCheckerFunction gst_video_mixer_fill_checker_nv12;
65 extern FillCheckerFunction gst_video_mixer_fill_checker_nv21;
66 extern FillCheckerFunction gst_video_mixer_fill_checker_y41b;
67 extern FillCheckerFunction gst_video_mixer_fill_checker_y42b;
68 extern FillCheckerFunction gst_video_mixer_fill_checker_y444;
69 extern FillCheckerFunction gst_video_mixer_fill_checker_rgb;
70 #define gst_video_mixer_fill_checker_bgr gst_video_mixer_fill_checker_rgb
71 extern FillCheckerFunction gst_video_mixer_fill_checker_rgbx;
72 #define gst_video_mixer_fill_checker_bgrx gst_video_mixer_fill_checker_rgbx
73 #define gst_video_mixer_fill_checker_xrgb gst_video_mixer_fill_checker_rgbx
74 #define gst_video_mixer_fill_checker_xbgr gst_video_mixer_fill_checker_rgbx
75 extern FillCheckerFunction gst_video_mixer_fill_checker_yuy2;
76 #define gst_video_mixer_fill_checker_yvyu gst_video_mixer_fill_checker_yuy2;
77 extern FillCheckerFunction gst_video_mixer_fill_checker_uyvy;
78 
79 extern FillColorFunction gst_video_mixer_fill_color_argb;
80 extern FillColorFunction gst_video_mixer_fill_color_abgr;
81 extern FillColorFunction gst_video_mixer_fill_color_bgra;
82 extern FillColorFunction gst_video_mixer_fill_color_rgba;
83 extern FillColorFunction gst_video_mixer_fill_color_ayuv;
84 extern FillColorFunction gst_video_mixer_fill_color_i420;
85 extern FillColorFunction gst_video_mixer_fill_color_yv12;
86 extern FillColorFunction gst_video_mixer_fill_color_nv12;
87 #define gst_video_mixer_fill_color_nv21 gst_video_mixer_fill_color_nv12;
88 extern FillColorFunction gst_video_mixer_fill_color_y41b;
89 extern FillColorFunction gst_video_mixer_fill_color_y42b;
90 extern FillColorFunction gst_video_mixer_fill_color_y444;
91 extern FillColorFunction gst_video_mixer_fill_color_rgb;
92 extern FillColorFunction gst_video_mixer_fill_color_bgr;
93 extern FillColorFunction gst_video_mixer_fill_color_xrgb;
94 extern FillColorFunction gst_video_mixer_fill_color_xbgr;
95 extern FillColorFunction gst_video_mixer_fill_color_rgbx;
96 extern FillColorFunction gst_video_mixer_fill_color_bgrx;
97 extern FillColorFunction gst_video_mixer_fill_color_yuy2;
98 extern FillColorFunction gst_video_mixer_fill_color_yvyu;
99 extern FillColorFunction gst_video_mixer_fill_color_uyvy;
100 
101 void gst_video_mixer_init_blend (void);
102 
103 #endif /* __BLEND_H__ */
104