+ 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/*.png
Fonderie/*.pnm Fonderie/*.pnm
Fonderie/*.gif Fonderie/*.gif
Fonderie/*.fimg
Fonderie/fonderie Fonderie/fonderie
Fonderie/interpolator Fonderie/interpolator
Fonderie/t Fonderie/t

View File

@ -97,9 +97,19 @@ FimgFilter3x3 hipass = {
1.0, 0.0 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) { switch (typef) {
case 0: pfiltre = &lowpass; break; case 0: pfiltre = &lowpass; break;
case 1: pfiltre = &hipass; break; case 1: pfiltre = &hipass; break;
case 2: pfiltre = &diagonal; break;
default: default:
fprintf(stderr, "%s: bad filter number %d\n", fprintf(stderr, "%s: bad filter number %d\n",
__func__, typef); __func__, typef);
@ -114,7 +124,9 @@ if (retval) {
fprintf(stderr, "%s error %d on filter\n", __func__, retval); fprintf(stderr, "%s error %d on filter\n", __func__, retval);
exit(1); 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_copy_data(&img, pimg);
fimg_destroy(&img); fimg_destroy(&img);
@ -220,6 +232,9 @@ switch (idFx) {
/* hipass filter */ /* hipass filter */
retval = insitu_filtre3x3(image, 1); retval = insitu_filtre3x3(image, 1);
break; break;
case CR_diagonal:
retval = insitu_filtre3x3(image, 2);
break;
case CR_octotree: case CR_octotree:
retval = octotree_classif(image, 0.500, 0); retval = octotree_classif(image, 0.500, 0);
break; break;

View File

@ -26,6 +26,7 @@
27 shiftln0 1 1.0 27 shiftln0 1 1.0
28 qsortrgb 2 1.0 28 qsortrgb 2 1.0
30 multidots 100 1.333 30 multidots 100 1.333
31 diagonal 1 1.0
42 nothing 42 3.1415926 42 nothing 42 3.1415926
99 message 1 1.0 99 message 1 1.0
-1 end 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 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 for F in $FILTRES
do do
@ -53,6 +54,6 @@ ffmpeg -nostdin \
# ------------------------------------------------------------ # ------------------------------------------------------------
# MAIN # MAIN
essai_singlepass essai_filtres
# ------------------------------------------------------------ # ------------------------------------------------------------