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