~oah-dev/oah/gst-plugins-bad

« back to all changes in this revision

Viewing changes to gst/games/gstvideoimage.h

  • Committer: Haakon Sporsheim
  • Date: 2009-03-12 13:52:03 UTC
  • Revision ID: haakon.sporsheim@tandberg.com-20090312135203-i5k294hgkushb0mt
Initial import of git repository: git://anongit.freedesktop.org/gstreamer/gst-plugins-bad (tag: RELEASE-0_10_10)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* GStreamer
 
2
 * Copyright (C) <2003> David A. Schleef <ds@schleef.org>
 
3
 *               <2004> Benjamin Otte <otte@gnome.org
 
4
 *
 
5
 * This library is free software; you can redistribute it and/or
 
6
 * modify it under the terms of the GNU Library General Public
 
7
 * License as published by the Free Software Foundation; either
 
8
 * version 2 of the License, or (at your option) any later version.
 
9
 *
 
10
 * This library is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
13
 * Library General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU Library General Public
 
16
 * License along with this library; if not, write to the
 
17
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
18
 * Boston, MA 02111-1307, USA.
 
19
 */
 
20
 
 
21
#include <gst/gst.h>
 
22
 
 
23
#ifndef __GST_VIDEO_IMAGE_H__
 
24
#define __GST_VIDEO_IMAGE_H__
 
25
 
 
26
G_BEGIN_DECLS
 
27
 
 
28
 
 
29
typedef struct _GstVideoColor GstVideoColor;
 
30
typedef struct _GstVideoImage GstVideoImage;
 
31
typedef struct _GstVideoFormat GstVideoFormat;
 
32
 
 
33
struct _GstVideoColor {
 
34
  int           Y, U, V;
 
35
  int           R, G, B;
 
36
};
 
37
extern const GstVideoColor GST_VIDEO_COLOR_WHITE;
 
38
extern const GstVideoColor GST_VIDEO_COLOR_YELLOW;
 
39
extern const GstVideoColor GST_VIDEO_COLOR_CYAN;
 
40
extern const GstVideoColor GST_VIDEO_COLOR_GREEN;
 
41
extern const GstVideoColor GST_VIDEO_COLOR_MAGENTA;
 
42
extern const GstVideoColor GST_VIDEO_COLOR_RED;
 
43
extern const GstVideoColor GST_VIDEO_COLOR_BLUE;
 
44
extern const GstVideoColor GST_VIDEO_COLOR_BLACK;
 
45
extern const GstVideoColor GST_VIDEO_COLOR_NEG_I;
 
46
extern const GstVideoColor GST_VIDEO_COLOR_POS_Q;
 
47
extern const GstVideoColor GST_VIDEO_COLOR_SUPER_BLACK;
 
48
extern const GstVideoColor GST_VIDEO_COLOR_DARK_GREY;
 
49
 
 
50
 
 
51
struct _GstVideoImage
 
52
{
 
53
  guint8 *      dest;           /* pointer to first byte of video data */
 
54
  guint8 *      yp, *up, *vp;   /* pointers to first byte of each component
 
55
                                 * for both packed/planar YUV and RGB */
 
56
  guint8 *      endptr;         /* pointer to byte beyond last video data */
 
57
  guint         ystride;
 
58
  guint         ustride;
 
59
  guint         vstride;
 
60
  guint         width;
 
61
  guint         height;
 
62
  const GstVideoFormat * format;
 
63
};
 
64
 
 
65
struct _GstVideoFormat
 
66
{
 
67
  char *        fourcc;
 
68
  char *        name;
 
69
  int           bitspp;
 
70
  void          (* paint_setup) (GstVideoImage * p, char *dest);
 
71
  void          (* paint_hline) (GstVideoImage * p, int x, int y, int w, const GstVideoColor *c);
 
72
  void          (* copy_hline) (GstVideoImage * dest, int destx, int desty,
 
73
      GstVideoImage * src, int srcx, int srcy, int w);
 
74
  int           ext_caps;
 
75
  int           depth;
 
76
  guint         red_mask;
 
77
  guint         green_mask;
 
78
  guint         blue_mask;
 
79
};
 
80
 
 
81
const GstVideoFormat *  gst_video_format_find_by_fourcc         (int find_fourcc);
 
82
const GstVideoFormat *  gst_video_format_find_by_name           (const char *name);
 
83
const GstVideoFormat *  gst_video_format_find_by_structure      (const GstStructure *structure);
 
84
GstStructure *          gst_video_format_get_structure          (const GstVideoFormat *format);
 
85
guint                   gst_video_format_get_size               (const GstVideoFormat *format, 
 
86
                                                                 guint w, guint h);
 
87
 
 
88
extern const GstVideoFormat gst_video_format_list[];
 
89
extern const guint gst_video_format_count;
 
90
 
 
91
void                    gst_video_image_setup                   (GstVideoImage *image, 
 
92
                                                                 const GstVideoFormat *format,
 
93
                                                                 guint8 *data, guint w, guint h);
 
94
                                                                         
 
95
/* drawing operations */
 
96
void                    gst_video_image_draw_hline              (GstVideoImage *image,
 
97
                                                                 gint x, gint y, gint w,
 
98
                                                                 const GstVideoColor *c);
 
99
void                    gst_video_image_draw_rectangle          (GstVideoImage *image,
 
100
                                                                 gint x, gint y, gint w, gint h,
 
101
                                                                 const GstVideoColor *c, gboolean filled);
 
102
void                    gst_video_image_copy_hline              (GstVideoImage *dest,
 
103
                                                                 gint xdest, gint ydest,
 
104
                                                                 GstVideoImage *src,
 
105
                                                                 gint xsrc, gint ysrc, gint w);
 
106
void                    gst_video_image_copy_area               (GstVideoImage *dest,
 
107
                                                                 gint xdest, gint ydest,
 
108
                                                                 GstVideoImage *src,
 
109
                                                                 gint xsrc, gint ysrc, 
 
110
                                                                 gint w, gint h);
 
111
 
 
112
G_END_DECLS
 
113
 
 
114
#endif /* __GST_VIDEO_IMAGE_H__ */