classif trial in fimgfx

This commit is contained in:
tth 2021-04-20 17:46:54 +02:00
parent 4872ec698c
commit 2bd44fa853
2 changed files with 11 additions and 2 deletions

View File

@ -4,7 +4,7 @@
* http://la.buvette.org/photos/cumul * http://la.buvette.org/photos/cumul
*/ */
#define FIMG_VERSION 133 #define FIMG_VERSION 134
/* /*
* in memory descriptor * in memory descriptor
@ -210,7 +210,7 @@ void fimg_print_minmax(float minmax[6], char *titre);
int parse_WxH(char *str, int *pw, int *ph); int parse_WxH(char *str, int *pw, int *ph);
int parse_double(char *str, double *dptr); int parse_double(char *str, double *dptr);
int format_from_extension(char *fname); int format_from_extension(char *fname);
char * extension_from_format(int fmt);

View File

@ -22,6 +22,7 @@ typedef struct {
enum fxid { Fx_cos01=5, Fx_cos010, Fx_pow2, Fx_sqrt, Fx_gray0, Fx_halfsz0, enum fxid { Fx_cos01=5, Fx_cos010, Fx_pow2, Fx_sqrt, Fx_gray0, Fx_halfsz0,
Fx_rot90, Fx_cmixa, Fx_desat, Fx_ctr2x2, Fx_norm, Fx_rot90, Fx_cmixa, Fx_desat, Fx_ctr2x2, Fx_norm,
Fx_classtrial,
Fx_xper, Fx_binarize, Fx_trinarize,Fx_hilight_R }; Fx_xper, Fx_binarize, Fx_trinarize,Fx_hilight_R };
Fx fx_list[] = { Fx fx_list[] = {
@ -37,6 +38,7 @@ Fx fx_list[] = {
{ "desat", Fx_desat, 0, 1 }, { "desat", Fx_desat, 0, 1 },
{ "ctr2x2", Fx_ctr2x2, 0, 1 }, { "ctr2x2", Fx_ctr2x2, 0, 1 },
{ "norm", Fx_norm, 0, 1 }, { "norm", Fx_norm, 0, 1 },
{ "classtrial", Fx_classtrial, 0, 1 },
{ "binarize", Fx_binarize, 0, 1 }, { "binarize", Fx_binarize, 0, 1 },
{ "trinarize", Fx_trinarize, 0, 1 }, { "trinarize", Fx_trinarize, 0, 1 },
{ "hilightr", Fx_hilight_R, 0, 1 }, { "hilightr", Fx_hilight_R, 0, 1 },
@ -149,6 +151,7 @@ if (fx_list[fxidx].flags & 1) {
else { else {
fprintf(stderr, "%s: ???\n", __func__); /* XXX */ fprintf(stderr, "%s: ???\n", __func__); /* XXX */
memset(&dest, 0, sizeof(dest)); memset(&dest, 0, sizeof(dest));
return -888;
} }
action = fx_list[fxidx].id; action = fx_list[fxidx].id;
@ -182,6 +185,12 @@ switch (action) {
fprintf(stderr, "see 'fimghalfsize.c'. \n"); fprintf(stderr, "see 'fimghalfsize.c'. \n");
return -3; return -3;
case Fx_classtrial:
fprintf(stderr, "classif trial with %f fvalue\n",
global_fvalue);
foo = fimg_classif_trial(&src, &dest, global_fvalue, 0);
break;
case Fx_desat: case Fx_desat:
fimg_copy_data(&src, &dest); fimg_copy_data(&src, &dest);
foo = fimg_mix_rgb_gray(&dest, global_fvalue); foo = fimg_mix_rgb_gray(&dest, global_fvalue);