test program is going to be a real application
This commit is contained in:
22
funcs/t.c
22
funcs/t.c
@@ -19,7 +19,7 @@ float global_fvalue;
|
||||
* nouveau 7 octobre 2020 pendant sonoptic
|
||||
*/
|
||||
|
||||
int essai_qsort_rgb(char *infile)
|
||||
int essai_qsort_rgb(char *infile, char *outfile)
|
||||
{
|
||||
FloatImg src, dst;
|
||||
int foo;
|
||||
@@ -45,7 +45,7 @@ if (foo) {
|
||||
return foo;
|
||||
}
|
||||
|
||||
foo = fimg_export_picture(&dst, "out.pnm", 0);
|
||||
foo = fimg_export_picture(&dst, outfile, 0);
|
||||
if (foo) {
|
||||
fprintf(stderr, "%s : err %d saving result\n", __func__, foo);
|
||||
return foo;
|
||||
@@ -59,9 +59,7 @@ return 0;
|
||||
* nouveau 5 octobre 2020 pendant sonoptic
|
||||
*/
|
||||
|
||||
|
||||
|
||||
int essai_contour_2x2(char *infile)
|
||||
int essai_contour_2x2(char *infile, char *outfile)
|
||||
{
|
||||
FloatImg src, dst;
|
||||
int foo;
|
||||
@@ -87,7 +85,7 @@ if (foo) {
|
||||
return foo;
|
||||
}
|
||||
|
||||
foo = fimg_export_picture(&dst, "out2x2.pnm", 0);
|
||||
foo = fimg_export_picture(&dst, outfile, 0);
|
||||
if (foo) {
|
||||
fprintf(stderr, "%s : err %d saving result\n", __func__, foo);
|
||||
return foo;
|
||||
@@ -99,7 +97,7 @@ return 0;
|
||||
/*
|
||||
* nouveau 5 octobre 2020 pendant sonoptic
|
||||
*/
|
||||
int essai_classif(char *infile)
|
||||
int essai_classif(char *infile, char *outfile)
|
||||
{
|
||||
FloatImg src, dst;
|
||||
int foo;
|
||||
@@ -127,7 +125,7 @@ if (foo) {
|
||||
return foo;
|
||||
}
|
||||
|
||||
foo = fimg_export_picture(&dst, "out.pnm", 0);
|
||||
foo = fimg_export_picture(&dst, outfile, 0);
|
||||
if (foo) {
|
||||
fprintf(stderr, "%s : err %d saving result\n", __func__, foo);
|
||||
return foo;
|
||||
@@ -627,7 +625,7 @@ global_fvalue = 1.0;
|
||||
outfile = "out.pnm";
|
||||
|
||||
|
||||
while ((opt = getopt(argc, argv, "hk:p:v")) != -1) {
|
||||
while ((opt = getopt(argc, argv, "hk:o:p:v")) != -1) {
|
||||
switch(opt) {
|
||||
case 'h': help(0); break;
|
||||
case 'k': global_fvalue = atof(optarg); break;
|
||||
@@ -684,13 +682,13 @@ switch(opt) {
|
||||
foo = fimg_essai_hsv(filename);
|
||||
break;
|
||||
case Classif:
|
||||
foo = essai_classif(filename);
|
||||
foo = essai_classif(filename, outfile);
|
||||
break;
|
||||
case Ctr2x2:
|
||||
foo = essai_contour_2x2(filename);
|
||||
foo = essai_contour_2x2(filename, outfile);
|
||||
break;
|
||||
case Qsortrgb:
|
||||
foo = essai_qsort_rgb(filename);
|
||||
foo = essai_qsort_rgb(filename, outfile);
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "%s : bad command\n", command);
|
||||
|
||||
Reference in New Issue
Block a user