+ triplemul & little clean

This commit is contained in:
tth 2021-05-29 23:29:13 +02:00
parent 5a90dce59d
commit 49d2703612
4 changed files with 20 additions and 10 deletions

View File

@ -270,6 +270,10 @@ switch (idFx) {
retval = fimg_power_2(image, image, 1000.0); retval = fimg_power_2(image, image, 1000.0);
break; break;
case CR_triplemul:
retval = fimg_sfx_triplemul(image, image, 0);
break;
/* here are the glitches */ /* here are the glitches */
case CR_bsombra: /* experiment ! */ case CR_bsombra: /* experiment ! */
retval = des_bords_sombres_a(image, 160); retval = des_bords_sombres_a(image, 160);

View File

@ -4,7 +4,7 @@
* http://la.buvette.org/photos/cumul * http://la.buvette.org/photos/cumul
*/ */
#define FIMG_VERSION 151 #define FIMG_VERSION 152
/* /*
* in memory descriptor * in memory descriptor
@ -123,6 +123,9 @@ int fimg_highlight_color(FloatImg *src, FloatImg *dst,
int fimg_binarize(FloatImg *pimg, int notused); int fimg_binarize(FloatImg *pimg, int notused);
int fimg_trinarize(FloatImg *pimg, int notused); int fimg_trinarize(FloatImg *pimg, int notused);
/* module sfx3.c */
/* module sfx4.c */ /* module sfx4.c */
int fimg_sfx_triplemul(FloatImg *s, FloatImg *d, int notused); int fimg_sfx_triplemul(FloatImg *s, FloatImg *d, int notused);

View File

@ -27,11 +27,13 @@ fprintf(stderr, ">>> %s ( %p 0x%04x )\n", __func__, img, notused);
for (y=0; y<src->height; y++) { for (y=0; y<src->height; y++) {
for (x=0; x<src->width; x++) { for (x=0; x<src->width; x++) {
foo = fimg_get_rgb(src, x, y, in); foo = fimg_get_rgb(src, x, y, in);
if (foo) return foo;
out[0] = in[1] * in[2]; out[0] = in[1] * in[2];
out[1] = in[0] * in[2]; out[1] = in[0] * in[2];
out[2] = in[0] * in[1]; out[2] = in[0] * in[1];
// fprintf(stderr, "%9f %9f %9f\n", out[0], out[1], out[2]); // fprintf(stderr, "%9f %9f %9f\n", out[0], out[1], out[2]);
foo = fimg_put_rgb(dst, x, y, out); foo = fimg_put_rgb(dst, x, y, out);
if (foo) return foo;
} }
} }

View File

@ -199,37 +199,38 @@ switch (action) {
fprintf(stderr, "classif trial with %f fvalue\n", fprintf(stderr, "classif trial with %f fvalue\n",
global_fvalue); global_fvalue);
foo = fimg_classif_trial(&src, &dest, global_fvalue, 0); foo = fimg_classif_trial(&src, &dest, global_fvalue, 0);
break; 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);
break; break;
case Fx_mirror: case Fx_mirror:
foo = fimg_mirror(&src, &dest, 0); foo = fimg_mirror(&src, &dest, 0);
break; break;
case Fx_shift0: case Fx_shift0:
// fprintf(stderr, "Krkrk %d\n", action); // fprintf(stderr, "Krkrk %d\n", action);
foo = fimg_auto_shift_to_zero(&src, &dest); foo = fimg_auto_shift_to_zero(&src, &dest);
break; break;
case Fx_trimul: case Fx_trimul:
fprintf(stderr, "trimul %d\n", action); fprintf(stderr, "trimul %d\n", action);
foo = fimg_sfx_triplemul(&src, &dest, 0); foo = fimg_sfx_triplemul(&src, &dest, 0);
break; break;
case Fx_ctr2x2: case Fx_ctr2x2:
foo = fimg_contour_2x2(&src, &dest, 0); foo = fimg_contour_2x2(&src, &dest, 0);
break; break;
case Fx_binarize: case Fx_binarize:
fimg_copy_data(&src, &dest); fimg_copy_data(&src, &dest);
foo = fimg_binarize(&dest, 0); foo = fimg_binarize(&dest, 0);
break; break;
case Fx_trinarize: case Fx_trinarize:
fimg_copy_data(&src, &dest); fimg_copy_data(&src, &dest);
foo = fimg_trinarize(&dest, 0); foo = fimg_trinarize(&dest, 0);
break; break;
case Fx_hilight_R: case Fx_hilight_R:
foo = fimg_highlight_color(&src, &dest, 'R', 1.333); foo = fimg_highlight_color(&src, &dest, 'R', 1.333);
break; break;
default: default:
fprintf(stderr, "%s %s : %d is bad action\n", fprintf(stderr, "%s %s : %d is bad action\n",
__FILE__, __func__, action); __FILE__, __func__, action);