Compare commits
No commits in common. "920a864b227a31bcbc4c07ec8c441b6b1de90a2e" and "f8d5e66a5cdd60f065e007e0efed735437c409a6" have entirely different histories.
920a864b22
...
f8d5e66a5c
@ -22,7 +22,6 @@ trigofest: trigofest.f90 Makefile vue3axes.o utils_ga.o
|
|||||||
|
|
||||||
noisepic: noisepic.f90 Makefile
|
noisepic: noisepic.f90 Makefile
|
||||||
gfortran $(GFOPT) $< ../Modules/spitpgm.o ../Modules/pixrgb.o \
|
gfortran $(GFOPT) $< ../Modules/spitpgm.o ../Modules/pixrgb.o \
|
||||||
../Modules/noisepictures.o \
|
|
||||||
-o $@
|
-o $@
|
||||||
|
|
||||||
# ---- modules locaux
|
# ---- modules locaux
|
||||||
|
@ -2,7 +2,6 @@ program noisepic
|
|||||||
|
|
||||||
use spitpgm
|
use spitpgm
|
||||||
use pixrgb
|
use pixrgb
|
||||||
use noisepictures
|
|
||||||
implicit none
|
implicit none
|
||||||
|
|
||||||
integer :: numframe = 0
|
integer :: numframe = 0
|
||||||
@ -18,11 +17,11 @@ program noisepic
|
|||||||
read (arg, *) numframe
|
read (arg, *) numframe
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ranges(1) = 10 ; ranges(2) = 90
|
ranges(0) = 10 ; ranges(2) = 90
|
||||||
ranges(3) = 110 ; ranges(4) = 166
|
ranges(3) = 110 ; ranges(4) = 166
|
||||||
ranges(5) = 205 ; ranges(6) = 230
|
ranges(5) = 205 ; ranges(6) = 230
|
||||||
nbre = 1000+(numframe*555)
|
nbre = 1000+(numframe*555)
|
||||||
call make_noise_bw_pic (numframe)
|
call make_noise_color_range_pic(numframe, ranges, nbre)
|
||||||
|
|
||||||
contains
|
contains
|
||||||
!-- ------------------------------------------------------------------
|
!-- ------------------------------------------------------------------
|
||||||
@ -45,13 +44,33 @@ subroutine make_noise_bw_pic (value)
|
|||||||
foo = irand()
|
foo = irand()
|
||||||
print *, 'val=', value, ' rnd=', foo
|
print *, 'val=', value, ' rnd=', foo
|
||||||
|
|
||||||
! call plot_noise_bw_pic(pic, 15000)
|
call plot_noise_bw_pic(pic, 15000)
|
||||||
call noise_gray8_pic(pic, 15000)
|
|
||||||
|
|
||||||
write (filename, "(a, i5.5, a)") "", value, ".pgm"
|
write (filename, "(a, i5.5, a)") "", value, ".pgm"
|
||||||
call spit_as_pgm_8(pic, trim(filename))
|
call spit_as_pgm_8(pic, trim(filename))
|
||||||
end subroutine
|
end subroutine
|
||||||
!-- ------------------------------------------------------------------
|
!-- ------------------------------------------------------------------
|
||||||
|
subroutine plot_noise_bw_pic(picz, nbre)
|
||||||
|
implicit none
|
||||||
|
|
||||||
|
integer, dimension(:,:), intent(inout) :: picz
|
||||||
|
integer, intent(in) :: nbre
|
||||||
|
|
||||||
|
integer :: width, height
|
||||||
|
integer :: quux, ix, iy, iv
|
||||||
|
|
||||||
|
width = ubound(picz, 1) ; height = ubound(picz, 2)
|
||||||
|
! print *, 'sz picz', width, height
|
||||||
|
|
||||||
|
do quux=1, nbre
|
||||||
|
ix = 1 + mod ( irand(), width )
|
||||||
|
iy = 1 + mod ( irand(), height )
|
||||||
|
iv = mod ( irand(), 256 )
|
||||||
|
! print *, ix, iy
|
||||||
|
picz(ix, iy) = iv
|
||||||
|
enddo
|
||||||
|
end subroutine
|
||||||
|
|
||||||
!-- ------------------------------------------------------------------
|
!-- ------------------------------------------------------------------
|
||||||
!-
|
!-
|
||||||
!- Colorized
|
!- Colorized
|
||||||
|
@ -28,30 +28,17 @@ trials.o: trials.f90 Makefile
|
|||||||
mathstuff2.o: mathstuff2.f90 Makefile
|
mathstuff2.o: mathstuff2.f90 Makefile
|
||||||
gfortran $(GFOPT) -c $<
|
gfortran $(GFOPT) -c $<
|
||||||
|
|
||||||
noisepictures.o: noisepictures.f90 Makefile
|
|
||||||
gfortran $(GFOPT) -c $<
|
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# making a fluffy archive
|
|
||||||
#
|
|
||||||
OBJECTS = spitpgm.o pixrgb.o \
|
|
||||||
centermag.o dummy.o \
|
|
||||||
trials.o mathstuff2.o \
|
|
||||||
noisepictures.o
|
|
||||||
|
|
||||||
libtth90modules.a: $(OBJECTS) Makefile
|
|
||||||
$(AR) rs $@ $?
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# programmes de testouille
|
# programmes de testouille
|
||||||
#
|
#
|
||||||
|
OBJS = trials.o spitpgm.o pixrgb.o centermag.o dummy.o \
|
||||||
|
mathstuff2.o
|
||||||
|
|
||||||
chkpixels: chkpixels.f90 Makefile libtth90modules.a
|
chkpixels: chkpixels.f90 Makefile $(OBJS)
|
||||||
gfortran $(GFOPT) $< libtth90modules.a -o $@
|
gfortran $(GFOPT) $< $(OBJS) -o $@
|
||||||
|
|
||||||
t: t.f90 Makefile libtth90modules.a
|
t: t.f90 Makefile $(OBJS)
|
||||||
gfortran $(GFOPT) $< libtth90modules.a -o $@
|
gfortran $(GFOPT) $< $(OBJS) -o $@
|
||||||
|
|
||||||
trnd: trnd.f90 Makefile libtth90modules.a
|
trnd: trnd.f90 Makefile $(OBJS)
|
||||||
gfortran $(GFOPT) $< libtth90modules.a -o $@
|
gfortran $(GFOPT) $< $(OBJS) -o $@
|
||||||
|
@ -22,7 +22,7 @@ module mathstuff2
|
|||||||
|
|
||||||
! after initializing the random generator engine,
|
! after initializing the random generator engine,
|
||||||
! you MUST use it for initializing the initializer
|
! you MUST use it for initializing the initializer
|
||||||
do foo=1, tarray(1)+15
|
do foo=1, tarray(1)+5
|
||||||
dummy = rand()
|
dummy = rand()
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
|
@ -1,80 +0,0 @@
|
|||||||
module noisepictures
|
|
||||||
use pixrgb
|
|
||||||
implicit none
|
|
||||||
|
|
||||||
contains ! a lot of garbage ?
|
|
||||||
|
|
||||||
!-----------------------------------------------------------------------
|
|
||||||
subroutine noise_gray8_pic(pict, nbre)
|
|
||||||
implicit none
|
|
||||||
integer, dimension(:,:), intent(inout) :: pict
|
|
||||||
integer, intent(in) :: nbre
|
|
||||||
integer :: quux, ix, iy, width, height
|
|
||||||
|
|
||||||
width = ubound(pict, 1) ; height = ubound(pict, 2)
|
|
||||||
|
|
||||||
do quux=1, nbre
|
|
||||||
ix = 1 + mod ( irand(), width )
|
|
||||||
iy = 1 + mod ( irand(), height )
|
|
||||||
pict(ix, iy) = mod ( irand(), 256 )
|
|
||||||
enddo
|
|
||||||
|
|
||||||
end subroutine
|
|
||||||
!-----------------------------------------------------------------------
|
|
||||||
subroutine noise_gray16_pic(pict, nbre)
|
|
||||||
implicit none
|
|
||||||
integer, dimension(:,:), intent(inout) :: pict
|
|
||||||
integer, intent(in) :: nbre
|
|
||||||
integer :: quux, ix, iy, width, height
|
|
||||||
|
|
||||||
width = ubound(pict, 1) ; height = ubound(pict, 2)
|
|
||||||
|
|
||||||
do quux=1, nbre
|
|
||||||
ix = 1 + mod ( irand(), width )
|
|
||||||
iy = 1 + mod ( irand(), height )
|
|
||||||
pict(ix, iy) = mod ( irand(), 65536 )
|
|
||||||
enddo
|
|
||||||
|
|
||||||
end subroutine
|
|
||||||
!-----------------------------------------------------------------------
|
|
||||||
subroutine noise_rgb8_pic(prgb, nbre)
|
|
||||||
implicit none
|
|
||||||
type(t_pixrgb), dimension(:,:), intent(inout) :: prgb
|
|
||||||
integer, intent(in) :: nbre
|
|
||||||
integer :: quux, ix, iy, width, height
|
|
||||||
|
|
||||||
print *, 'noise_rgb_pic', nbre
|
|
||||||
|
|
||||||
width = ubound(prgb, 1) ; height = ubound(prgb, 2)
|
|
||||||
|
|
||||||
do quux=1, nbre
|
|
||||||
ix = 1 + mod ( irand(), width )
|
|
||||||
iy = 1 + mod ( irand(), height )
|
|
||||||
prgb(ix, iy)%r = mod ( irand(), 256 )
|
|
||||||
prgb(ix, iy)%g = mod ( irand(), 256 )
|
|
||||||
prgb(ix, iy)%b = mod ( irand(), 256 )
|
|
||||||
enddo
|
|
||||||
|
|
||||||
end subroutine
|
|
||||||
!-----------------------------------------------------------------------
|
|
||||||
subroutine noise_rgb16_pic(prgb, nbre)
|
|
||||||
implicit none
|
|
||||||
type(t_pixrgb), dimension(:,:), intent(inout) :: prgb
|
|
||||||
integer, intent(in) :: nbre
|
|
||||||
integer :: quux, ix, iy, width, height
|
|
||||||
|
|
||||||
print *, 'noise_rgb_pic', nbre
|
|
||||||
|
|
||||||
width = ubound(prgb, 1) ; height = ubound(prgb, 2)
|
|
||||||
|
|
||||||
do quux=1, nbre
|
|
||||||
ix = 1 + mod ( irand(), width )
|
|
||||||
iy = 1 + mod ( irand(), height )
|
|
||||||
prgb(ix, iy)%r = mod ( irand(), 65536 )
|
|
||||||
prgb(ix, iy)%g = mod ( irand(), 65536 )
|
|
||||||
prgb(ix, iy)%b = mod ( irand(), 65536 )
|
|
||||||
enddo
|
|
||||||
|
|
||||||
end subroutine
|
|
||||||
!-----------------------------------------------------------------------
|
|
||||||
end module noisepictures
|
|
@ -1,66 +1,21 @@
|
|||||||
program essai
|
program essai
|
||||||
|
|
||||||
use mathstuff2
|
use mathstuff2
|
||||||
use pixrgb
|
|
||||||
use spitpgm
|
|
||||||
use noisepictures
|
|
||||||
implicit none
|
implicit none
|
||||||
|
|
||||||
integer :: foo, bar
|
integer :: foo, bar
|
||||||
|
real :: quux
|
||||||
|
double precision :: somme
|
||||||
|
|
||||||
write(0, *) "----------------- essai -------------------"
|
write(0, *) "----------------- essai -------------------"
|
||||||
|
|
||||||
call init_random_seed() ! in module 'mathstuff'
|
call init_random_seed() ! in module 'mathstuff'
|
||||||
call test_noisepictures_rgb()
|
somme = 0.0
|
||||||
call test_noisepictures_gray()
|
do foo=1, 500
|
||||||
|
quux = rand() + rand()
|
||||||
contains
|
somme = somme + quux
|
||||||
!-----------------------------------------------------------------------
|
bar = mod(irand(), 7)
|
||||||
|
print *, foo, quux, somme/foo, bar
|
||||||
subroutine test_noisepictures_rgb ()
|
enddo
|
||||||
implicit none
|
|
||||||
|
|
||||||
type(t_pixrgb), allocatable :: pix (:,:)
|
|
||||||
integer :: nombre
|
|
||||||
print *, '------ test des noisepictures RGB'
|
|
||||||
|
|
||||||
allocate(pix(800, 600))
|
|
||||||
nombre = (800*600)/4
|
|
||||||
|
|
||||||
call rgbpix_set_to_rgb(pix, 0, 0, 0)
|
|
||||||
call noise_rgb8_pic(pix, nombre)
|
|
||||||
call rgbpix_spit_as_pnm_8(pix, 'foo8.pnm')
|
|
||||||
|
|
||||||
call rgbpix_set_to_rgb(pix, 0, 0, 0)
|
|
||||||
call noise_rgb16_pic(pix, nombre)
|
|
||||||
call rgbpix_spit_as_pnm_16(pix, 'foo16.pnm')
|
|
||||||
|
|
||||||
deallocate (pix)
|
|
||||||
|
|
||||||
end subroutine
|
|
||||||
!-----------------------------------------------------------------------
|
|
||||||
subroutine test_noisepictures_gray ()
|
|
||||||
implicit none
|
|
||||||
|
|
||||||
integer, allocatable :: pix (:,:)
|
|
||||||
integer :: nombre
|
|
||||||
print *, '------ test des noisepictures GRAY'
|
|
||||||
|
|
||||||
allocate(pix(800, 600))
|
|
||||||
nombre = (800*600)/4
|
|
||||||
|
|
||||||
pix = 0
|
|
||||||
call noise_gray8_pic(pix, nombre)
|
|
||||||
call spit_as_pgm_8(pix, 'bar8.pgm')
|
|
||||||
|
|
||||||
pix = 0
|
|
||||||
call noise_gray16_pic(pix, nombre)
|
|
||||||
call spit_as_pgm_16(pix, 'bar16.pgm')
|
|
||||||
|
|
||||||
deallocate (pix)
|
|
||||||
|
|
||||||
end subroutine
|
|
||||||
|
|
||||||
!-----------------------------------------------------------------------
|
|
||||||
|
|
||||||
end program
|
end program
|
||||||
|
Loading…
Reference in New Issue
Block a user