Fortraneries/Modules/trnd.f90

67 lines
1.5 KiB
Fortran
Raw Normal View History

2023-05-07 23:48:37 +02:00
program essai
use mathstuff2
2023-06-09 23:59:54 +02:00
use pixrgb
use spitpgm
use noisepictures
2023-05-07 23:48:37 +02:00
implicit none
integer :: foo, bar
write(0, *) "----------------- essai -------------------"
call init_random_seed() ! in module 'mathstuff'
2023-06-09 23:59:54 +02:00
call test_noisepictures_rgb()
call test_noisepictures_gray()
contains
!-----------------------------------------------------------------------
subroutine test_noisepictures_rgb ()
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
!-----------------------------------------------------------------------
2023-05-07 23:48:37 +02:00
end program