1 /* GdkPixbuf library - Scaling and compositing functions
3 * Copyright (C) 1999 The Free Software Foundation
5 * Author: Owen Taylor <otaylor@redhat.com>
6 * Modified for YUV422 by: Dan Dennedy <dan@dennedy.org>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the
20 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 * Boston, MA 02111-1307, USA.
29 /* Interpolation modes; must match GdkInterpType */
31 PIXOPS_INTERP_NEAREST
,
33 PIXOPS_INTERP_BILINEAR
,
37 /* Scale src_buf from src_width / src_height by factors scale_x, scale_y
38 * and composite the portion corresponding to
39 * render_x, render_y, render_width, render_height in the new
40 * coordinate system into dest_buf starting at 0, 0
42 void yuv422_scale (guchar
*dest_buf
,
50 const guchar
*src_buf
,
58 PixopsInterpType interp_type
);
60 #define yuv422_scale_simple( dest_buf, dest_width, dest_height, dest_rowstride, src_buf, src_width, src_height, src_rowstride, interp_type ) \
61 yuv422_scale( (dest_buf), 0, 0, \
62 (dest_width), (dest_height), \
63 (dest_rowstride), 2, 0, \
64 (src_buf), (src_width), (src_height), \
65 (src_rowstride), 2, 0, \
66 (double) (dest_width) / (src_width), (double) (dest_height) / (src_height), \
67 (PixopsInterpType) interp_type );