diff --git a/includes/graphics.h b/includes/graphics.h index 748946052..2d556383d 100644 --- a/includes/graphics.h +++ b/includes/graphics.h @@ -52,6 +52,8 @@ void *ptif_pack(pixel *src, int w, int h, int *result_size); pixel *ptif_unpack(void *datain, int size, int *w, int *h); +pixel *resample_img_nn(pixel *src, int sw, int sh, int rw, int rh); + pixel *resample_img(pixel *src, int sw, int sh, int rw, int rh); pixel *rescale_img(pixel *src, int sw, int sh, int *qw, int *qh, int f); diff --git a/src/graphics.c b/src/graphics.c index 0b8b8f826..af628622f 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -140,6 +140,18 @@ pixel *ptif_unpack(void *datain, int size, int *w, int *h){ return result; } +pixel *resample_img_nn(pixel * src, int sw, int sh, int rw, int rh) +{ + int y, x; + pixel *q = NULL; + q = malloc(rw*rh*PIXELSIZE); + for (y=0; y