tizen 2.3 release
[framework/multimedia/gst-plugins-base0.10.git] / gst / videotestsrc / videotestsrc.h
1 /* GStreamer
2  * Copyright (C) <2003> David A. Schleef <ds@schleef.org>
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., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 #ifndef __VIDEO_TEST_SRC_H__
21 #define __VIDEO_TEST_SRC_H__
22
23 #include <glib.h>
24
25 enum {
26   VTS_YUV,
27   VTS_RGB,
28   VTS_GRAY,
29   VTS_BAYER
30 };
31
32 enum {
33   VTS_BAYER_BGGR,
34   VTS_BAYER_RGGB,
35   VTS_BAYER_GRBG,
36   VTS_BAYER_GBRG
37 };
38
39 struct vts_color_struct {
40   guint8 Y, U, V, A;
41   guint8 R, G, B;
42   guint16 gray;
43 };
44
45
46 typedef struct paintinfo_struct paintinfo;
47 struct paintinfo_struct
48 {
49   unsigned char *dest;          /* pointer to first byte of video data */
50   unsigned char *yp, *up, *vp;  /* pointers to first byte of each component
51                                  * for both packed/planar YUV and RGB */
52   unsigned char *ap;            /* pointer to first byte of alpha component */
53   unsigned char *endptr;        /* pointer to byte beyond last video data */
54   int ystride;
55   int ustride;
56   int vstride;
57   int width;
58   int height;
59   const struct vts_color_struct *colors;
60   const struct vts_color_struct *color;
61   /*  const struct vts_color_struct *color; */
62   void (*paint_hline) (paintinfo * p, int x, int y, int w);
63   void (*paint_tmpline) (paintinfo * p, int x, int w);
64   void (*convert_tmpline) (paintinfo * p, int y);
65   int x_offset;
66
67   int bayer_x_invert;
68   int bayer_y_invert;
69
70   guint8 *tmpline;
71   guint8 *tmpline2;
72   guint8 *tmpline_u8;
73
74   struct vts_color_struct foreground_color;
75   struct vts_color_struct background_color;
76 };
77
78 struct fourcc_list_struct
79 {
80   int type;
81   const char *fourcc;
82   const char *name;
83   int bitspp;
84   void (*paint_setup) (paintinfo * p, unsigned char *dest);
85   void (*convert_hline) (paintinfo * p, int y);
86   int depth;
87   unsigned int red_mask;
88   unsigned int green_mask;
89   unsigned int blue_mask;
90   unsigned int alpha_mask;
91 };
92
93 struct fourcc_list_struct *
94         paintrect_find_fourcc           (int find_fourcc);
95 struct fourcc_list_struct *
96         paintrect_find_name             (const char *name);
97 struct fourcc_list_struct *
98         paintinfo_find_by_structure     (const GstStructure *structure);
99 GstStructure *
100         paint_get_structure             (struct fourcc_list_struct *format);
101 int     gst_video_test_src_get_size     (GstVideoTestSrc * v, int w, int h);
102 void    gst_video_test_src_smpte        (GstVideoTestSrc * v,
103                                          unsigned char *dest, int w, int h);
104 void    gst_video_test_src_smpte75      (GstVideoTestSrc * v,
105                                          unsigned char *dest, int w, int h);
106 void    gst_video_test_src_snow         (GstVideoTestSrc * v,
107                                          unsigned char *dest, int w, int h);
108 void    gst_video_test_src_black        (GstVideoTestSrc * v,
109                                          unsigned char *dest, int w, int h);
110 void    gst_video_test_src_white        (GstVideoTestSrc * v,
111                                          unsigned char *dest, int w, int h);
112 void    gst_video_test_src_red          (GstVideoTestSrc * v,
113                                          unsigned char *dest, int w, int h);
114 void    gst_video_test_src_green        (GstVideoTestSrc * v,
115                                          unsigned char *dest, int w, int h);
116 void    gst_video_test_src_blue         (GstVideoTestSrc * v,
117                                          unsigned char *dest, int w, int h);
118 void    gst_video_test_src_solid        (GstVideoTestSrc * v,
119                                          unsigned char *dest, int w, int h);
120 void    gst_video_test_src_blink        (GstVideoTestSrc * v,
121                                          unsigned char *dest, int w, int h);
122 void    gst_video_test_src_checkers1    (GstVideoTestSrc * v,
123                                          unsigned char *dest, int w, int h);
124 void    gst_video_test_src_checkers2    (GstVideoTestSrc * v,
125                                          unsigned char *dest, int w, int h);
126 void    gst_video_test_src_checkers4    (GstVideoTestSrc * v,
127                                          unsigned char *dest, int w, int h);
128 void    gst_video_test_src_checkers8    (GstVideoTestSrc * v,
129                                          unsigned char *dest, int w, int h);
130 void    gst_video_test_src_circular     (GstVideoTestSrc * v,
131                                          unsigned char *dest, int w, int h);
132 void    gst_video_test_src_zoneplate    (GstVideoTestSrc * v,
133                                          unsigned char *dest, int w, int h);
134 void    gst_video_test_src_gamut        (GstVideoTestSrc * v,
135                                          unsigned char *dest, int w, int h);
136 void    gst_video_test_src_chromazoneplate (GstVideoTestSrc * v,
137                                             unsigned char *dest, int w, int h);
138 void    gst_video_test_src_ball         (GstVideoTestSrc * v,
139                                          unsigned char *dest, int w, int h);
140 void    gst_video_test_src_smpte100     (GstVideoTestSrc * v,
141                                          unsigned char *dest, int w, int h);
142 void    gst_video_test_src_bar          (GstVideoTestSrc * v,
143                                          unsigned char *dest, int w, int h);
144
145 extern struct fourcc_list_struct fourcc_list[];
146 extern int n_fourccs;
147
148 #endif