tizen 2.0 init
[framework/multimedia/gst-plugins-base0.10.git] / gst-libs / gst / video / video-blend.h
1 /* Gstreamer video blending utility functions
2  *
3  * Copyright (C) <2011> Intel Corporation
4  * Copyright (C) <2011> Collabora Ltd.
5  * Copyright (C) <2011> Thibault Saunier <thibault.saunier@collabora.com>
6  *
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.
11  *
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.
16  *
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.
21  */
22
23
24 #ifndef  __GST_VIDEO_BLEND__
25 #define  __GST_VIDEO_BLEND__
26
27 #include <gst/gst.h>
28 #include <gst/video/video.h>
29
30 #define MAX_VIDEO_PLANES 4
31
32 typedef struct _GstBlendVideoFormatInfo GstBlendVideoFormatInfo;
33
34 /* GstBlendVideoFormatInfo:
35  * @fmt: The #GstVideoFormat describing the video format
36  * @width: The width of the video
37  * @height: The height of the video
38  * @pixels: The buffer containing the pixels of the video
39  * @size: The size in byte of @pixels
40  * @offset: The offsets of the different component of the video
41  * @stride: The stride of the different component of the video
42  *
43  * Information describing image properties containing necessary
44  * fields to do video blending.
45  */
46 struct _GstBlendVideoFormatInfo
47 {
48     GstVideoFormat  fmt;
49
50     gint            width;
51     gint            height;
52
53     guint8        * pixels;
54     gsize           size;
55
56     /* YUV components: Y=0, U=1, V=2, A=3
57      * RGB components: R=0, G=1, B=2, A=3 */
58     gint            offset[MAX_VIDEO_PLANES];
59     gint            stride[MAX_VIDEO_PLANES];
60 };
61
62 void       video_blend_format_info_init   (GstBlendVideoFormatInfo * info,
63                                            guint8 *pixels, guint height,
64                                            guint width, GstVideoFormat fmt);
65
66 void       video_blend_scale_linear_RGBA  (GstBlendVideoFormatInfo * src,
67                                            gint dest_height, gint dest_width);
68
69 gboolean   video_blend                    (GstBlendVideoFormatInfo * dest,
70                                            GstBlendVideoFormatInfo * src,
71                                            guint x, guint y);
72
73 #endif