]> git.imager.perl.org - imager.git/blobdiff - conv.c
the cookbook said we couldn't limit image sizes, but we can now. Fix
[imager.git] / conv.c
diff --git a/conv.c b/conv.c
index dd79af119ec8c4bc296553c296b348ce98843cc4..033fb520d39ca58474b530b276a2303c113f324a 100644 (file)
--- a/conv.c
+++ b/conv.c
@@ -1,4 +1,4 @@
-#include "image.h"
+#include "imager.h"
 
 /*
   General convolution for 2d decoupled filters
 */
 
 void
-i_conv(i_img *im,float *coeff,int len) {
+i_conv(i_img *im,const float *coeff,int len) {
   int i,l,c,ch,center;
   float pc;
   i_color rcolor;
   float res[11];
   i_img timg;
 
-  mm_log((1,"i_conv(im* 0x%x,coeff 0x%x,len %d)\n",im,coeff,len));
+  mm_log((1,"i_conv(im %p, coeff %p, len %d)\n",im,coeff,len));
  
   i_img_empty_ch(&timg,im->xsize,im->ysize,im->channels);
 
   center=(len-1)/2;
 
-
+  /* don't move the calculation of pc up here, it depends on which pixels
+     are readable */
   for(l=0;l<im->ysize;l++) {
     for(i=0;i<im->xsize;i++) {
       pc=0.0;
@@ -66,6 +67,7 @@ i_conv(i_img *im,float *coeff,int len) {
          i_ppix(im,l,i,&rcolor);
        }
     }
+  i_img_exorcise(&timg);
 }