|
|
@@ -39,7 +39,7 @@ pipi_image_t *pipi_gaussian_blur_ext(pipi_image_t *src, float rx, float ry, |
|
|
|
pipi_pixels_t *srcp, *dstp; |
|
|
|
float *srcdata, *dstdata; |
|
|
|
double *kernel, *buffer; |
|
|
|
double K, L; |
|
|
|
double K; |
|
|
|
int x, y, i, w, h, kr, kw; |
|
|
|
|
|
|
|
w = src->w; |
|
|
@@ -56,12 +56,11 @@ pipi_image_t *pipi_gaussian_blur_ext(pipi_image_t *src, float rx, float ry, |
|
|
|
|
|
|
|
kr = (int)(3. * rx + 0.99999); |
|
|
|
kw = 2 * kr + 1; |
|
|
|
K = 1. / (sqrt(2. * M_PI) * rx); |
|
|
|
L = -1. / (2. * rx * rx); |
|
|
|
K = -1. / (2. * rx * rx); |
|
|
|
|
|
|
|
kernel = malloc(kw * sizeof(double)); |
|
|
|
for(i = -kr; i <= kr; i++) |
|
|
|
kernel[i + kr] = exp(L * ((double)i - dx) * ((double)i - dx)) * K; |
|
|
|
kernel[i + kr] = exp(K * ((double)i - dx) * ((double)i - dx)); |
|
|
|
|
|
|
|
for(y = 0; y < h; y++) |
|
|
|
{ |
|
|
@@ -94,12 +93,11 @@ pipi_image_t *pipi_gaussian_blur_ext(pipi_image_t *src, float rx, float ry, |
|
|
|
|
|
|
|
kr = (int)(3. * ry + 0.99999); |
|
|
|
kw = 2 * kr + 1; |
|
|
|
K = 1. / (sqrt(2. * M_PI) * ry); |
|
|
|
L = -1. / (2. * ry * ry); |
|
|
|
K = -1. / (2. * ry * ry); |
|
|
|
|
|
|
|
kernel = malloc(kw * sizeof(double)); |
|
|
|
for(i = -kr; i <= kr; i++) |
|
|
|
kernel[i + kr] = exp(L * ((double)i - dy) * ((double)i - dy)) * K; |
|
|
|
kernel[i + kr] = exp(K * ((double)i - dy) * ((double)i - dy)); |
|
|
|
|
|
|
|
for(y = 0; y < h; y++) |
|
|
|
{ |
|
|
|