gst/videotestsrc/: Add a bunch of exciting new checkers patterns.
[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
26 struct vts_color_struct {
27         guint8 Y, U, V;
28         guint8 R, G, B;
29 };
30
31 typedef struct paintinfo_struct paintinfo;
32 struct paintinfo_struct
33 {
34   unsigned char *dest;          /* pointer to first byte of video data */
35   unsigned char *yp, *up, *vp;  /* pointers to first byte of each component
36                                  * for both packed/planar YUV and RGB */
37   unsigned char *ap;            /* pointer to first byte of alpha component */
38   unsigned char *endptr;        /* pointer to byte beyond last video data */
39   int ystride;
40   int ustride;
41   int vstride;
42   int width;
43   int height;
44   const struct vts_color_struct *color;
45   void (*paint_hline) (paintinfo * p, int x, int y, int w);
46 };
47
48 struct fourcc_list_struct
49 {
50   char *fourcc;
51   char *name;
52   int bitspp;
53   void (*paint_setup) (paintinfo * p, unsigned char *dest);
54   void (*paint_hline) (paintinfo * p, int x, int y, int w);
55   int ext_caps;
56   int depth;
57   unsigned int red_mask;
58   unsigned int green_mask;
59   unsigned int blue_mask;
60   unsigned int alpha_mask;
61 };
62
63 struct fourcc_list_struct *
64         paintrect_find_fourcc           (int find_fourcc);
65 struct fourcc_list_struct *
66         paintrect_find_name             (const char *name);
67 struct fourcc_list_struct *
68         paintinfo_find_by_structure     (const GstStructure *structure);
69 GstStructure *
70         paint_get_structure             (struct fourcc_list_struct *format);
71 int     gst_video_test_src_get_size     (GstVideoTestSrc * v, int w, int h);
72 void    gst_video_test_src_smpte        (GstVideoTestSrc * v,
73                                          unsigned char *dest, int w, int h);
74 void    gst_video_test_src_snow         (GstVideoTestSrc * v,
75                                          unsigned char *dest, int w, int h);
76 void    gst_video_test_src_black        (GstVideoTestSrc * v,
77                                          unsigned char *dest, int w, int h);
78 void    gst_video_test_src_white        (GstVideoTestSrc * v,
79                                          unsigned char *dest, int w, int h);
80 void    gst_video_test_src_red          (GstVideoTestSrc * v,
81                                          unsigned char *dest, int w, int h);
82 void    gst_video_test_src_green        (GstVideoTestSrc * v,
83                                          unsigned char *dest, int w, int h);
84 void    gst_video_test_src_blue         (GstVideoTestSrc * v,
85                                          unsigned char *dest, int w, int h);
86 void    gst_video_test_src_checkers1    (GstVideoTestSrc * v,
87                                          unsigned char *dest, int w, int h);
88 void    gst_video_test_src_checkers2    (GstVideoTestSrc * v,
89                                          unsigned char *dest, int w, int h);
90 void    gst_video_test_src_checkers4    (GstVideoTestSrc * v,
91                                          unsigned char *dest, int w, int h);
92 void    gst_video_test_src_checkers8    (GstVideoTestSrc * v,
93                                          unsigned char *dest, int w, int h);
94
95 extern struct fourcc_list_struct fourcc_list[];
96 extern int n_fourccs;
97
98 #endif