Bibliothèque de traitements d'images en virgule flottante. http://la.buvette.org/photos/cumul/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

echomix.sh 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/bin/bash
  2. ###############################
  3. # ECHOMIX #
  4. ###############################
  5. SRCDIR="Fist"
  6. DSTDIR="Pong"
  7. FTMP="/dev/shm/tmp.fimg"
  8. FDST="/dev/shm/foo.fimg"
  9. # ------------------------------------------------------------
  10. # count the nomber of picz in the source directory
  11. #
  12. NBRE=$(ls -1 ${SRCDIR}/*.fimg | wc -l)
  13. # compute the echo picz offset
  14. #
  15. OFFS=$(( NBRE / 4 ))
  16. # ------------------------------------------------------------
  17. # MAIN LOOP
  18. for idx in $(seq 0 $NBRE)
  19. do
  20. # build the two input filenames ...
  21. #
  22. imgA=$(printf "$SRCDIR/%04d.fimg" $idx)
  23. vb=$(( $(( idx + OFFS )) % NBRE))
  24. imgB=$(printf "$SRCDIR/%04d.fimg" $vb)
  25. # ... and the output filename
  26. #
  27. dst=$(printf "%s/%05d.png" ${DSTDIR} $idx)
  28. printf " %20s %20s %8df %20s\n" $imgA $imgB $vb $dst
  29. # trying to autocompute the mixing coefficient
  30. #
  31. compute=" s(${idx} / 16) "
  32. K=$(echo $compute | bc -l)
  33. printf " %25s => %8.3f\n" "$compute" $K
  34. # do the hard floating computation
  35. #
  36. fimgfx -v cos010 ${imgB} ${FTMP}
  37. fimgops -k ${K} ${FTMP} ${imgA} mix ${FDST}
  38. # write the output as PNG for video encoding
  39. #
  40. fimg2png ${FDST} ${dst}
  41. done
  42. # ------------------------------------------------------------