working on histogram computation
This commit is contained in:
parent
4b2d2c264f
commit
951dc4450f
@ -4,7 +4,7 @@ COPT = -Wall -fpic -g -no-pie -DDEBUG_LEVEL=0
|
||||
DEPS = ../floatimg.h Makefile
|
||||
OBJS = fimg-png.o fimg-tiff.o misc-plots.o filtrage.o utils.o \
|
||||
fimg-libpnm.o rampes.o sfx0.o geometry.o rotate.o \
|
||||
equalize.o fimg-fits.o saturation.o
|
||||
equalize.o fimg-fits.o saturation.o histogram.o
|
||||
|
||||
#---------------------------------------------------------------
|
||||
|
||||
@ -45,6 +45,9 @@ rotate.o: rotate.c $(DEPS)
|
||||
saturation.o: saturation.c $(DEPS)
|
||||
gcc $(COPT) -c $<
|
||||
|
||||
histogram.o: histogram.c $(DEPS)
|
||||
gcc $(COPT) -c $<
|
||||
|
||||
equalize.o: equalize.c $(DEPS)
|
||||
gcc $(COPT) -c $<
|
||||
|
||||
|
@ -34,9 +34,9 @@ dr = minmax[1] - minmax[0];
|
||||
dg = minmax[3] - minmax[2];
|
||||
db = minmax[5] - minmax[4];
|
||||
|
||||
printf("Rmin %12.4g Rmax %12.4g delta %12.4g\n", minmax[0], minmax[1], dr);
|
||||
printf("Gmin %12.4g Gmax %12.4g delta %12.4g\n", minmax[2], minmax[3], dg);
|
||||
printf("Bmin %12.4g Bmax %12.4g delta %12.4g\n", minmax[4], minmax[5], db);
|
||||
printf("Rmin %12.4g Rmax %12.4g delta %12.4g\n", minmax[0], minmax[1], dr);
|
||||
printf("Gmin %12.4g Gmax %12.4g delta %12.4g\n", minmax[2], minmax[3], dg);
|
||||
printf("Bmin %12.4g Bmax %12.4g delta %12.4g\n", minmax[4], minmax[5], db);
|
||||
|
||||
if ( (minmax[0]<0.0) || (minmax[2]<0.0) || (minmax[4]<0.0) ) {
|
||||
fprintf(stderr, "%s: negative value ?\n", __func__);
|
||||
|
35
funcs/t.c
35
funcs/t.c
@ -401,7 +401,36 @@ fprintf(stderr, "save as png -> %d\n", foo);
|
||||
return 0;
|
||||
}
|
||||
/* --------------------------------------------------------------------- */
|
||||
enum nCmd { Equalize=1, Rotate, Sfx0, F3x3, MIRE, Wfits, Wpng, Wtiff };
|
||||
|
||||
/* func in histogram.c */
|
||||
int fimg_essai_histo(FloatImg *src, char *outpic, int k);
|
||||
|
||||
|
||||
int essai_histogramme(char *fname, int k)
|
||||
{
|
||||
FloatImg fimg;
|
||||
int foo;
|
||||
fprintf(stderr, ">>> %s ( '%s' %d )\n", __func__, fname, k);
|
||||
|
||||
foo = fimg_create_from_dump(fname, &fimg);
|
||||
if (foo) {
|
||||
fprintf(stderr, "%s: err load '%s'\n", __func__, fname);
|
||||
return foo;
|
||||
}
|
||||
|
||||
foo = fimg_essai_histo(&fimg, "out.png", k);
|
||||
if (foo) {
|
||||
fprintf(stderr, "essai_histo -> %d\n", foo);
|
||||
return foo;
|
||||
}
|
||||
|
||||
fprintf(stderr, "\\o/ end of %s\n", __func__);
|
||||
|
||||
return -1;
|
||||
}
|
||||
/* --------------------------------------------------------------------- */
|
||||
enum nCmd { Equalize=1, Rotate, Sfx0, F3x3, MIRE, Wfits, Wpng, Wtiff,
|
||||
Histo };
|
||||
typedef struct {
|
||||
char *name;
|
||||
int Cmd;
|
||||
@ -416,6 +445,7 @@ Command commands[] = {
|
||||
{ "wfits", Wfits },
|
||||
{ "wpng", Wpng },
|
||||
{ "wtiff", Wtiff },
|
||||
{ "histo", Histo },
|
||||
{ NULL, 0 }
|
||||
} ;
|
||||
|
||||
@ -506,6 +536,9 @@ switch(opt) {
|
||||
case Wtiff:
|
||||
foo = essai_ecriture_tiff(filename);
|
||||
break;
|
||||
case Histo:
|
||||
foo = essai_histogramme(filename, 0);
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "%s : bad command\n", command);
|
||||
exit(1);
|
||||
|
Loading…
Reference in New Issue
Block a user