]> git.sesse.net Git - mlt/blob - src/modules/gtk2/pixops.h
Merge ../mlt++
[mlt] / src / modules / gtk2 / pixops.h
1 /* GdkPixbuf library - Scaling and compositing functions
2  *
3  * Original:
4  * Copyright (C) 2000 Red Hat, Inc
5  * Author: Owen Taylor <otaylor@redhat.com>
6  *
7  * Modification for MLT:
8  * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
9  * Author: Dan Dennedy <dan@dennedy.org>
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation; either
14  * version 2 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19  * Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public
22  * License along with this library; if not, write to the
23  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24  * Boston, MA 02111-1307, USA.
25  */
26
27 #ifndef PIXOPS_H
28 #define PIXOPS_H
29
30 #include <glib.h>
31
32 /* Interpolation modes; must match GdkInterpType */
33 typedef enum {
34         PIXOPS_INTERP_NEAREST,
35         PIXOPS_INTERP_TILES,
36         PIXOPS_INTERP_BILINEAR,
37         PIXOPS_INTERP_HYPER
38 } PixopsInterpType;
39
40 /* Scale src_buf from src_width / src_height by factors scale_x, scale_y
41  * and composite the portion corresponding to
42  * render_x, render_y, render_width, render_height in the new
43  * coordinate system into dest_buf starting at 0, 0
44  */
45 void yuv422_scale     (guchar         *dest_buf,
46                        int             render_x0,
47                        int             render_y0,
48                        int             render_x1,
49                        int             render_y1,
50                        int             dest_rowstride,
51                        int             dest_channels,
52                        int             dest_has_alpha,
53                        const guchar   *src_buf,
54                        int             src_width,
55                        int             src_height,
56                        int             src_rowstride,
57                        int             src_channels,
58                        int             src_has_alpha,
59                        double          scale_x,
60                        double          scale_y,
61                        PixopsInterpType   interp_type);
62
63 #define yuv422_scale_simple( dest_buf, dest_width, dest_height, dest_rowstride, src_buf, src_width, src_height, src_rowstride, interp_type ) \
64         yuv422_scale( (dest_buf), 0, 0, \
65                 (dest_width), (dest_height), \
66                 (dest_rowstride), 2, 0, \
67                 (src_buf), (src_width), (src_height), \
68                 (src_rowstride), 2, 0, \
69                 (double) (dest_width) / (src_width), (double) (dest_height) / (src_height), \
70                 (PixopsInterpType) interp_type );
71
72 #endif