Browse Source

+ triplemul & little clean

master
tth 5 months ago
parent
commit
49d2703612
4 changed files with 20 additions and 10 deletions
  1. +4
    -0
      Fonderie/crapulator.c
  2. +4
    -1
      floatimg.h
  3. +2
    -0
      funcs/sfx4.c
  4. +10
    -9
      tools/fimgfx.c

+ 4
- 0
Fonderie/crapulator.c View File

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


+ 4
- 1
floatimg.h View File

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


+ 2
- 0
funcs/sfx4.c View File

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


+ 10
- 9
tools/fimgfx.c View File

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


Loading…
Cancel
Save