FloatImg/funcs/equalize.c
2020-04-11 23:18:33 +02:00

40 lines
1.0 KiB
C

/*
* FLOATIMG
* egalisation dinamique approximative
* #coronamaison Thu 09 Apr 2020 03:37:10 PM CEST
*/
#include <stdio.h>
#include <string.h>
#include "../floatimg.h"
extern int verbosity;
/* --------------------------------------------------------------------- */
int fimg_equalize_compute(FloatImg *src, void *vptr)
{
float minmax[6];
int foo;
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( %p )\n", __func__, src);
#endif
foo = fimg_get_minmax_rgb(src, minmax);
printf("Rmin %12.4g Rmax %12.4g\n", minmax[0], minmax[1]);
printf("Gmin %12.4g Gmax %12.4g\n", minmax[2], minmax[3]);
printf("Bmin %12.4g Bmax %12.4g\n", minmax[4], minmax[5]);
if ( (minmax[0]<0.0) || (minmax[2]<0.0) || (minmax[4]<0.0) ) {
fprintf(stderr, "%s: negative value ?\n", __func__);
return -4;
}
return 0;
}
/* --------------------------------------------------------------------- */
/* --------------------------------------------------------------------- */
/* --------------------------------------------------------------------- */