Compare commits

..

2 Commits

Author SHA1 Message Date
tTh
b707b784bf nice work done on Julia set 2023-01-03 01:22:40 +01:00
tTh
0e73e47272 renaming a non-working software 2023-01-03 01:19:39 +01:00
8 changed files with 146 additions and 16 deletions

View File

@ -1,7 +1,7 @@
mkjulia
pickover
lorentz
mklorentz
mkmandel
voxelize
evolvopick

View File

@ -1,6 +1,6 @@
all: voxelize evolvopick pickover mkjulia lorentz essai \
mkmandel
all: essai voxelize evolvopick pickover \
mkjulia mklorentz mkmandel
GFOPT = -Wall -Wextra -time -g -Imods/ -I../Modules
@ -53,7 +53,7 @@ evolvopick: evolvopick.f90 Makefile $(OBJDEP)
voxelize: voxelize.f90 Makefile $(OBJDEP)
gfortran $(GFOPT) $< $(OBJS) -o $@
lorentz: lorentz.f90 Makefile $(OBJDEP)
mklorentz: mklorentz.f90 Makefile $(OBJDEP)
gfortran $(GFOPT) $< $(OBJS) -o $@
mkmandel: mkmandel.f90 Makefile $(OBJDEP)
@ -61,8 +61,8 @@ mkmandel: mkmandel.f90 Makefile $(OBJDEP)
# ---------------------------------------------
lorentz.pgm: lorentz Makefile
./lorentz $@ > /dev/null
lorentz.pgm: mklorentz Makefile
./mklorentz $@ > /dev/null
pickover.pgm: pickover Makefile
./pickover $@ > /dev/null

View File

@ -12,13 +12,34 @@ SDIR="$1"
FNAME="$2"
echo "Encoding from " $SDIR " to " $FNAME
#
# trying to guess the format of inoput files
#
firstfile=$(ls -1 $SDIR/* | head -1)
echo "first file :" $firstfile
filetype=$(file $firstfile | awk '{ print $2 }')
echo "file type :" $filetype
#
# this is BOGUS, replace file by identify ?
#
case $filetype in
PNG) extension=".png" ;;
Netpbm) extension=".pgm" ;;
*) extension=".binary" ;;
esac
echo "extension :" $extension
TITLE='---{ experimental }---'
ffmpeg -nostdin \
-loglevel warning \
-y -r 25 -f image2 -i $SDIR/%05d.png \
-y -r 30 -f image2 -i $SDIR/%05d.pnm \
-metadata artist='---{ tTh }---' \
-metadata title="${TITLE}" \
-preset veryslow \
-c:v libx264 -pix_fmt yuv420p \
$FNAME

View File

@ -13,7 +13,7 @@ subroutine simple_julia(pic, cx, cy, maxiter)
integer, intent(in) :: maxiter
integer :: ix, iy, width, height
real :: fx, fy, fv
real :: fx, fy
complex :: Z, C
integer :: iter
logical :: over_iter
@ -49,4 +49,49 @@ subroutine simple_julia(pic, cx, cy, maxiter)
end subroutine simple_julia
!===============================================================
subroutine julia_colormapped(pic, cx, cy, maxiter)
use pixrgb
type(t_pixrgb), intent(inout), dimension (:,:) :: pic
real, intent(in) :: cx, cy
integer, intent(in) :: maxiter
integer :: ix, iy, width, height
real :: fx, fy
complex :: Z, C
integer :: iter
logical :: over_iter
width = ubound(pic, 1)
height = ubound(pic, 2)
C = complex(cx, cy)
print *, "Color julia, const = ", C
do ix = 1, width
fx = (float(ix) / (float(width*2)/4.0) - 1.0)
do iy = 1, height
fy = (float(iy) / (float(height*2)/4.0) - 1.0)
! ------ traitement du pixel
iter = 0 ; over_iter = .FALSE.
Z = complex(fx, fy)
do while ((real(Z)*real(Z) + imag(Z)*imag(Z)) .LT. 4.0)
Z = (Z * Z) + C
iter = iter + 1
if (iter .GE. maxiter) then
over_iter = .TRUE.
exit
endif
end do
if (over_iter) then
pic(ix, iy)%r = 0
pic(ix, iy)%g = mod(abs(int(real(Z) *140)), 255)
pic(ix, iy)%b = mod(abs(int(aimag(Z)*140)), 255)
else
pic(ix, iy)%r = mod(iter*33, 255)
pic(ix, iy)%g = mod(iter*29, 255)
pic(ix, iy)%b = mod(iter*21, 255)
endif
enddo ! iy
enddo ! ix
end subroutine
!===============================================================
end module

View File

@ -8,10 +8,11 @@ program julia
use spitpgm
use JULIAS
use PIXRGB
implicit none
integer, dimension(640, 480) :: picz
type(t_pixrgb), allocatable :: picz(:,:)
integer :: argc
character(200) :: filename, string
real :: cx, cy
@ -25,8 +26,10 @@ program julia
call getarg(2, string) ; read (string, *) cx
call getarg(3, string) ; read (string, *) cy
call simple_julia(picz, cx, cy, 3500)
call spit_as_pgm_8(picz, trim(filename))
allocate(picz(640, 480))
call julia_colormapped(picz, cx, cy, 500)
call rgbpix_spit_as_pnm_8(picz, trim(filename))
end program

View File

@ -14,20 +14,23 @@ fi
#
# run the prog
#
for foo in $(seq 0 99)
workdir="frames/julia/"
for foo in $(seq 0 179)
do
img=$(printf "frames/julia/%05d.pgm" $foo)
img=$(printf "%s/%05d.pnm" $workdir $foo)
bar=$(echo "$foo / 247.0" | bc -l)
cx=$(echo "0.7 * (2.72*c($foo/3))" | bc -l)
cy=$(echo "0.5 * (1.45+s($foo/2))" | bc -l)
cx=$(echo "0.5 * (1.52*c($foo/28.0))" | bc -l)
cy=$(echo "0.5 * (1.45*s($foo/17.0))" | bc -l)
./mkjulia $img $cx $cy
done
./tagpicz.sh $workdir
echo ; echo "Encoding, please wait..."
convert -delay 10 frames/julia/*.pgm foo.gif
convert -delay 10 $workdir/*.pnm color-julia.gif
# animate foo.gif &

31
Fraktalism/mklorentz.f90 Normal file
View File

@ -0,0 +1,31 @@
!
! this is the main programm
!
!-----------------------------------------------------
program lorentz
use spitpgm
use fraktals
implicit none
integer, dimension(800, 600) :: picz
integer :: argc
character(200) :: filename
argc = IARGC()
if (1 .NE. argc) then
STOP ": MKLORENTZ NEED A FILENAME !"
endif
call getarg(1, filename)
write (0, "(A)") "Mk Lorentz -> "//trim(filename)
call lorentz_0(picz, 50000)
call spit_as_pgm_8(picz, trim(filename))
end program
!-----------------------------------------------------

27
Fraktalism/tagpicz.sh Executable file
View File

@ -0,0 +1,27 @@
#!/bin/bash
#
# THIS IS JUST A QUICK'N'DIRTY HACK !
# DO NOT USE IT IN REAL LIFE !
#
set -e
SDIR="frames/spool/"
if [ $# -eq 1 ] ; then
SDIR="$1"
fi
for img in $SDIR/*.pnm
do
mogrify \
-gravity South-East \
-font Courier \
-pointsize 12 \
-fill Yellow \
-annotate +10+10 "tTh 2023" \
$img
echo "tagging " $img
done