Changeset 2643 for libpipi/trunk/pipi/filter/blur.c
 Timestamp:
 Aug 2, 2008, 2:12:58 PM (14 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

libpipi/trunk/pipi/filter/blur.c
r2634 r2643 67 67 buffer = malloc(w * h * (gray ? 1 : 4) * sizeof(double)); 68 68 69 kr = (int)(3. * rx + 1.99999); 69 /* FIXME: the kernel becomes far too big with large values of dx, because 70 * we grow both left and right. Fix the growing direction. */ 71 kr = (int)(3. * rx + .99999 + ceil(abs(dx))); 70 72 kw = 2 * kr + 1; 71 73 K = 1. / (2. * rx * rx); … … 73 75 kernel = malloc(kw * sizeof(double)); 74 76 for(i = kr; i <= kr; i++) 75 kernel[i + kr] = exp(K * ((double)i  dx) * ((double)i dx));77 kernel[i + kr] = exp(K * ((double)i + dx) * ((double)i + dx)); 76 78 77 79 for(y = 0; y < h; y++) … … 126 128 free(kernel); 127 129 128 kr = (int)(3. * ry + 1.99999);130 kr = (int)(3. * ry + .99999 + ceil(abs(dy))); 129 131 kw = 2 * kr + 1; 130 132 K = 1. / (2. * ry * ry); … … 132 134 kernel = malloc(kw * sizeof(double)); 133 135 for(i = kr; i <= kr; i++) 134 kernel[i + kr] = exp(K * ((double)i  dy) * ((double)i dy));136 kernel[i + kr] = exp(K * ((double)i + dy) * ((double)i + dy)); 135 137 136 138 for(y = 0; y < h; y++)
Note: See TracChangeset
for help on using the changeset viewer.