forked from tTh/FloatImg
commit whitout testing :)
This commit is contained in:
parent
568811eb90
commit
3fce2b19c5
|
@ -120,10 +120,6 @@ 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);
|
||||
|
|
|
@ -43,20 +43,49 @@ 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++) {
|
||||
fimg_vdeg_a(image, fval);
|
||||
// brotche_rand48_b(image, drand48()*0.10, 1e5);
|
||||
if (preloaded) {
|
||||
fimg_copy_data(&blank, image);
|
||||
}
|
||||
else {
|
||||
fimg_hdeg_a(image, fval);
|
||||
}
|
||||
|
||||
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", "ABCDEF"[idx%6]); fflush(stdout);
|
||||
printf("\t%c\r", "ABCDEFGH"[idx%8]); fflush(stdout);
|
||||
}
|
||||
puts("");
|
||||
|
||||
if (preloaded) {
|
||||
fimg_destroy(&blank);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
/* -------------------------------------------------------------- */
|
||||
|
|
Loading…
Reference in New Issue