This commit is contained in:
tTh 2022-11-02 22:11:54 +01:00
parent d49b77a79f
commit 1f4b424be7

View File

@ -40,7 +40,7 @@ typedef struct
static fpixel pixels[9];
/* --------------------------------------------------------------------- !*/
static int comparaison(const void *A, const void *B)
static int comparaison_fgris(const void *A, const void *B)
{
return ((fpixel *)A)->fgris > ((fpixel *)B)->fgris;
}
@ -52,11 +52,11 @@ int fimg_filtre_morpho_0(FloatImg *sfimg, FloatImg *dfimg, int index)
{
int xs, ys, loop9;
int xp, yp;
float rgb[3], fval;
float rgb[3];
#if DEBUG_LEVEL
// #if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( %p %p %d )\n", __func__, sfimg, dfimg, index);
#endif
// #endif
if ( (index<0) || (index>8)) {
fprintf(stderr, " %s: bad index %d\n", __func__, index);
@ -77,7 +77,7 @@ for (ys=1; ys<sfimg->height-1; ys++) {
pixels[loop9].fgris = rgb[0];
pixels[loop9].rang = loop9;
}
qsort(&pixels, 9, sizeof(fpixel), comparaison);
qsort(&pixels, 9, sizeof(fpixel), comparaison_fgris);
rgb[0] = rgb[1] = rgb[2] = pixels[index].fgris;
fimg_put_rgb(dfimg, xs, ys, rgb);
}