Compare commits

..

No commits in common. "c598c4a2c02976702b55f84fe37bbc8f4c4a1039" and "3bd387f0a9ade7c340f06e6c875fce04679662b5" have entirely different histories.

11 changed files with 19 additions and 33 deletions

View File

@ -20,7 +20,7 @@
* https://git.tetalab.org/tTh/FloatImg * https://git.tetalab.org/tTh/FloatImg
*/ */
#define FIMG_VERSION (231) #define FIMG_VERSION (230)
#define RELEASE_NAME ("noname") #define RELEASE_NAME ("noname")
#define PATCH_LEVEL ("aaaa") #define PATCH_LEVEL ("aaaa")

View File

@ -46,9 +46,9 @@ float *pr, *pg, *pb; /* alias for src pix filds */
float *M; /* alias of filter matrix */ float *M; /* alias of filter matrix */
double dval; double dval;
#if DEBUG_LEVEL // #if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( %p %p %p )\n", __func__, src, dst, filtr); fprintf(stderr, ">>> %s ( %p %p %p )\n", __func__, src, dst, filtr);
#endif // #endif
if (src->type != FIMG_TYPE_RGB) { if (src->type != FIMG_TYPE_RGB) {
fprintf(stderr, "%s: src type %d invalid\n", __func__, src->type); fprintf(stderr, "%s: src type %d invalid\n", __func__, src->type);

View File

@ -132,11 +132,9 @@ fprintf(stderr, ">>> %s ( %s %p %d )\n", __func__, str, r, notused);
if (notused) { if (notused) {
fprintf(stderr, "notused was %d, must be 0 in %s\n", fprintf(stderr, "notused was %d, must be 0 in %s\n",
notused, __func__); notused, __func__); }
}
if (verbosity > 1) fprintf(stderr, "%s: parsing '%s'\n", __func__, str); if (verbosity > 1) fprintf(stderr, "%s: parsing '%s'\n", __func__, str);
foo = sscanf(str, "%d,%d,%d,%d", &w, &h, &x, &y); foo = sscanf(str, "%d,%d,%d,%d", &w, &h, &x, &y);
if (4 == foo) { if (4 == foo) {
r->x = x, r->y = y, r->w = w, r->h = h; r->x = x, r->y = y, r->w = w, r->h = h;

View File

@ -13,17 +13,11 @@ extern int verbosity; /* must be declared around main() */
/* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */
int fimg_add_alpha_chan(FloatImg *img) int fimg_add_alpha_chan(FloatImg *img)
{ {
fprintf(stderr, ">>> %s ( %p )\n", __func__, img);
return -4; return -4;
} }
/* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */
int fimg_kill_alpha_chan(FloatImg *img) int fimg_kill_alpha_chan(FloatImg *img)
{ {
fprintf(stderr, ">>> %s ( %p )\n", __func__, img);
return -4; return -4;
} }
/* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */

View File

@ -47,8 +47,8 @@ if (memcmp(filehead.magic, "FIMG", 4)) {
} }
/* XXX preparer la gestion des metadata */ /* XXX preparer la gestion des metadata */
if ('a' == filehead.magic[4] && verbosity > 1) { if ('a' == filehead.magic[4] && verbosity) {
fprintf(stderr,"*** %s have metadata\n", fname); fprintf(stderr,"\t****** %s have metadata\n", fname);
} }
datas[0] = filehead.w; datas[0] = filehead.w;

View File

@ -124,7 +124,7 @@ return 0;
* can compute the maxima of a lot of pictures... * can compute the maxima of a lot of pictures...
*/ */
int fimg_max_of_max(FloatImg *img, float maxes[3]) fimg_max_of_max(FloatImg *img, float maxes[3])
{ {
float localmax[3]; float localmax[3];
int idx, surface; int idx, surface;
@ -426,8 +426,7 @@ if (fi->type != FIMG_TYPE_RGB) {
return; return;
} }
nbre = fi->width * fi->height; nbre = fi->width * fi->height;
// fprintf(stderr, "%s: %d pixels\n", __func__, nbre);
fprintf(stderr, "in %s, drand48() is %f\n", __func__, drand48());
for (idx=0; idx<nbre; idx++) { for (idx=0; idx<nbre; idx++) {
fi->R[idx] = drand48() * kmul; fi->R[idx] = drand48() * kmul;

3
tools/.gitignore vendored
View File

@ -17,8 +17,5 @@ cumulfimgs
fimgops fimgops
fimgfx fimgfx
fimgmetadata fimgmetadata
fimgfilters
*.gif
*.png *.png
*.tiff *.tiff

View File

@ -13,12 +13,9 @@ DEPS = ../floatimg.h ../libfloatimg.a Makefile
all: fimg2pnm mkfimg png2fimg fimgstats fimg2png \ all: fimg2pnm mkfimg png2fimg fimgstats fimg2png \
fimg2tiff fimg2text fimg2fits \ fimg2tiff fimg2text fimg2fits \
addpnm2fimg cumulfimgs fimgops fimgfx \ addpnm2fimg cumulfimgs fimgops fimgfx \
fimgmetadata fimgfilters \ fimgmetadata \
fimghalfsize fimgextract fimghalfsize fimgextract
fimgfilters: fimgfilters.c $(DEPS)
gcc $(COPT) $< ../libfloatimg.a -lm -o $@
fimgmetadata: fimgmetadata.c $(DEPS) fimgmetadata: fimgmetadata.c $(DEPS)
gcc $(COPT) $< ../libfloatimg.a -lm -o $@ gcc $(COPT) $< ../libfloatimg.a -lm -o $@

View File

@ -41,7 +41,6 @@ void help(int v)
puts(""); puts("");
puts("$ cumulfimgs a.fimg b.fimg c-fimg ..."); puts("$ cumulfimgs a.fimg b.fimg c-fimg ...");
puts("cumulator options :"); puts("cumulator options :");
puts("\t-a\tcompute average");
puts("\t-g\tconvert to gray level"); puts("\t-g\tconvert to gray level");
puts("\t-m\tcompute the max of the maxes"); puts("\t-m\tcompute the max of the maxes");
puts("\t-o\tname of output file"); puts("\t-o\tname of output file");
@ -141,6 +140,11 @@ if (rescale) {
fimg_div_cste(&accu, (float)compte); fimg_div_cste(&accu, (float)compte);
} }
/* XXX */
if (experiment) {
}
/* XXX */
fprintf(stderr, "max of max %9.3f %9.3f %9.3f\n", fprintf(stderr, "max of max %9.3f %9.3f %9.3f\n",
vals[0], vals[1], vals[2]); vals[0], vals[1], vals[2]);

View File

@ -102,7 +102,7 @@ if (verbosity) {
} }
if (argc==optind) { if (argc==optind) {
fprintf(stderr, "what the fsck ?\n"); fprintf(stderr, "wuh ?\n");
exit(0); exit(0);
} }

View File

@ -16,7 +16,7 @@
int verbosity; int verbosity;
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
int filtre_image(char *infname, char *outfname, int type) int filtre_image(char *infname, char *outfname)
{ {
FloatImg src, dst; FloatImg src, dst;
int foo; int foo;
@ -30,11 +30,9 @@ static FimgFilter3x3 filtre = {
1.0/24.0, 0.0 1.0/24.0, 0.0
}; };
fprintf(stderr, ">>> %s ( '%s' '%s' )\n", __func__, infname, outfname);
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( '%s' '%s' %d )\n", __func__, infname, outfname, type);
fimg_show_filter(NULL, &filtre); fimg_show_filter(NULL, &filtre);
#endif
if ((foo = fimg_create_from_dump(infname, &src))) { if ((foo = fimg_create_from_dump(infname, &src))) {
fprintf(stderr, "read error on '%s' is %d\n", infname, foo); fprintf(stderr, "read error on '%s' is %d\n", infname, foo);
@ -54,10 +52,9 @@ if (foo) {
foo = fimg_dump_to_file(&dst, outfname, 0); foo = fimg_dump_to_file(&dst, outfname, 0);
if (foo) { if (foo) {
fprintf(stderr, "dumping to file give us a %d\n", foo); fprintf(stderr, "dumping to file give us a %d\n", foo);
exit(5);
} }
return 0; return -12;
} }
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
@ -72,7 +69,7 @@ if (3 != argc) {
fprintf(stderr, " +++ %s +++\n", argv[0]); fprintf(stderr, " +++ %s +++\n", argv[0]);
foo = filtre_image(argv[1], argv[2], 0); foo = filtre_image(argv[1], argv[2]);
fprintf(stderr, " filtrage -> %d\n", foo); fprintf(stderr, " filtrage -> %d\n", foo);
return 0; return 0;