2000-04-11 07:03:25 +00:00
|
|
|
|
#ifndef PIXOPS_H
|
|
|
|
|
#define PIXOPS_H
|
|
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
|
|
|
|
|
|
|
2000-01-05 21:33:58 +00:00
|
|
|
|
|
2002-02-08 19:52:23 +00:00
|
|
|
|
/* Interpolation modes; must match GdkInterpType */
|
2001-09-17 15:53:59 +00:00
|
|
|
|
typedef enum {
|
|
|
|
|
PIXOPS_INTERP_NEAREST,
|
|
|
|
|
PIXOPS_INTERP_TILES,
|
|
|
|
|
PIXOPS_INTERP_BILINEAR,
|
|
|
|
|
PIXOPS_INTERP_HYPER
|
|
|
|
|
} PixopsInterpType;
|
|
|
|
|
|
2000-01-05 21:33:58 +00:00
|
|
|
|
/* Scale src_buf from src_width / src_height by factors scale_x, scale_y
|
|
|
|
|
* and composite the portion corresponding to
|
|
|
|
|
* render_x, render_y, render_width, render_height in the new
|
|
|
|
|
* coordinate system into dest_buf starting at 0, 0
|
|
|
|
|
*/
|
2000-04-11 07:03:25 +00:00
|
|
|
|
void pixops_composite (guchar *dest_buf,
|
2000-01-05 21:33:58 +00:00
|
|
|
|
int render_x0,
|
|
|
|
|
int render_y0,
|
|
|
|
|
int render_x1,
|
|
|
|
|
int render_y1,
|
|
|
|
|
int dest_rowstride,
|
|
|
|
|
int dest_channels,
|
|
|
|
|
int dest_has_alpha,
|
2000-04-11 07:03:25 +00:00
|
|
|
|
const guchar *src_buf,
|
2000-01-05 21:33:58 +00:00
|
|
|
|
int src_width,
|
|
|
|
|
int src_height,
|
|
|
|
|
int src_rowstride,
|
|
|
|
|
int src_channels,
|
|
|
|
|
int src_has_alpha,
|
|
|
|
|
double scale_x,
|
|
|
|
|
double scale_y,
|
2001-09-17 15:53:59 +00:00
|
|
|
|
PixopsInterpType interp_type,
|
2000-01-05 21:33:58 +00:00
|
|
|
|
int overall_alpha);
|
|
|
|
|
|
|
|
|
|
/* Scale src_buf from src_width / src_height by factors scale_x, scale_y
|
|
|
|
|
* and composite the portion corresponding to
|
|
|
|
|
* render_x, render_y, render_width, render_height in the new
|
|
|
|
|
* coordinate system against a checkboard with checks of size check_size
|
|
|
|
|
* of the colors color1 and color2 into dest_buf starting at 0, 0
|
|
|
|
|
*/
|
2000-04-11 07:03:25 +00:00
|
|
|
|
void pixops_composite_color (guchar *dest_buf,
|
2000-01-05 21:33:58 +00:00
|
|
|
|
int render_x0,
|
|
|
|
|
int render_y0,
|
|
|
|
|
int render_x1,
|
|
|
|
|
int render_y1,
|
|
|
|
|
int dest_rowstride,
|
|
|
|
|
int dest_channels,
|
|
|
|
|
int dest_has_alpha,
|
2000-04-11 07:03:25 +00:00
|
|
|
|
const guchar *src_buf,
|
2000-01-05 21:33:58 +00:00
|
|
|
|
int src_width,
|
|
|
|
|
int src_height,
|
|
|
|
|
int src_rowstride,
|
|
|
|
|
int src_channels,
|
|
|
|
|
int src_has_alpha,
|
|
|
|
|
double scale_x,
|
|
|
|
|
double scale_y,
|
2001-09-17 15:53:59 +00:00
|
|
|
|
PixopsInterpType interp_type,
|
2000-01-05 21:33:58 +00:00
|
|
|
|
int overall_alpha,
|
|
|
|
|
int check_x,
|
|
|
|
|
int check_y,
|
|
|
|
|
int check_size,
|
2000-04-11 07:03:25 +00:00
|
|
|
|
guint32 color1,
|
|
|
|
|
guint32 color2);
|
2000-01-05 21:33:58 +00:00
|
|
|
|
|
|
|
|
|
/* Scale src_buf from src_width / src_height by factors scale_x, scale_y
|
|
|
|
|
* and composite the portion corresponding to
|
|
|
|
|
* render_x, render_y, render_width, render_height in the new
|
|
|
|
|
* coordinate system into dest_buf starting at 0, 0
|
|
|
|
|
*/
|
2000-04-11 07:03:25 +00:00
|
|
|
|
void pixops_scale (guchar *dest_buf,
|
2000-01-05 21:33:58 +00:00
|
|
|
|
int render_x0,
|
|
|
|
|
int render_y0,
|
|
|
|
|
int render_x1,
|
|
|
|
|
int render_y1,
|
|
|
|
|
int dest_rowstride,
|
|
|
|
|
int dest_channels,
|
|
|
|
|
int dest_has_alpha,
|
2000-04-11 07:03:25 +00:00
|
|
|
|
const guchar *src_buf,
|
2000-01-05 21:33:58 +00:00
|
|
|
|
int src_width,
|
|
|
|
|
int src_height,
|
|
|
|
|
int src_rowstride,
|
|
|
|
|
int src_channels,
|
|
|
|
|
int src_has_alpha,
|
|
|
|
|
double scale_x,
|
|
|
|
|
double scale_y,
|
2001-09-17 15:53:59 +00:00
|
|
|
|
PixopsInterpType interp_type);
|
2000-04-11 07:03:25 +00:00
|
|
|
|
|
|
|
|
|
|
2000-01-05 21:33:58 +00:00
|
|
|
|
|
2000-04-11 07:03:25 +00:00
|
|
|
|
#endif
|