|
|
@@ -85,3 +85,27 @@ pipi_image_t *pipi_gaussian_blur_ext(pipi_image_t *src, float rx, float ry, |
|
|
|
return ret; |
|
|
|
} |
|
|
|
|
|
|
|
/* FIXME: box blur would be incredibly faster using an accumulator instead |
|
|
|
* of a convolution filter... */ |
|
|
|
pipi_image_t *pipi_box_blur(pipi_image_t *src, int size) |
|
|
|
{ |
|
|
|
return pipi_box_blur_ext(src, size, size); |
|
|
|
} |
|
|
|
|
|
|
|
pipi_image_t *pipi_box_blur_ext(pipi_image_t *src, int m, int n) |
|
|
|
{ |
|
|
|
pipi_image_t *ret; |
|
|
|
double *kernel; |
|
|
|
int i; |
|
|
|
|
|
|
|
kernel = malloc(m * n * sizeof(double)); |
|
|
|
for(i = 0; i < m * n; i++) |
|
|
|
kernel[i] = 1. / (m * n); |
|
|
|
|
|
|
|
ret = pipi_convolution(src, m, n, kernel); |
|
|
|
|
|
|
|
free(kernel); |
|
|
|
|
|
|
|
return ret; |
|
|
|
} |
|
|
|
|