Compare commits

..

No commits in common. "3fce2b19c549b8faac3fc685e99d53bc6d9878de" and "bdcbf8c06799cec8ac7776c74f8ef493f5866123" have entirely different histories.

3 changed files with 17 additions and 51 deletions

View File

@ -120,6 +120,10 @@ int insert_picture(FloatImg *src)
FloatImg *dst; FloatImg *dst;
int nbre; int nbre;
/*
* this is the where we can insert the 'input filter'
*/
dst = &g_fifo.slots[g_fifo.next]; dst = &g_fifo.slots[g_fifo.next];
nbre = dst->width * dst->height * sizeof(float); nbre = dst->width * dst->height * sizeof(float);

View File

@ -43,49 +43,20 @@ int insert_blank(FloatImg *image, int nbre, int pproc,
float fval, char *outd) float fval, char *outd)
{ {
int idx, foo; int idx, foo;
int preloaded = 0;
FloatImg blank;
char *fname;
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( %p %d %d %f '%s' )\n", __func__,
image, nbre, pproc, fval, outd);
#endif
if (NULL != (fname=getenv("BLANK_FIMG"))) {
fprintf(stderr,"try to load %s\n", fname);
fimg_clone(image, &blank, 1);
foo = fimg_load_from_dump(fname, &blank);
if (foo) {
fprintf(stderr, "epic fail %d on %s\n", foo, fname);
exit(1);
}
if (verbosity) fimg_describe(&blank, "Blank pic");
preloaded = 1;
}
fimg_clear(image); fimg_clear(image);
for (idx=0; idx<nbre; idx++) { for (idx=0; idx<nbre; idx++) {
if (preloaded) { fimg_vdeg_a(image, fval);
fimg_copy_data(&blank, image); // brotche_rand48_b(image, drand48()*0.10, 1e5);
}
else {
fimg_hdeg_a(image, fval);
}
if ((foo=traite_une_image(image, pproc, 1, outd))) { if ((foo=traite_une_image(image, pproc, 1, outd))) {
fprintf(stderr, "%s : err %d from 'traite_une_image'\n", fprintf(stderr, "%s : err %d from 'traite_une_image'\n",
__func__, foo); __func__, foo);
break; break;
} }
printf("\t%c\r", "ABCDEFGH"[idx%8]); fflush(stdout); printf("\t%c\r", "ABCDEF"[idx%6]); fflush(stdout);
} }
puts(""); puts("");
if (preloaded) {
fimg_destroy(&blank);
}
return 0; return 0;
} }
/* -------------------------------------------------------------- */ /* -------------------------------------------------------------- */

View File

@ -16,42 +16,33 @@
int verbosity = 0; int verbosity = 0;
/* --------------------------------------------------------------------- */
void help(int k)
{
if (verbosity) fimg_print_version(k);
exit(0);
}
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
FloatImg fimg; FloatImg fimg;
int foo, opt; int foo;
while ((opt = getopt(argc, argv, "hv")) != -1) { /*
switch(opt) { * pas de traitement des options ?
case 'v': verbosity++; break; */
case 'h': help(1); exit(1);
}
}
if (2 != argc-optind) { if (3 != argc) {
fprintf(stderr, "error: %s need two filenames\n", argv[0]); fimg_print_version(1);
fprintf(stderr, "usage:\n\t%s foo.png bar.fimg\n", argv[0]);
exit(1); exit(1);
} }
memset(&fimg, 0, sizeof(FloatImg)); memset(&fimg, 0, sizeof(FloatImg));
foo = fimg_create_from_png(argv[optind], &fimg); foo = fimg_create_from_png(argv[1], &fimg);
if (foo) { if (foo) {
fprintf(stderr, "%s : err %d, abort.\n", argv[0], foo); fprintf(stderr, "%s : err %d, abort.\n", argv[0], foo);
exit(1); exit(1);
} }
if (verbosity) fimg_describe(&fimg, argv[optind+1]); if (verbosity) fimg_describe(&fimg, argv[2]);
foo = fimg_dump_to_file(&fimg, argv[optind+1], 0); foo = fimg_dump_to_file(&fimg, argv[2], 0);
if (foo) { if (foo) {
fprintf(stderr, "save as '%s' -> err %d\n", argv[2], foo); fprintf(stderr, "save as '%s' -> err %d\n", argv[2], foo);
exit(1); exit(1);