videotestsrc: clean up blink pattern
[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 struct vts_color_struct {
33   guint8 Y, U, V, A;
34   guint8 R, G, B;
35   guint16 gray;
36 };
37
38
39 typedef struct paintinfo_struct paintinfo;
40 struct paintinfo_struct
41 {
42   unsigned char *dest;          /* pointer to first byte of video data */
43   unsigned char *yp, *up, *vp;  /* pointers to first byte of each component
44                                  * for both packed/planar YUV and RGB */
45   unsigned char *ap;            /* pointer to first byte of alpha component */
46   unsigned char *endptr;        /* pointer to byte beyond last video data */
47   int ystride;
48   int ustride;
49   int vstride;
50   int width;
51   int height;
52   const struct vts_color_struct *colors;
53   const struct vts_color_struct *color;
54   /*  const struct vts_color_struct *color; */
55   void (*paint_hline) (paintinfo * p, int x, int y, int w);
56   void (*paint_tmpline) (paintinfo * p, int x, int w);
57   void (*convert_tmpline) (paintinfo * p, int y);
58
59   unsigned char *tmpline;
60
61   struct vts_color_struct foreground_color;
62   struct vts_color_struct background_color;
63 };
64
65 struct fourcc_list_struct
66 {
67   int type;
68   const char *fourcc;
69   const char *name;
70   int bitspp;
71   void (*paint_setup) (paintinfo * p, unsigned char *dest);
72   void (*convert_hline) (paintinfo * p, int y);
73   int depth;
74   unsigned int red_mask;
75   unsigned int green_mask;
76   unsigned int blue_mask;
77   unsigned int alpha_mask;
78 };
79
80 struct fourcc_list_struct *
81         paintrect_find_fourcc           (int find_fourcc);
82 struct fourcc_list_struct *
83         paintrect_find_name             (const char *name);
84 struct fourcc_list_struct *
85         paintinfo_find_by_structure     (const GstStructure *structure);
86 GstStructure *
87         paint_get_structure             (struct fourcc_list_struct *format);
88 int     gst_video_test_src_get_size     (GstVideoTestSrc * v, int w, int h);
89 void    gst_video_test_src_smpte        (GstVideoTestSrc * v,
90                                          unsigned char *dest, int w, int h);
91 void    gst_video_test_src_smpte75      (GstVideoTestSrc * v,
92                                          unsigned char *dest, int w, int h);
93 void    gst_video_test_src_snow         (GstVideoTestSrc * v,
94                                          unsigned char *dest, int w, int h);
95 void    gst_video_test_src_black        (GstVideoTestSrc * v,
96                                          unsigned char *dest, int w, int h);
97 void    gst_video_test_src_white        (GstVideoTestSrc * v,
98                                          unsigned char *dest, int w, int h);
99 void    gst_video_test_src_red          (GstVideoTestSrc * v,
100                                          unsigned char *dest, int w, int h);
101 void    gst_video_test_src_green        (GstVideoTestSrc * v,
102                                          unsigned char *dest, int w, int h);
103 void    gst_video_test_src_blue         (GstVideoTestSrc * v,
104                                          unsigned char *dest, int w, int h);
105 void    gst_video_test_src_solid        (GstVideoTestSrc * v,
106                                          unsigned char *dest, int w, int h);
107 void    gst_video_test_src_blink        (GstVideoTestSrc * v,
108                                          unsigned char *dest, int w, int h);
109 void    gst_video_test_src_checkers1    (GstVideoTestSrc * v,
110                                          unsigned char *dest, int w, int h);
111 void    gst_video_test_src_checkers2    (GstVideoTestSrc * v,
112                                          unsigned char *dest, int w, int h);
113 void    gst_video_test_src_checkers4    (GstVideoTestSrc * v,
114                                          unsigned char *dest, int w, int h);
115 void    gst_video_test_src_checkers8    (GstVideoTestSrc * v,
116                                          unsigned char *dest, int w, int h);
117 void    gst_video_test_src_circular     (GstVideoTestSrc * v,
118                                          unsigned char *dest, int w, int h);
119 void    gst_video_test_src_zoneplate    (GstVideoTestSrc * v,
120                                          unsigned char *dest, int w, int h);
121 void    gst_video_test_src_gamut        (GstVideoTestSrc * v,
122                                          unsigned char *dest, int w, int h);
123 void    gst_video_test_src_chromazoneplate (GstVideoTestSrc * v,
124                                          unsigned char *dest, int w, int h);
125 void    gst_video_test_src_ball         (GstVideoTestSrc * v,
126                                          unsigned char *dest, int w, int h);
127 void gst_video_test_src_moving_color_bars (GstVideoTestSrc * v,
128                                  unsigned char *dest, int w, int h);
129 extern struct fourcc_list_struct fourcc_list[];
130 extern int n_fourccs;
131
132 #endif