|
|
|
@ -53,6 +53,9 @@ return 0; |
|
|
|
|
* This is the main filter engine |
|
|
|
|
* used both for input and output |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
#define DEBUG_THIS_CRAP 1 |
|
|
|
|
|
|
|
|
|
int crapulator(FloatImg *image, int idFx, float fval) |
|
|
|
|
{ |
|
|
|
|
int retval; |
|
|
|
@ -67,11 +70,13 @@ fprintf(stderr, ">>> %s ( %p %d %f )\n", __func__, |
|
|
|
|
|
|
|
|
|
retval = 0; |
|
|
|
|
|
|
|
|
|
#if DEBUG_THIS_CRAP |
|
|
|
|
if (666==count) { |
|
|
|
|
flag_debug = 1; |
|
|
|
|
fprintf(stderr, "DEBUG PT 1 in %s:%d\n", __func__, __LINE__); |
|
|
|
|
fimg_save_as_png(image, "crap_before.png", 0); |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
switch (idFx) { |
|
|
|
|
case 0: /* DO NOTHING */ |
|
|
|
@ -117,6 +122,9 @@ switch (idFx) { |
|
|
|
|
case 11: |
|
|
|
|
retval = trinarize(image, 0); |
|
|
|
|
break; |
|
|
|
|
case 24: /* experiment ! */ |
|
|
|
|
retval = des_bords_sombres_a(image, 260); |
|
|
|
|
break; |
|
|
|
|
case 25: |
|
|
|
|
/* please make this function more tweakable */ |
|
|
|
|
retval = vertical_singlitch(image, 290+rand()%35, |
|
|
|
@ -128,12 +136,15 @@ switch (idFx) { |
|
|
|
|
return -77; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#if DEBUG_THIS_CRAP |
|
|
|
|
if (flag_debug) { |
|
|
|
|
fprintf(stderr, "DEBUG PT 2 in %s:%d\n", __func__, __LINE__); |
|
|
|
|
fimg_save_as_png(image, "crap_after.png", 0); |
|
|
|
|
flag_debug = 0; |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
count++; flag_debug = 0; |
|
|
|
|
count++; |
|
|
|
|
|
|
|
|
|
return retval; |
|
|
|
|
} |
|
|
|
|