videotestsrc: use generic packing code
[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   int size;                     /* size of a frame */
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, GstVideoFrame *frame, int y);
58   int x_offset;
59
60   int bayer_x_invert;
61   int bayer_y_invert;
62
63   guint8 *tmpline;
64   guint8 *tmpline2;
65   guint8 *tmpline_u8;
66   guint16 *tmpline_u16;
67
68   struct vts_color_struct foreground_color;
69   struct vts_color_struct background_color;
70 };
71 #define PAINT_INFO_INIT {0, }
72
73 struct format_list_struct
74 {
75   int type;
76   const char *format;
77   const char *name;
78   void (*paint_setup) (paintinfo * p, GstVideoFrame *frame);
79   void (*convert_hline) (paintinfo * p, GstVideoFrame *frame, int y);
80 };
81
82 struct format_list_struct *
83         paintrect_find_format           (const gchar *find_format);
84 struct format_list_struct *
85         paintrect_find_name             (const char *name);
86 struct format_list_struct *
87         paintinfo_find_by_structure     (const GstStructure *structure);
88 GstStructure *
89         paint_get_structure             (struct format_list_struct *format);
90
91 int     gst_video_test_src_get_size     (GstVideoTestSrc * v, int w, int h);
92 void    gst_video_test_src_smpte        (GstVideoTestSrc * v, GstVideoFrame *frame);
93 void    gst_video_test_src_smpte75      (GstVideoTestSrc * v, GstVideoFrame *frame);
94 void    gst_video_test_src_snow         (GstVideoTestSrc * v, GstVideoFrame *frame);
95 void    gst_video_test_src_black        (GstVideoTestSrc * v, GstVideoFrame *frame);
96 void    gst_video_test_src_white        (GstVideoTestSrc * v, GstVideoFrame *frame);
97 void    gst_video_test_src_red          (GstVideoTestSrc * v, GstVideoFrame *frame);
98 void    gst_video_test_src_green        (GstVideoTestSrc * v, GstVideoFrame *frame);
99 void    gst_video_test_src_blue         (GstVideoTestSrc * v, GstVideoFrame *frame);
100 void    gst_video_test_src_solid        (GstVideoTestSrc * v, GstVideoFrame *frame);
101 void    gst_video_test_src_blink        (GstVideoTestSrc * v, GstVideoFrame *frame);
102 void    gst_video_test_src_checkers1    (GstVideoTestSrc * v, GstVideoFrame *frame);
103 void    gst_video_test_src_checkers2    (GstVideoTestSrc * v, GstVideoFrame *frame);
104 void    gst_video_test_src_checkers4    (GstVideoTestSrc * v, GstVideoFrame *frame);
105 void    gst_video_test_src_checkers8    (GstVideoTestSrc * v, GstVideoFrame *frame);
106 void    gst_video_test_src_circular     (GstVideoTestSrc * v, GstVideoFrame *frame);
107 void    gst_video_test_src_zoneplate    (GstVideoTestSrc * v, GstVideoFrame *frame);
108 void    gst_video_test_src_gamut        (GstVideoTestSrc * v, GstVideoFrame *frame);
109 void    gst_video_test_src_chromazoneplate (GstVideoTestSrc * v, GstVideoFrame *frame);
110 void    gst_video_test_src_ball         (GstVideoTestSrc * v, GstVideoFrame *frame);
111 void    gst_video_test_src_smpte100     (GstVideoTestSrc * v, GstVideoFrame *frame);
112 void    gst_video_test_src_bar          (GstVideoTestSrc * v, GstVideoFrame *frame);
113
114 extern struct format_list_struct format_list[];
115 extern int n_formats;
116
117 #endif