+ 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);
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);

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);

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;
}
}

View File

@ -230,6 +230,7 @@ switch (action) {
case Fx_hilight_R:
foo = fimg_highlight_color(&src, &dest, 'R', 1.333);
break;
default:
fprintf(stderr, "%s %s : %d is bad action\n",
__FILE__, __func__, action);