diff --git a/Fonderie/craplist2h.awk b/Fonderie/craplist2h.awk index 89d07db..bd6c8ec 100755 --- a/Fonderie/craplist2h.awk +++ b/Fonderie/craplist2h.awk @@ -11,6 +11,9 @@ BEGIN { print "// -----------------------------------" } +# $1 is the badly brain-designed numeric id +# $2 is the user name of the filter + { printf "#define CR_%s (%d)\n", $2, $1 } diff --git a/Fonderie/craplist2str.awk b/Fonderie/craplist2str.awk index 9a431e9..47f73e9 100755 --- a/Fonderie/craplist2str.awk +++ b/Fonderie/craplist2str.awk @@ -11,6 +11,10 @@ BEGIN { print "Crapulor CrapL[] = {"; } +# $1 is the badly brain-designed numeric id +# $2 is the user name of the filter +# $3 and $4 are two not used parameters +# { printf " { CR_%s, \"%s\", %d, %f }, // id=%d\n", $2, $2, $3, $4, $1; diff --git a/Fonderie/crapulator.c b/Fonderie/crapulator.c index a4dcd5e..3f8890f 100644 --- a/Fonderie/crapulator.c +++ b/Fonderie/crapulator.c @@ -157,7 +157,7 @@ return retval; * processor. */ -#define DEBUG_THIS_CRAP 100 +#define DEBUG_THIS_CRAP 0 int crapulator(FloatImg *image, int idFx, float fval) { @@ -273,6 +273,9 @@ switch (idFx) { case CR_bsombra: /* experiment ! */ retval = des_bords_sombres_a(image, 160); break; + case CR_bsombrb: /* experiment ! */ + retval = des_bords_sombres_b(image, 160); + break; case CR_vsglitch: /* please make this function more tweakable */ retval = vertical_singlitch(image, 290+rand()%45, diff --git a/Fonderie/crapulors.liste b/Fonderie/crapulors.liste index 7d3054a..3973cd3 100644 --- a/Fonderie/crapulors.liste +++ b/Fonderie/crapulors.liste @@ -23,12 +23,13 @@ 22 sqrt 1 0.0 23 pow2 1 0.0 24 bsombra 1 1.0 -25 vsglitch 1 1.0 +25 bsombrb 1 1.0 26 rndblks 1 1.0 27 shiftln0 1 1.0 28 qsortrgb 2 1.0 30 multidots 100 1.333 31 diagonal 1 1.0 +32 vsglitch 1 1.0 42 nothing 42 3.1415926 45 hilightr 1 1.717 99 message 1 1.0 diff --git a/Fonderie/fonderie.c b/Fonderie/fonderie.c index 74c8e96..29f83e2 100644 --- a/Fonderie/fonderie.c +++ b/Fonderie/fonderie.c @@ -249,7 +249,7 @@ if (foo) { exit(1); } -if (verbosity) { +if (verbosity > 1) { filterstack_list(0, "input"); filterstack_list(1, "ouput"); fprintf(stderr, ".\n"); diff --git a/Fonderie/glitches.c b/Fonderie/glitches.c index 3762afc..ebe468a 100644 --- a/Fonderie/glitches.c +++ b/Fonderie/glitches.c @@ -16,6 +16,24 @@ extern int verbosity; +/* -------------------------------------------------------------- */ +/* 10 mai 2021 a Terre Blanque */ +int microglitch(FloatImg *pimg, int notused) +{ +int surface; +int offset, idx; + +surface = pimg->width * pimg->height; + +for (idx=0; idx<10000; idx++) { + offset = rand() % surface; + pimg->R[offset] *= 0.8; + pimg->G[offset] *= 0.8; + pimg->B[offset] *= 0.8; + } + +return 0; +} /* -------------------------------------------------------------- */ /* nouveau du 32 decembre 2020, endless september */ int do_something(FloatImg *pimg, int notused) diff --git a/Fonderie/glitches.h b/Fonderie/glitches.h index b46b83f..84ad980 100644 --- a/Fonderie/glitches.h +++ b/Fonderie/glitches.h @@ -2,6 +2,8 @@ * glitches.h */ +int microglitch(FloatImg *pimg, int notused); + int do_something(FloatImg *pimg, int notused); int plot_multidots(FloatImg *picture, int notused); diff --git a/Fonderie/sfx.c b/Fonderie/sfx.c index f987cb1..fb05296 100644 --- a/Fonderie/sfx.c +++ b/Fonderie/sfx.c @@ -287,7 +287,7 @@ fprintf(stderr, ">>> %s ( %p %d )\n", __func__, pimg, offset); #endif if (offset<0 || offset>=pimg->width) { - fprintf(stderr, "%s offset %d is bad\n", __func__, offset); + fprintf(stderr, "%s: offset %d is bad\n", __func__, offset); return -66; } @@ -309,6 +309,23 @@ for (y=0; yheight; y++) { return 0; } /* -------------------------------------------------------------- */ +/* nouveau Mon 10 May 2021 08:46:02 PM CEST + * chez Eric 1KA */ +int des_bords_sombres_b(FloatImg *pimg, int offset) +{ + +#if DEBUG_LEVEL +fprintf(stderr, ">>> %s ( %p %d )\n", __func__, pimg, offset); +#endif + +if (offset<0 || offset>=pimg->width) { + fprintf(stderr, "%s: offset %d is bad\n", __func__, offset); + return -66; + } + +return -1; +} +/* -------------------------------------------------------------- */ /* * int binarize(FloatImg *pimg, int notused) was now in * funcs/sfx2.c diff --git a/Fonderie/sfx.h b/Fonderie/sfx.h index 1aa734e..1463f87 100644 --- a/Fonderie/sfx.h +++ b/Fonderie/sfx.h @@ -15,6 +15,7 @@ int mirror_split(FloatImg *pimg, int kaboo); int upside_down(FloatImg *pimg); int des_bords_sombres_a(FloatImg *pimg, int offset); +int des_bords_sombres_b(FloatImg *pimg, int offset); int brotche_rand48_a(FloatImg *fimg, float ratio, float mval); int brotche_rand48_b(FloatImg *fimg, float ratio, float mval); diff --git a/Fonderie/singlepass.c b/Fonderie/singlepass.c index 7c64b8f..b8791a0 100644 --- a/Fonderie/singlepass.c +++ b/Fonderie/singlepass.c @@ -15,6 +15,7 @@ #include "crapulator.h" #include "filterstack.h" #include "single.h" +#include "glitches.h" /* ----------------------------------------------------------- */ @@ -23,11 +24,11 @@ int verbosity; /* ----------------------------------------------------------- */ -int run_the_singlepass(char *globber, char *destdir, +int run_the_singlepass(char *globber, char *destdir, int duplic, int fchain, int outfmt) { FloatImg image = { 0 }; -int idx, foo; +int idx, foo, loop; glob_t globbuf; char *fname; double elapsed; @@ -98,10 +99,17 @@ for (idx=0; idx %d\n", foo); return 0;