~ubuntu-branches/ubuntu/maverick/zapping/maverick

« back to all changes in this revision

Viewing changes to src/csconvert.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2005-03-08 23:19:08 UTC
  • mfrom: (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20050308231908-oip7rfv6lcmo8c0e
Tags: 0.9.2-2ubuntu1
Rebuilt for Python transition (2.3 -> 2.4)

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 * Colorspace conversions.
6
6
 */
7
7
 
8
 
#include <tveng.h>
 
8
#include "tveng.h"
 
9
 
 
10
typedef void
 
11
CSConverter_fn                  (void *                 dst_image,
 
12
                                 const tv_image_format *dst_format,
 
13
                                 const void *           src_image,
 
14
                                 const tv_image_format *src_format,
 
15
                                 const void *           user_data);
 
16
 
 
17
typedef struct {
 
18
  tv_pixfmt             src_pixfmt;
 
19
  tv_pixfmt             dst_pixfmt;
 
20
  CSConverter_fn *      convert;
 
21
  const void *          user_data;
 
22
} CSFilter;
9
23
 
10
24
/**
11
25
 * Try to find an available converter, returns -1 on error or the
12
26
 * converter id on success.
13
27
 */
14
 
int lookup_csconvert(enum tveng_frame_pixformat src_fmt,
15
 
                     enum tveng_frame_pixformat dest_fmt);
 
28
int lookup_csconvert(tv_pixfmt src_pixfmt,
 
29
                     tv_pixfmt dst_pixfmt);
16
30
 
17
31
/**
18
32
 * Converts from src to dest.
19
33
 */
20
 
void csconvert(int id, const char *src, char *dest,
21
 
               int src_stride, int dest_stride, int width, int height);
 
34
gboolean csconvert(void *       dst_image,
 
35
                                 const tv_image_format *dst_format,
 
36
                                 const void *           src_image,
 
37
                                 const tv_image_format *src_format);
22
38
 
23
39
/**
24
 
 * Builds the appropiate conversion tables.
25
 
 * The format of the fields is the same as in the visual info reported
26
 
 * by X.
27
 
 */
28
 
void build_csconvert_tables(int rmask, int rshift, int rprec,
29
 
                            int gmask, int gshift, int gprec,
30
 
                            int bmask, int bshift, int bprec);
 
40
 * Registers a converter. Returns -1 and does nothing when there
 
41
 * already a converter for the given pair, something else on success.
 
42
 * User data will be passed to the converter each time it's called.
 
43
 */
 
44
int register_converter (const char *name,
 
45
                        tv_pixfmt src_pixfmt,
 
46
                        tv_pixfmt dst_pixfmt,
 
47
                        CSConverter_fn *converter,
 
48
                        const void *user_data);
 
49
 
 
50
/*
 
51
 * Registers a bunch of converters at once. Does the same thing as
 
52
 * registering them one by one, it's just convenience. Returns
 
53
 * the number of successfully registered converters.
 
54
 */
 
55
int register_converters (const char *name,
 
56
                         CSFilter       *converters,
 
57
                         int            num_converters);
31
58
 
32
59
/* startup and shutdown of the conversions */
33
60
void startup_csconvert(void);