contour 2x2 -> fimgfx

This commit is contained in:
tth 2020-10-07 15:26:34 +02:00
parent 6a33b1d318
commit bbee507851
3 changed files with 22 additions and 11 deletions

View File

@ -1,14 +1,16 @@
#!/bin/bash
src=foo.fimg
maxi=179
grabopt=" s 320x240 -vv -p 0 -n 100 -c none "
maxi=49
grabopt=" -s 1280x720 -vv -p 0 -n 200 -c none "
mkdir V
for foo in $(seq 0 $maxi)
do
echo
grabvidseq -$grabopt -o $src
fval=$(echo "$foo / $maxi" | bc -l)
@ -16,11 +18,10 @@ do
echo $foo $fval
nom=$(printf "v_%03d.pnm" $foo)
nom=$(printf "V/%03d.pnm" $foo)
cp out.pnm $nom
echo $nom
done
convert -delay 20 v_*.pnm foo.gif
convert -delay 20 V/*.pnm foo.gif

View File

@ -27,7 +27,6 @@ function essai_cmixa
{
./mkfimg -vv -t tpat0 $TMPF 800 600
./fimgfx -vv cmixa $TMPF bar.fimg
}
# -----------------------------------------------------
function essai_cumulator
@ -42,7 +41,13 @@ D=" 800 600 "
hdeg.fimg pat0.fimg rand.fimg vdeg.fimg
}
# -----------------------------------------------------
function essai_contour
{
./mkfimg -vv -t tpat0 $TMPF 800 600
./fimgfx -vv ctr2x2 $TMPF bar.fimg
}
# -----------------------------------------------------
essai_cumulator
essai_contour
# -----------------------------------------------------

View File

@ -21,7 +21,7 @@ typedef struct {
} Fx;
enum fxid { Fx_cos01=5, Fx_cos010, Fx_pow2, Fx_sqrt, Fx_gray0, Fx_halfsz0,
Fx_rot90, Fx_cmixa, Fx_Desat,
Fx_rot90, Fx_cmixa, Fx_desat, Fx_ctr2x2,
Fx_xper };
Fx fx_list[] = {
@ -34,7 +34,8 @@ Fx fx_list[] = {
{ "rot90", Fx_rot90, 0, 0 },
{ "cmixa", Fx_cmixa, 0, 1 },
{ "xper", Fx_xper, 0, 1 },
{ "desat", Fx_Desat, 0, 1 },
{ "desat", Fx_desat, 0, 1 },
{ "ctr2x2", Fx_ctr2x2, 0, 1 },
{ NULL, 0, 0 }
};
@ -170,11 +171,15 @@ switch (action) {
fprintf(stderr, "halfsize was not implemented\n");
return -3;
case Fx_Desat:
case Fx_desat:
fimg_copy_data(&src, &dest);
foo = fimg_mix_rgb_gray(&dest, global_fvalue);
break;
case Fx_ctr2x2:
foo = fimg_contour_2x2(&src, &dest, 0);
break;
default:
fprintf(stderr, "%s %s : %d is bad action\n",
__FILE__, __func__, action);