2 * Copyright (C) 2009 Sebastian Dröge <sebastian.droege@collabora.co.uk>
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.
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.
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.
24 #include <gst/video/video.h>
27 * GstCompositorBlendMode:
28 * @COMPOSITOR_BLEND_MODE_SOURCE: Copy source
29 * @COMPOSITOR_BLEND_MODE_OVER: Normal blending
30 * @COMPOSITOR_BLEND_MODE_ADD: Alphas are simply added,
32 * The different modes compositor can use for blending.
36 COMPOSITOR_BLEND_MODE_SOURCE,
37 COMPOSITOR_BLEND_MODE_OVER,
38 COMPOSITOR_BLEND_MODE_ADD,
39 } GstCompositorBlendMode;
42 * @srcframe: source #GstVideoFrame
43 * @xpos: horizontal start position of @srcframe, leftmost pixel line.
44 * @ypos: vertical start position of @srcframe, topmost pixel line.
45 * @gdouble: src_alpha, alpha factor applied to @srcframe
46 * @destframe: destination #GstVideoFrame
47 * @dst_y_start: start position of where to write into @destframe. Used for splitting work across multiple sequences.
48 * @dst_y_end: end position of where to write into @destframe. Used for splitting work across multiple sequences.
50 typedef void (*BlendFunction) (GstVideoFrame *srcframe, gint xpos, gint ypos, gdouble src_alpha, GstVideoFrame * destframe,
51 gint dst_y_start, gint dst_y_end, GstCompositorBlendMode mode);
52 typedef void (*FillCheckerFunction) (GstVideoFrame * frame, guint y_start, guint y_end);
53 typedef void (*FillColorFunction) (GstVideoFrame * frame, guint y_start, guint y_end, gint c1, gint c2, gint c3);
55 extern BlendFunction gst_compositor_blend_argb;
56 extern BlendFunction gst_compositor_blend_bgra;
57 #define gst_compositor_blend_ayuv gst_compositor_blend_argb
58 #define gst_compositor_blend_vuya gst_compositor_blend_bgra
59 #define gst_compositor_blend_abgr gst_compositor_blend_argb
60 #define gst_compositor_blend_rgba gst_compositor_blend_bgra
62 extern BlendFunction gst_compositor_overlay_argb;
63 extern BlendFunction gst_compositor_overlay_bgra;
64 #define gst_compositor_overlay_ayuv gst_compositor_overlay_argb
65 #define gst_compositor_overlay_vuya gst_compositor_overlay_bgra
66 #define gst_compositor_overlay_abgr gst_compositor_overlay_argb
67 #define gst_compositor_overlay_rgba gst_compositor_overlay_bgra
68 extern BlendFunction gst_compositor_blend_i420;
69 #define gst_compositor_blend_yv12 gst_compositor_blend_i420
70 extern BlendFunction gst_compositor_blend_nv12;
71 extern BlendFunction gst_compositor_blend_nv21;
72 extern BlendFunction gst_compositor_blend_y41b;
73 extern BlendFunction gst_compositor_blend_y42b;
74 extern BlendFunction gst_compositor_blend_y444;
75 extern BlendFunction gst_compositor_blend_rgb;
76 #define gst_compositor_blend_bgr gst_compositor_blend_rgb
77 extern BlendFunction gst_compositor_blend_rgbx;
78 #define gst_compositor_blend_bgrx gst_compositor_blend_rgbx
79 #define gst_compositor_blend_xrgb gst_compositor_blend_rgbx
80 #define gst_compositor_blend_xbgr gst_compositor_blend_rgbx
81 extern BlendFunction gst_compositor_blend_yuy2;
82 #define gst_compositor_blend_uyvy gst_compositor_blend_yuy2;
83 #define gst_compositor_blend_yvyu gst_compositor_blend_yuy2;
84 extern BlendFunction gst_compositor_blend_i420_10le;
85 extern BlendFunction gst_compositor_blend_i420_10be;
86 extern BlendFunction gst_compositor_blend_i420_12le;
87 extern BlendFunction gst_compositor_blend_i420_12be;
88 extern BlendFunction gst_compositor_blend_i422_10le;
89 extern BlendFunction gst_compositor_blend_i422_10be;
90 extern BlendFunction gst_compositor_blend_i422_12le;
91 extern BlendFunction gst_compositor_blend_i422_12be;
93 extern FillCheckerFunction gst_compositor_fill_checker_argb;
94 #define gst_compositor_fill_checker_abgr gst_compositor_fill_checker_argb
95 extern FillCheckerFunction gst_compositor_fill_checker_bgra;
96 #define gst_compositor_fill_checker_rgba gst_compositor_fill_checker_bgra
97 extern FillCheckerFunction gst_compositor_fill_checker_ayuv;
98 extern FillCheckerFunction gst_compositor_fill_checker_vuya;
99 extern FillCheckerFunction gst_compositor_fill_checker_i420;
100 #define gst_compositor_fill_checker_yv12 gst_compositor_fill_checker_i420
101 extern FillCheckerFunction gst_compositor_fill_checker_nv12;
102 extern FillCheckerFunction gst_compositor_fill_checker_nv21;
103 extern FillCheckerFunction gst_compositor_fill_checker_y41b;
104 extern FillCheckerFunction gst_compositor_fill_checker_y42b;
105 extern FillCheckerFunction gst_compositor_fill_checker_y444;
106 extern FillCheckerFunction gst_compositor_fill_checker_rgb;
107 #define gst_compositor_fill_checker_bgr gst_compositor_fill_checker_rgb
108 extern FillCheckerFunction gst_compositor_fill_checker_rgbx;
109 #define gst_compositor_fill_checker_bgrx gst_compositor_fill_checker_rgbx
110 extern FillCheckerFunction gst_compositor_fill_checker_xrgb;
111 #define gst_compositor_fill_checker_xbgr gst_compositor_fill_checker_xrgb
112 extern FillCheckerFunction gst_compositor_fill_checker_yuy2;
113 #define gst_compositor_fill_checker_yvyu gst_compositor_fill_checker_yuy2;
114 extern FillCheckerFunction gst_compositor_fill_checker_uyvy;
115 extern FillCheckerFunction gst_compositor_fill_checker_i420_10le;
116 #define gst_compositor_fill_checker_i422_10le gst_compositor_fill_checker_i420_10le
117 extern FillCheckerFunction gst_compositor_fill_checker_i420_10be;
118 #define gst_compositor_fill_checker_i422_10be gst_compositor_fill_checker_i420_10be
119 extern FillCheckerFunction gst_compositor_fill_checker_i420_12le;
120 #define gst_compositor_fill_checker_i422_12le gst_compositor_fill_checker_i420_12le
121 extern FillCheckerFunction gst_compositor_fill_checker_i420_12be;
122 #define gst_compositor_fill_checker_i422_12be gst_compositor_fill_checker_i420_12be
124 extern FillColorFunction gst_compositor_fill_color_argb;
125 extern FillColorFunction gst_compositor_fill_color_abgr;
126 extern FillColorFunction gst_compositor_fill_color_bgra;
127 extern FillColorFunction gst_compositor_fill_color_rgba;
128 extern FillColorFunction gst_compositor_fill_color_ayuv;
129 extern FillColorFunction gst_compositor_fill_color_vuya;
130 extern FillColorFunction gst_compositor_fill_color_i420;
131 extern FillColorFunction gst_compositor_fill_color_yv12;
132 extern FillColorFunction gst_compositor_fill_color_nv12;
133 #define gst_compositor_fill_color_nv21 gst_compositor_fill_color_nv12;
134 extern FillColorFunction gst_compositor_fill_color_y41b;
135 extern FillColorFunction gst_compositor_fill_color_y42b;
136 extern FillColorFunction gst_compositor_fill_color_y444;
137 extern FillColorFunction gst_compositor_fill_color_rgb;
138 extern FillColorFunction gst_compositor_fill_color_bgr;
139 extern FillColorFunction gst_compositor_fill_color_xrgb;
140 extern FillColorFunction gst_compositor_fill_color_xbgr;
141 extern FillColorFunction gst_compositor_fill_color_rgbx;
142 extern FillColorFunction gst_compositor_fill_color_bgrx;
143 extern FillColorFunction gst_compositor_fill_color_yuy2;
144 extern FillColorFunction gst_compositor_fill_color_yvyu;
145 extern FillColorFunction gst_compositor_fill_color_uyvy;
146 extern FillColorFunction gst_compositor_fill_color_i420_10le;
147 #define gst_compositor_fill_color_i422_10le gst_compositor_fill_color_i420_10le
148 extern FillColorFunction gst_compositor_fill_color_i420_10be;
149 #define gst_compositor_fill_color_i422_10be gst_compositor_fill_color_i420_10be
150 extern FillColorFunction gst_compositor_fill_color_i420_12le;
151 #define gst_compositor_fill_color_i422_12le gst_compositor_fill_color_i420_12le
152 extern FillColorFunction gst_compositor_fill_color_i420_12be;
153 #define gst_compositor_fill_color_i422_12be gst_compositor_fill_color_i420_12be
155 void gst_compositor_init_blend (void);
157 #endif /* __BLEND_H__ */