forked from tTh/FloatImg
cosmetic
This commit is contained in:
parent
d49b77a79f
commit
1f4b424be7
@ -40,7 +40,7 @@ typedef struct
|
|||||||
static fpixel pixels[9];
|
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;
|
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 xs, ys, loop9;
|
||||||
int xp, yp;
|
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);
|
fprintf(stderr, ">>> %s ( %p %p %d )\n", __func__, sfimg, dfimg, index);
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
if ( (index<0) || (index>8)) {
|
if ( (index<0) || (index>8)) {
|
||||||
fprintf(stderr, " %s: bad index %d\n", __func__, index);
|
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].fgris = rgb[0];
|
||||||
pixels[loop9].rang = loop9;
|
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;
|
rgb[0] = rgb[1] = rgb[2] = pixels[index].fgris;
|
||||||
fimg_put_rgb(dfimg, xs, ys, rgb);
|
fimg_put_rgb(dfimg, xs, ys, rgb);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user