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 #!/bin/bash
src=foo.fimg src=foo.fimg
maxi=179 maxi=49
grabopt=" s 320x240 -vv -p 0 -n 100 -c none " grabopt=" -s 1280x720 -vv -p 0 -n 200 -c none "
mkdir V
for foo in $(seq 0 $maxi) for foo in $(seq 0 $maxi)
do do
echo
grabvidseq -$grabopt -o $src grabvidseq -$grabopt -o $src
fval=$(echo "$foo / $maxi" | bc -l) fval=$(echo "$foo / $maxi" | bc -l)
@ -16,11 +18,10 @@ do
echo $foo $fval echo $foo $fval
nom=$(printf "v_%03d.pnm" $foo) nom=$(printf "V/%03d.pnm" $foo)
cp out.pnm $nom cp out.pnm $nom
echo $nom echo $nom
done 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 ./mkfimg -vv -t tpat0 $TMPF 800 600
./fimgfx -vv cmixa $TMPF bar.fimg ./fimgfx -vv cmixa $TMPF bar.fimg
} }
# ----------------------------------------------------- # -----------------------------------------------------
function essai_cumulator function essai_cumulator
@ -42,7 +41,13 @@ D=" 800 600 "
hdeg.fimg pat0.fimg rand.fimg vdeg.fimg 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; } Fx;
enum fxid { Fx_cos01=5, Fx_cos010, Fx_pow2, Fx_sqrt, Fx_gray0, Fx_halfsz0, 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_xper };
Fx fx_list[] = { Fx fx_list[] = {
@ -34,7 +34,8 @@ Fx fx_list[] = {
{ "rot90", Fx_rot90, 0, 0 }, { "rot90", Fx_rot90, 0, 0 },
{ "cmixa", Fx_cmixa, 0, 1 }, { "cmixa", Fx_cmixa, 0, 1 },
{ "xper", Fx_xper, 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 } { NULL, 0, 0 }
}; };
@ -170,11 +171,15 @@ switch (action) {
fprintf(stderr, "halfsize was not implemented\n"); fprintf(stderr, "halfsize was not implemented\n");
return -3; return -3;
case Fx_Desat: case Fx_desat:
fimg_copy_data(&src, &dest); fimg_copy_data(&src, &dest);
foo = fimg_mix_rgb_gray(&dest, global_fvalue); foo = fimg_mix_rgb_gray(&dest, global_fvalue);
break; break;
case Fx_ctr2x2:
foo = fimg_contour_2x2(&src, &dest, 0);
break;
default: default:
fprintf(stderr, "%s %s : %d is bad action\n", fprintf(stderr, "%s %s : %d is bad action\n",
__FILE__, __func__, action); __FILE__, __func__, action);