+ diagonal filter

This commit is contained in:
tth 2021-02-23 03:22:14 +01:00
parent 3fce2b19c5
commit c6f10d642a
4 changed files with 21 additions and 3 deletions

1
.gitignore vendored
View File

@ -67,6 +67,7 @@ Fonderie/*.o
Fonderie/*.png
Fonderie/*.pnm
Fonderie/*.gif
Fonderie/*.fimg
Fonderie/fonderie
Fonderie/interpolator
Fonderie/t

View File

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

View File

@ -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

View File

@ -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
# ------------------------------------------------------------