From 3778e75399a10509c4b29900d5bb11b82a0ac7b1 Mon Sep 17 00:00:00 2001 From: tonton th Date: Sat, 16 Jan 2021 11:29:40 +0100 Subject: [PATCH] + multidots glitcher --- Fonderie/crapulator.c | 7 ++++--- Fonderie/crapulors.liste | 3 ++- Fonderie/essai.sh | 4 ++-- Fonderie/glitches.c | 45 +++++++++++++++++++++++++++++++++------- Fonderie/glitches.h | 1 + Fonderie/interpolator.c | 4 ++-- Fonderie/t.c | 2 +- 7 files changed, 50 insertions(+), 16 deletions(-) diff --git a/Fonderie/crapulator.c b/Fonderie/crapulator.c index 28d525fc..156fc235 100644 --- a/Fonderie/crapulator.c +++ b/Fonderie/crapulator.c @@ -97,7 +97,6 @@ FimgFilter3x3 hipass = { 1.0, 0.0 }; - switch (typef) { case 0: pfiltre = &lowpass; break; case 1: pfiltre = &hipass; break; @@ -248,11 +247,13 @@ switch (idFx) { break; case CR_qsortrgb: - // fprintf(stderr, "!!! %d !!!\n", idFx); - // retval = fimg_qsort_rgb_b(image, image, 0); retval = trier_les_pixels(image); break; + case CR_multidots: + retval = plot_multidots(image, 42); + break; + case CR_message: fprintf(stderr, "### msg from pid %d, fval=%f ###\n", getpid(), fval); diff --git a/Fonderie/crapulors.liste b/Fonderie/crapulors.liste index fdcf635c..05fd1f25 100644 --- a/Fonderie/crapulors.liste +++ b/Fonderie/crapulors.liste @@ -25,6 +25,7 @@ 26 rndblks 1 1.0 27 shiftln0 1 1.0 28 qsortrgb 2 1.0 -42 nothing 42 3.14159 +30 multidots 100 1.333 +42 nothing 42 3.1415926 99 message 1 1.0 -1 end 1 1.0 diff --git a/Fonderie/essai.sh b/Fonderie/essai.sh index a4081ed2..a3fe3d44 100755 --- a/Fonderie/essai.sh +++ b/Fonderie/essai.sh @@ -31,8 +31,8 @@ convert -delay 200 /tmp/fstack*.png foo.gif essai_singlepass () { MP4="/home/tth/Essais/FondageDePlomb/foo.mp4" -INPUT="/home/tth/Essais/FondageDePlomb/capture/00???.fimg" -FILTRE="trinitron" +INPUT="/home/tth/Essais/FondageDePlomb/capture/02[0123]??.fimg" +FILTRE="multidots:liss3x3:liss3x3" OUTDIR="/tmp/x8/" echo '********* essai single *********' diff --git a/Fonderie/glitches.c b/Fonderie/glitches.c index 5e3e971d..9666c42c 100644 --- a/Fonderie/glitches.c +++ b/Fonderie/glitches.c @@ -120,6 +120,24 @@ for (y=0; y<8; y++) { return 0; } /* -------------------------------------------------------------- */ +int plot_multidots(FloatImg *picture, int notused) +{ +int pass, szimg, osrc, odst; + +szimg = picture->width * picture->height; + +for (pass=0; passR[odst] = (picture->R[osrc] + picture->R[odst]) / 2.0; + picture->G[odst] = (picture->G[osrc] + picture->G[odst]) / 2.0; + picture->B[odst] = (picture->B[osrc] + picture->B[odst]) / 2.0; + + } + +return 0; +} int random_blocks(FloatImg *picture, int percent) { int x, y; @@ -212,16 +230,26 @@ for (y=BB; yR + (ypos * picz->width); shifter(sptr, buffline, step, picz->width); - memcpy(sptr, buffline, picz->width*sizeof(float)); + smooth_line(buffline, sptr, picz->width); + // XXX memcpy (sptr, buffline, picz->width*sizeof(float)); sptr = picz->G + (ypos * picz->width); shifter(sptr, buffline, step, picz->width); - memcpy(sptr, buffline, picz->width*sizeof(float)); + smooth_line(buffline, sptr, picz->width); + // XXX memcpy (sptr, buffline, picz->width*sizeof(float)); sptr = picz->B + (ypos * picz->width); shifter(sptr, buffline, step, picz->width); - memcpy(sptr, buffline, picz->width*sizeof(float)); + smooth_line(buffline, sptr, picz->width); + // XXX memcpy (sptr, buffline, picz->width*sizeof(float)); } return 0; diff --git a/Fonderie/glitches.h b/Fonderie/glitches.h index deb12959..b46b83ff 100644 --- a/Fonderie/glitches.h +++ b/Fonderie/glitches.h @@ -3,6 +3,7 @@ */ int do_something(FloatImg *pimg, int notused); +int plot_multidots(FloatImg *picture, int notused); int kill_a_random_line(FloatImg *pvictime, float level, int bits); int kill_a_few_lines(FloatImg *who, float fval, int number); diff --git a/Fonderie/interpolator.c b/Fonderie/interpolator.c index 4a3c5da4..eb2eef22 100644 --- a/Fonderie/interpolator.c +++ b/Fonderie/interpolator.c @@ -89,7 +89,7 @@ for (idx=0; idx