From c6f10d642ad04e4ad673558dd7c5f554e8da5a1d Mon Sep 17 00:00:00 2001 From: tth Date: Tue, 23 Feb 2021 03:22:14 +0100 Subject: [PATCH] + diagonal filter --- .gitignore | 1 + Fonderie/crapulator.c | 17 ++++++++++++++++- Fonderie/crapulors.liste | 1 + Fonderie/essai.sh | 5 +++-- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index cb771632..5fba36f9 100644 --- a/.gitignore +++ b/.gitignore @@ -67,6 +67,7 @@ Fonderie/*.o Fonderie/*.png Fonderie/*.pnm Fonderie/*.gif +Fonderie/*.fimg Fonderie/fonderie Fonderie/interpolator Fonderie/t diff --git a/Fonderie/crapulator.c b/Fonderie/crapulator.c index 4485e69f..62fca29b 100644 --- a/Fonderie/crapulator.c +++ b/Fonderie/crapulator.c @@ -97,9 +97,19 @@ FimgFilter3x3 hipass = { 1.0, 0.0 }; +FimgFilter3x3 diagonal = { + { + 2.0, 1.0, 0.0, + 1.0, 0.0, -1.0, + 0.0, -1.0, -2.0, + }, + 1.0, 0.0 + }; + switch (typef) { case 0: pfiltre = &lowpass; break; case 1: pfiltre = &hipass; break; + case 2: pfiltre = &diagonal; break; default: fprintf(stderr, "%s: bad filter number %d\n", __func__, typef); @@ -114,7 +124,9 @@ if (retval) { fprintf(stderr, "%s error %d on filter\n", __func__, retval); exit(1); } -fimg_killborders(&img); /* XXX WTF OMG */ +/* + * may be, here, we can check for negative values ? */ +fimg_killborders(&img); fimg_copy_data(&img, pimg); fimg_destroy(&img); @@ -220,6 +232,9 @@ switch (idFx) { /* hipass filter */ retval = insitu_filtre3x3(image, 1); break; + case CR_diagonal: + retval = insitu_filtre3x3(image, 2); + break; case CR_octotree: retval = octotree_classif(image, 0.500, 0); break; diff --git a/Fonderie/crapulors.liste b/Fonderie/crapulors.liste index 05fd1f25..f1afc314 100644 --- a/Fonderie/crapulors.liste +++ b/Fonderie/crapulors.liste @@ -26,6 +26,7 @@ 27 shiftln0 1 1.0 28 qsortrgb 2 1.0 30 multidots 100 1.333 +31 diagonal 1 1.0 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 a3fe3d44..d8002263 100755 --- a/Fonderie/essai.sh +++ b/Fonderie/essai.sh @@ -9,7 +9,8 @@ FILTRES=$(./t -L | awk 'NR>1 { print $1 }' | sort) rm /tmp/fstack*.png -SRC=$(ls -rt1 $HOME/Essais/FondageDePlomb/capture/* | tail -1) +# SRC=$(ls -rt1 $HOME/Essais/FondageDePlomb/capture/* | tail -1) +SRC=mire.fimg for F in $FILTRES do @@ -53,6 +54,6 @@ ffmpeg -nostdin \ # ------------------------------------------------------------ # MAIN -essai_singlepass +essai_filtres # ------------------------------------------------------------