gboolean src_has_alpha,
double scale_x,
double scale_y,
- GdkInterpType interp_type,
+ PixopsInterpType interp_type,
int overall_alpha,
int check_x,
int check_y,
switch (interp_type)
{
- case GDK_INTERP_NEAREST:
+ case PIXOPS_INTERP_NEAREST:
pixops_composite_color_nearest (dest_buf, render_x0, render_y0, render_x1, render_y1,
dest_rowstride, dest_channels, dest_has_alpha,
src_buf, src_width, src_height, src_rowstride, src_channels, src_has_alpha,
check_x, check_y, check_size, color1, color2);
return;
- case GDK_INTERP_TILES:
+ case PIXOPS_INTERP_TILES:
tile_make_weights (&filter, scale_x, scale_y, overall_alpha / 255.);
break;
- case GDK_INTERP_BILINEAR:
+ case PIXOPS_INTERP_BILINEAR:
bilinear_make_fast_weights (&filter, scale_x, scale_y, overall_alpha / 255.);
break;
- case GDK_INTERP_HYPER:
+ case PIXOPS_INTERP_HYPER:
bilinear_make_weights (&filter, scale_x, scale_y, overall_alpha / 255.);
break;
}
gboolean src_has_alpha,
double scale_x,
double scale_y,
- GdkInterpType interp_type,
+ PixopsInterpType interp_type,
int overall_alpha)
{
PixopsFilter filter;
switch (interp_type)
{
- case GDK_INTERP_NEAREST:
+ case PIXOPS_INTERP_NEAREST:
pixops_composite_nearest (dest_buf, render_x0, render_y0, render_x1, render_y1,
dest_rowstride, dest_channels, dest_has_alpha,
src_buf, src_width, src_height, src_rowstride, src_channels,
src_has_alpha, scale_x, scale_y, overall_alpha);
return;
- case GDK_INTERP_TILES:
+ case PIXOPS_INTERP_TILES:
tile_make_weights (&filter, scale_x, scale_y, overall_alpha / 255.);
break;
- case GDK_INTERP_BILINEAR:
+ case PIXOPS_INTERP_BILINEAR:
bilinear_make_fast_weights (&filter, scale_x, scale_y, overall_alpha / 255.);
break;
- case GDK_INTERP_HYPER:
+ case PIXOPS_INTERP_HYPER:
bilinear_make_weights (&filter, scale_x, scale_y, overall_alpha / 255.);
break;
}
gboolean src_has_alpha,
double scale_x,
double scale_y,
- GdkInterpType interp_type)
+ PixopsInterpType interp_type)
{
PixopsFilter filter;
PixopsLineFunc line_func;
switch (interp_type)
{
- case GDK_INTERP_NEAREST:
+ case PIXOPS_INTERP_NEAREST:
pixops_scale_nearest (dest_buf, render_x0, render_y0, render_x1, render_y1,
dest_rowstride, dest_channels, dest_has_alpha,
src_buf, src_width, src_height, src_rowstride, src_channels, src_has_alpha,
scale_x, scale_y);
return;
- case GDK_INTERP_TILES:
+ case PIXOPS_INTERP_TILES:
tile_make_weights (&filter, scale_x, scale_y, 1.0);
break;
- case GDK_INTERP_BILINEAR:
+ case PIXOPS_INTERP_BILINEAR:
bilinear_make_fast_weights (&filter, scale_x, scale_y, 1.0);
break;
- case GDK_INTERP_HYPER:
+ case PIXOPS_INTERP_HYPER:
bilinear_make_weights (&filter, scale_x, scale_y, 1.0);
break;
}
#define PIXOPS_H
#include <glib.h>
-#include "gdk-pixbuf.h"
\f
+/* Interpolation modes; must match PixopsInterpType */
+typedef enum {
+ PIXOPS_INTERP_NEAREST,
+ PIXOPS_INTERP_TILES,
+ PIXOPS_INTERP_BILINEAR,
+ PIXOPS_INTERP_HYPER
+} PixopsInterpType;
+
/* 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
int src_has_alpha,
double scale_x,
double scale_y,
- GdkInterpType interp_type,
+ PixopsInterpType interp_type,
int overall_alpha);
/* Scale src_buf from src_width / src_height by factors scale_x, scale_y
int src_has_alpha,
double scale_x,
double scale_y,
- GdkInterpType interp_type,
+ PixopsInterpType interp_type,
int overall_alpha,
int check_x,
int check_y,
int src_has_alpha,
double scale_x,
double scale_y,
- GdkInterpType interp_type);
+ PixopsInterpType interp_type);
\f
switch (j)
{
- case GDK_INTERP_NEAREST:
+ case PIXOPS_INTERP_NEAREST:
printf (" NEAREST\n");
break;
- case GDK_INTERP_TILES:
+ case PIXOPS_INTERP_TILES:
printf (" TILES\n");
break;
- case GDK_INTERP_BILINEAR:
+ case PIXOPS_INTERP_BILINEAR:
printf (" BILINEAR\n");
break;
- case GDK_INTERP_HYPER:
+ case PIXOPS_INTERP_HYPER:
printf (" HYPER\n");
break;
}
dest_buf = g_malloc(dest_rowstride * dest_height);
memset (dest_buf, 0x80, dest_rowstride * dest_height);
- for (filter_level = GDK_INTERP_NEAREST ; filter_level <= GDK_INTERP_HYPER; filter_level++)
+ for (filter_level = PIXOPS_INTERP_NEAREST ; filter_level <= PIXOPS_INTERP_HYPER; filter_level++)
{
printf ("src_channels = %d (%s); dest_channels = %d (%s); filter_level=",
src_channels, src_has_alpha ? "alpha" : "no alpha",
dest_channels, dest_has_alpha ? "alpha" : "no alpha");
switch (filter_level)
{
- case GDK_INTERP_NEAREST:
- printf ("GDK_INTERP_NEAREST\n");
+ case PIXOPS_INTERP_NEAREST:
+ printf ("PIXOPS_INTERP_NEAREST\n");
break;
- case GDK_INTERP_TILES:
- printf ("GDK_INTERP_TILES\n");
+ case PIXOPS_INTERP_TILES:
+ printf ("PIXOPS_INTERP_TILES\n");
break;
- case GDK_INTERP_BILINEAR:
- printf ("GDK_INTERP_BILINEAR\n");
+ case PIXOPS_INTERP_BILINEAR:
+ printf ("PIXOPS_INTERP_BILINEAR\n");
break;
- case GDK_INTERP_HYPER:
- printf ("GDK_INTERP_HYPER\n");
+ case PIXOPS_INTERP_HYPER:
+ printf ("PIXOPS_INTERP_HYPER\n");
break;
}