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;
int nbre;
/*
* this is the where we can insert the 'input filter'
*/
dst = &g_fifo.slots[g_fifo.next];
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)
{
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);
for (idx=0; idx<nbre; idx++) {
if (preloaded) {
fimg_copy_data(&blank, image);
}
else {
fimg_hdeg_a(image, fval);
}
fimg_vdeg_a(image, fval);
// brotche_rand48_b(image, drand48()*0.10, 1e5);
if ((foo=traite_une_image(image, pproc, 1, outd))) {
fprintf(stderr, "%s : err %d from 'traite_une_image'\n",
__func__, foo);
break;
}
printf("\t%c\r", "ABCDEFGH"[idx%8]); fflush(stdout);
printf("\t%c\r", "ABCDEF"[idx%6]); fflush(stdout);
}
puts("");
if (preloaded) {
fimg_destroy(&blank);
}
return 0;
}
/* -------------------------------------------------------------- */

View File

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