embarquement de la fonderie

This commit is contained in:
2020-11-02 01:25:00 +01:00
parent 364ce06130
commit d50f2145ba
11 changed files with 681 additions and 5 deletions

42
Fonderie/crapulator.c Normal file
View File

@@ -0,0 +1,42 @@
/*
* crapulator.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <floatimg.h>
#include "crapulator.h"
/* -------------------------------------------------------------- */
int crapulator(FloatImg *image, int notused)
{
int retval;
FloatImg imgtmp;
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( %p %d )\n", __func__, image, notused);
#endif
/* contour 2x2 don't work inplace */
fimg_clone(image, &imgtmp, 0);
/* so we work on a copy */
retval = fimg_contour_2x2(image, &imgtmp, 0);
if (retval) {
fprintf(stderr, "%s : err contour %d\n",
__func__, retval);
exit(1);
}
/* and put back porcessed pixels */
fimg_copy_data(&imgtmp, image);
fimg_destroy(&imgtmp);
return 0;
}
/* -------------------------------------------------------------- */