|
|
@@ -22,12 +22,12 @@ |
|
|
|
#include <stdlib.h> |
|
|
|
#include <string.h> |
|
|
|
|
|
|
|
#include "pipi_internals.h" |
|
|
|
#include "pipi.h" |
|
|
|
#include "pipi_internals.h" |
|
|
|
|
|
|
|
pipi_image_t *pipi_resize(pipi_image_t const *src, int w, int h) |
|
|
|
{ |
|
|
|
int *aline, *line; |
|
|
|
double *aline, *line; |
|
|
|
pipi_image_t *dst; |
|
|
|
int x, y, x0, y0, sw, dw, sh, dh, remy; |
|
|
|
|
|
|
@@ -36,28 +36,28 @@ pipi_image_t *pipi_resize(pipi_image_t const *src, int w, int h) |
|
|
|
sw = src->width; sh = src->height; |
|
|
|
dw = dst->width; dh = dst->height; |
|
|
|
|
|
|
|
aline = malloc(3 * dw * sizeof(int)); |
|
|
|
line = malloc(3 * dw * sizeof(int)); |
|
|
|
aline = malloc(3 * dw * sizeof(double)); |
|
|
|
line = malloc(3 * dw * sizeof(double)); |
|
|
|
|
|
|
|
memset(line, 0, 3 * dw * sizeof(int)); |
|
|
|
memset(line, 0, 3 * dw * sizeof(double)); |
|
|
|
remy = 0; |
|
|
|
|
|
|
|
for(y = 0, y0 = 0; y < dst->height; y++) |
|
|
|
{ |
|
|
|
int toty = 0, ny; |
|
|
|
|
|
|
|
memset(aline, 0, 3 * dw * sizeof(int)); |
|
|
|
memset(aline, 0, 3 * dw * sizeof(double)); |
|
|
|
|
|
|
|
while(toty < sh) |
|
|
|
{ |
|
|
|
if(remy == 0) |
|
|
|
{ |
|
|
|
int r = 0, g = 0, b = 0; |
|
|
|
double r = 0, g = 0, b = 0; |
|
|
|
int remx = 0; |
|
|
|
|
|
|
|
for(x = 0, x0 = 0; x < dst->width; x++) |
|
|
|
{ |
|
|
|
int ar = 0, ag = 0, ab = 0; |
|
|
|
double ar = 0, ag = 0, ab = 0; |
|
|
|
int totx = 0, nx; |
|
|
|
|
|
|
|
while(totx < sw) |
|
|
|