forked from tTh/FloatImg
trinarize on stage
This commit is contained in:
parent
78c8b16fa6
commit
4053baf7fd
|
@ -60,10 +60,9 @@ puts("");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/* -------------------------------------------------------------- */
|
/* -------------------------------------------------------------- */
|
||||||
#define BLANK 50
|
|
||||||
|
|
||||||
int demarre_la_machine(char *pattern, char *outdir, int szfifo,
|
int demarre_la_machine(char *pattern, char *outdir, int szfifo,
|
||||||
int infx, int outfx, int step)
|
int infx, int outfx, int step, int blk)
|
||||||
{
|
{
|
||||||
int foo, idx, width, height;
|
int foo, idx, width, height;
|
||||||
glob_t globbuf;
|
glob_t globbuf;
|
||||||
|
@ -118,7 +117,7 @@ foo = create_fifo(szfifo, width, height, FIMG_TYPE_RGB);
|
||||||
fprintf(stderr, "init fifo (%d slots) --> %d\n", szfifo, foo);
|
fprintf(stderr, "init fifo (%d slots) --> %d\n", szfifo, foo);
|
||||||
|
|
||||||
/* XXX inject a few strange pics in the fifo */
|
/* XXX inject a few strange pics in the fifo */
|
||||||
insert_blank(&input, BLANK, outfx, maxvalue, outdir);
|
insert_blank(&input, blk, outfx, maxvalue, outdir);
|
||||||
|
|
||||||
for (idx=0; idx<globbuf.gl_pathc; idx++) {
|
for (idx=0; idx<globbuf.gl_pathc; idx++) {
|
||||||
cptr = globbuf.gl_pathv[idx];
|
cptr = globbuf.gl_pathv[idx];
|
||||||
|
@ -145,7 +144,7 @@ for (idx=0; idx<globbuf.gl_pathc; idx++) {
|
||||||
}
|
}
|
||||||
fputs("\n", stderr);
|
fputs("\n", stderr);
|
||||||
|
|
||||||
insert_blank(&input, BLANK*2, outfx, maxvalue, outdir);
|
insert_blank(&input, blk, outfx, maxvalue, outdir);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* PLEASE, FLUSH THE FIFO !
|
* PLEASE, FLUSH THE FIFO !
|
||||||
|
@ -186,14 +185,16 @@ char *out_dir = "p8";
|
||||||
int in_effect = 0;
|
int in_effect = 0;
|
||||||
int out_effect = 0;
|
int out_effect = 0;
|
||||||
int steps = 1;
|
int steps = 1;
|
||||||
|
int blanks = 20;
|
||||||
|
|
||||||
fprintf(stderr, "*** %s :\n\tcompiled by tTh, %s %s\n\tpid %d\n",
|
fprintf(stderr, "*** %s :\n\tcompiled by tTh, %s %s\n\tpid %d\n",
|
||||||
argv[0], __DATE__, __TIME__, getpid());
|
argv[0], __DATE__, __TIME__, getpid());
|
||||||
fimg_print_version(2);
|
fimg_print_version(2);
|
||||||
|
|
||||||
while ((opt = getopt(argc, argv, "ghI:O:s:T:vw:x:")) != -1) {
|
while ((opt = getopt(argc, argv, "B:ghI:O:s:T:vw:x:")) != -1) {
|
||||||
switch(opt) {
|
switch(opt) {
|
||||||
|
case 'B': blanks = atoi(optarg);
|
||||||
|
break;
|
||||||
case 'g': convert_to_gray = 1;
|
case 'g': convert_to_gray = 1;
|
||||||
break;
|
break;
|
||||||
case 'h': help();
|
case 'h': help();
|
||||||
|
@ -221,7 +222,7 @@ if (verbosity) {
|
||||||
}
|
}
|
||||||
|
|
||||||
foo = demarre_la_machine(in_pattern, out_dir, fifosize, in_effect,
|
foo = demarre_la_machine(in_pattern, out_dir, fifosize, in_effect,
|
||||||
out_effect, steps);
|
out_effect, steps, blanks);
|
||||||
fprintf(stderr, "retour du big-run de la machine -> %d\n", foo);
|
fprintf(stderr, "retour du big-run de la machine -> %d\n", foo);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -80,19 +80,19 @@ for (foo=0; foo<size; foo++) {
|
||||||
if (fptr[foo] < mRa || fptr[foo] > mRb)
|
if (fptr[foo] < mRa || fptr[foo] > mRb)
|
||||||
fptr[foo] = 0.0;
|
fptr[foo] = 0.0;
|
||||||
else
|
else
|
||||||
fptr[foo] = VAL;
|
fptr[foo] = mm[1];
|
||||||
|
|
||||||
fptr = pimg->G;
|
fptr = pimg->G;
|
||||||
if (fptr[foo] < mGa || fptr[foo] > mGb)
|
if (fptr[foo] < mGa || fptr[foo] > mGb)
|
||||||
fptr[foo] = 0.0;
|
fptr[foo] = 0.0;
|
||||||
else
|
else
|
||||||
fptr[foo] = VAL;
|
fptr[foo] = mm[3];
|
||||||
|
|
||||||
fptr = pimg->B;
|
fptr = pimg->B;
|
||||||
if (fptr[foo] < mBa || fptr[foo] > mBb)
|
if (fptr[foo] < mBa || fptr[foo] > mBb)
|
||||||
fptr[foo] = 0.0;
|
fptr[foo] = 0.0;
|
||||||
else
|
else
|
||||||
fptr[foo] = VAL;
|
fptr[foo] = mm[5];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue