Blame gdk-pixbuf/pixops/pixops.h

Packit a4058c
/*
Packit a4058c
 * Copyright (C) 2000 Red Hat, Inc
Packit a4058c
 *
Packit a4058c
 * This library is free software; you can redistribute it and/or
Packit a4058c
 * modify it under the terms of the GNU Lesser General Public
Packit a4058c
 * License as published by the Free Software Foundation; either
Packit a4058c
 * version 2 of the License, or (at your option) any later version.
Packit a4058c
 *
Packit a4058c
 * This library is distributed in the hope that it will be useful,
Packit a4058c
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit a4058c
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit a4058c
 * Lesser General Public License for more details.
Packit a4058c
 *
Packit a4058c
 * You should have received a copy of the GNU Lesser General Public
Packit a4058c
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
Packit a4058c
 */
Packit a4058c
#ifndef PIXOPS_H
Packit a4058c
#define PIXOPS_H
Packit a4058c
Packit a4058c
#include <glib.h>
Packit a4058c
Packit a4058c
/* Interpolation modes; must match GdkInterpType */ 
Packit a4058c
typedef enum {
Packit a4058c
	PIXOPS_INTERP_NEAREST,
Packit a4058c
	PIXOPS_INTERP_TILES,
Packit a4058c
	PIXOPS_INTERP_BILINEAR,
Packit a4058c
	PIXOPS_INTERP_HYPER
Packit a4058c
} PixopsInterpType;
Packit a4058c
Packit a4058c
/* Scale src_buf from src_width / src_height by factors scale_x, scale_y
Packit a4058c
 * and composite the portion corresponding to
Packit a4058c
 * render_x, render_y, render_width, render_height in the new
Packit a4058c
 * coordinate system into dest_buf starting at 0, 0
Packit a4058c
 */
Packit a4058c
void _pixops_composite (guchar          *dest_buf,
Packit a4058c
                        int              dest_width,
Packit a4058c
                        int              dest_height,
Packit a4058c
                        int              dest_rowstride,
Packit a4058c
                        int              dest_channels,
Packit a4058c
                        int              dest_has_alpha,
Packit a4058c
                        const guchar    *src_buf,
Packit a4058c
                        int              src_width,
Packit a4058c
                        int              src_height,
Packit a4058c
                        int              src_rowstride,
Packit a4058c
                        int              src_channels,
Packit a4058c
                        int              src_has_alpha,
Packit a4058c
                        int              dest_x,
Packit a4058c
                        int              dest_y,
Packit a4058c
                        int              dest_region_width,
Packit a4058c
                        int              dest_region_height,
Packit a4058c
                        double           offset_x,
Packit a4058c
                        double           offset_y,
Packit a4058c
                        double           scale_x,
Packit a4058c
                        double           scale_y,
Packit a4058c
                        PixopsInterpType interp_type,
Packit a4058c
                        int              overall_alpha);
Packit a4058c
Packit a4058c
/* Scale src_buf from src_width / src_height by factors scale_x, scale_y
Packit a4058c
 * and composite the portion corresponding to
Packit a4058c
 * render_x, render_y, render_width, render_height in the new
Packit a4058c
 * coordinate system against a checkboard with checks of size check_size
Packit a4058c
 * of the colors color1 and color2 into dest_buf starting at 0, 0
Packit a4058c
 */
Packit a4058c
void _pixops_composite_color (guchar          *dest_buf,
Packit a4058c
                              int              dest_width,
Packit a4058c
                              int              dest_height,
Packit a4058c
                              int              dest_rowstride,
Packit a4058c
                              int              dest_channels,
Packit a4058c
                              int              dest_has_alpha,
Packit a4058c
                              const guchar    *src_buf,
Packit a4058c
                              int              src_width,
Packit a4058c
                              int              src_height,
Packit a4058c
                              int              src_rowstride,
Packit a4058c
                              int              src_channels,
Packit a4058c
                              int              src_has_alpha,
Packit a4058c
                              int              dest_x,
Packit a4058c
                              int              dest_y,
Packit a4058c
                              int              dest_region_width,
Packit a4058c
                              int              dest_region_height,
Packit a4058c
                              double           offset_x,
Packit a4058c
                              double           offset_y,
Packit a4058c
                              double           scale_x,
Packit a4058c
                              double           scale_y,
Packit a4058c
                              PixopsInterpType interp_type,
Packit a4058c
                              int              overall_alpha,
Packit a4058c
                              int              check_x,
Packit a4058c
                              int              check_y,
Packit a4058c
                              int              check_size,
Packit a4058c
                              guint32          color1,
Packit a4058c
                              guint32          color2);
Packit a4058c
Packit a4058c
/* Scale src_buf from src_width / src_height by factors scale_x, scale_y
Packit a4058c
 * and composite the portion corresponding to
Packit a4058c
 * render_x, render_y, render_width, render_height in the new
Packit a4058c
 * coordinate system into dest_buf starting at 0, 0
Packit a4058c
 */
Packit a4058c
void _pixops_scale    (guchar          *dest_buf,
Packit a4058c
                       int              dest_width,
Packit a4058c
                       int              dest_height,
Packit a4058c
                       int              dest_rowstride,
Packit a4058c
                       int              dest_channels,
Packit a4058c
                       int              dest_has_alpha,
Packit a4058c
                       const guchar    *src_buf,
Packit a4058c
                       int              src_width,
Packit a4058c
                       int              src_height,
Packit a4058c
                       int              src_rowstride,
Packit a4058c
                       int              src_channels,
Packit a4058c
                       int              src_has_alpha,
Packit a4058c
                       int              dest_x,
Packit a4058c
                       int              dest_y,
Packit a4058c
                       int              dest_region_width,
Packit a4058c
                       int              dest_region_height,
Packit a4058c
                       double           offset_x,
Packit a4058c
                       double           offset_y,
Packit a4058c
                       double           scale_x,
Packit a4058c
                       double           scale_y,
Packit a4058c
                       PixopsInterpType interp_type);
Packit a4058c
#endif