last commit for this week
This commit is contained in:
75
Fonderie/t.c
75
Fonderie/t.c
@@ -67,24 +67,90 @@ fimg_destroy(&image);
|
||||
return 0;
|
||||
}
|
||||
/* ----------------------------------------------------------- */
|
||||
/*
|
||||
* test-only function !
|
||||
|
||||
foo = essayer_single("capture/???42.fimg", "/tmp/x8/", STK);
|
||||
fprintf(stderr, "essayer single -> %d\n", foo);
|
||||
|
||||
|
||||
*/
|
||||
int essayer_single(char *globpattern, char *destdir, int chain)
|
||||
{
|
||||
FloatImg image;
|
||||
int idx, foo;
|
||||
|
||||
fprintf(stderr, ">>> %s ( '%s' '%s' %d )\n", __func__,
|
||||
globpattern, destdir, chain);
|
||||
|
||||
foo = fimg_create(&image, 640, 480, 3);
|
||||
if (foo) {
|
||||
fprintf(stderr, "erreur %d creation image\n", foo);
|
||||
return foo;
|
||||
}
|
||||
fimg_vdeg_a(&image, (double)3.141592654);
|
||||
|
||||
foo = single_init(0, destdir, "none");
|
||||
if (foo) {
|
||||
fprintf(stderr, "erreur %d single_init\n", foo);
|
||||
return foo;
|
||||
}
|
||||
|
||||
filterstack_list(chain, "essai du single");
|
||||
|
||||
for (idx=0; idx<666; idx++) {
|
||||
|
||||
foo = filterstack_run(chain, &image, 0);
|
||||
if (foo) {
|
||||
fprintf(stderr, "%s: filterstack run --> %d\n",
|
||||
__func__, foo);
|
||||
return foo;
|
||||
}
|
||||
|
||||
foo = single_push_picture(&image);
|
||||
if (foo) {
|
||||
fprintf(stderr, "erreur %d push picture\n", foo);
|
||||
return foo;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
/* ----------------------------------------------------------- */
|
||||
|
||||
int help(void)
|
||||
{
|
||||
puts("yolo!");
|
||||
|
||||
puts("\t-F\tdefine:the:filter:chain");
|
||||
puts("\t-L\tlist available filters");
|
||||
puts("\t-i\tinfile.fimg");
|
||||
puts("\t-o\tinfile.xxx");
|
||||
|
||||
|
||||
exit(0);
|
||||
}
|
||||
/* ----------------------------------------------------------- */
|
||||
void experiment(void)
|
||||
int experiment(void)
|
||||
{
|
||||
int foo;
|
||||
FloatImg image, dest;
|
||||
|
||||
fprintf(stderr, "EXPERIMENT\n");
|
||||
|
||||
foo = essayer_single("capture/???42.fimg", "/tmp/x8/", STK);
|
||||
foo = fimg_create_from_dump("01137.fimg", &image);
|
||||
if (foo) {
|
||||
fprintf(stderr, "%s: err %d on create\n", __func__, foo);
|
||||
return -1;
|
||||
}
|
||||
|
||||
fprintf(stderr, "essayer single -> %d\n", foo);
|
||||
foo = fimg_clone(&image, &dest, 1);
|
||||
foo = fimg_copy_data(&image, &dest);
|
||||
|
||||
incrustation_0(&image, &dest, 0);
|
||||
|
||||
fimg_export_picture(&dest, "foo.png", 0);
|
||||
|
||||
exit(0); /* back to real world */
|
||||
}
|
||||
@@ -96,7 +162,7 @@ int foo;
|
||||
int opt, do_xper = 0;
|
||||
char *filterchain = "0";
|
||||
char *infile = "mire.fimg";
|
||||
char *outfile = "out.png";
|
||||
char *outfile = PNG;
|
||||
char *outdir = "/tmp/x8/";
|
||||
|
||||
fprintf(stderr, "*** %s : compiled by tTh, %s %s\n", __FILE__,
|
||||
@@ -130,6 +196,7 @@ if (foo) {
|
||||
|
||||
if (do_xper) {
|
||||
experiment();
|
||||
return 0;
|
||||
}
|
||||
|
||||
foo = essai_filterstack(infile, outfile);
|
||||
|
||||
Reference in New Issue
Block a user