From 45e91c15b200749e52b7510601a0046855d94c24 Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Fri, 3 Jun 2011 23:36:26 +0100 Subject: [PATCH] Bilinear interpolation for resampling --- src/graphics.c | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/src/graphics.c b/src/graphics.c index 33560fcdd..df5b96ca8 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -147,11 +147,34 @@ pixel *resample_img(pixel *src, int sw, int sh, int rw, int rh) pixel *q; q = malloc(rw*rh*PIXELSIZE); //TODO: Actual resampling, this is just cheap nearest pixel crap - for (y=0; y sw && rh > sh){ + float fx, fy, fyc, fxc, intp; + pixel tr, tl, br, bl; + //Bilinear interpolation for upscaling + for (y=0; y