956e2986b0e03e0b5f9a21d5e275e6b39acee8e3
[platform/upstream/gstreamer.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 *p[4];    /* pointers to first byte of each component
50                            * for both packed/planar YUV and RGB */
51   int stride[4];
52
53   int size;                     /* size of a frame */
54   int width;
55   int height;
56   const struct vts_color_struct *colors;
57   const struct vts_color_struct *color;
58   /*  const struct vts_color_struct *color; */
59   void (*paint_hline) (paintinfo * p, int x, int y, int w);
60   void (*paint_tmpline) (paintinfo * p, int x, int w);
61   void (*convert_tmpline) (paintinfo * p, int y);
62   int x_offset;
63
64   int bayer_x_invert;
65   int bayer_y_invert;
66
67   guint8 *tmpline;
68   guint8 *tmpline2;
69   guint8 *tmpline_u8;
70
71   struct vts_color_struct foreground_color;
72   struct vts_color_struct background_color;
73 };
74 #define PAINT_INFO_INIT { { NULL, }, }
75
76 struct format_list_struct
77 {
78   int type;
79   const char *format;
80   const char *name;
81   int bitspp;
82   void (*paint_setup) (paintinfo * p, GstVideoFrame *frame);
83   void (*convert_hline) (paintinfo * p, int y);
84   int depth;
85   unsigned int red_mask;
86   unsigned int green_mask;
87   unsigned int blue_mask;
88   unsigned int alpha_mask;
89 };
90
91 struct format_list_struct *
92         paintrect_find_format           (const gchar *find_format);
93 struct format_list_struct *
94         paintrect_find_name             (const char *name);
95 struct format_list_struct *
96         paintinfo_find_by_structure     (const GstStructure *structure);
97 GstStructure *
98         paint_get_structure             (struct format_list_struct *format);
99
100 int     gst_video_test_src_get_size     (GstVideoTestSrc * v, int w, int h);
101 void    gst_video_test_src_smpte        (GstVideoTestSrc * v, GstVideoFrame *frame);
102 void    gst_video_test_src_smpte75      (GstVideoTestSrc * v, GstVideoFrame *frame);
103 void    gst_video_test_src_snow         (GstVideoTestSrc * v, GstVideoFrame *frame);
104 void    gst_video_test_src_black        (GstVideoTestSrc * v, GstVideoFrame *frame);
105 void    gst_video_test_src_white        (GstVideoTestSrc * v, GstVideoFrame *frame);
106 void    gst_video_test_src_red          (GstVideoTestSrc * v, GstVideoFrame *frame);
107 void    gst_video_test_src_green        (GstVideoTestSrc * v, GstVideoFrame *frame);
108 void    gst_video_test_src_blue         (GstVideoTestSrc * v, GstVideoFrame *frame);
109 void    gst_video_test_src_solid        (GstVideoTestSrc * v, GstVideoFrame *frame);
110 void    gst_video_test_src_blink        (GstVideoTestSrc * v, GstVideoFrame *frame);
111 void    gst_video_test_src_checkers1    (GstVideoTestSrc * v, GstVideoFrame *frame);
112 void    gst_video_test_src_checkers2    (GstVideoTestSrc * v, GstVideoFrame *frame);
113 void    gst_video_test_src_checkers4    (GstVideoTestSrc * v, GstVideoFrame *frame);
114 void    gst_video_test_src_checkers8    (GstVideoTestSrc * v, GstVideoFrame *frame);
115 void    gst_video_test_src_circular     (GstVideoTestSrc * v, GstVideoFrame *frame);
116 void    gst_video_test_src_zoneplate    (GstVideoTestSrc * v, GstVideoFrame *frame);
117 void    gst_video_test_src_gamut        (GstVideoTestSrc * v, GstVideoFrame *frame);
118 void    gst_video_test_src_chromazoneplate (GstVideoTestSrc * v, GstVideoFrame *frame);
119 void    gst_video_test_src_ball         (GstVideoTestSrc * v, GstVideoFrame *frame);
120 void    gst_video_test_src_smpte100     (GstVideoTestSrc * v, GstVideoFrame *frame);
121 void    gst_video_test_src_bar          (GstVideoTestSrc * v, GstVideoFrame *frame);
122
123 extern struct format_list_struct format_list[];
124 extern int n_formats;
125
126 #endif