new: 3x3 smoother in crapulator

This commit is contained in:
2020-12-03 11:47:44 +01:00
parent 8f29cb0db0
commit 160a4afe7b
3 changed files with 45 additions and 15 deletions

View File

@@ -6,8 +6,6 @@
#include "../floatimg.h"
/* -------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
int fimg_filter_3x3(FloatImg *src, FloatImg *dst, FimgFilter3x3 *filtr)
{
@@ -20,6 +18,15 @@ double dval;
fprintf(stderr, ">>> %s ( %p %p %p)\n", __func__, src, dst, filtr);
#endif
if (src->type != FIMG_TYPE_RGB) {
fprintf(stderr, "%s: src type %d invalid\n", __func__, src->type);
return -99;
}
if (dst->type != FIMG_TYPE_RGB) {
fprintf(stderr, "%s: dst type %d invalid\n", __func__, dst->type);
return -99;
}
/* aliasing some vars for cleaner code */
pr = src->R; pg = src->G; pb = src->B;
w = src->width; h = src->height;
@@ -69,7 +76,7 @@ for (y=1; y < h-1; y++) {
}
}
return -1;
return 0;
}
/* -------------------------------------------------------------------- */
/*