add ranged RGB noise

This commit is contained in:
tTh
2023-06-10 08:52:36 +02:00
parent 920a864b22
commit 72b58a8f0b
3 changed files with 55 additions and 2 deletions

View File

@@ -6,12 +6,13 @@ program essai
use noisepictures
implicit none
integer :: foo, bar
! integer :: foo, bar
write(0, *) "----------------- essai -------------------"
call init_random_seed() ! in module 'mathstuff'
call test_noisepictures_rgb()
call test_noisepictures_rgb_range()
call test_noisepictures_gray()
contains
@@ -37,6 +38,32 @@ subroutine test_noisepictures_rgb ()
deallocate (pix)
end subroutine
!-----------------------------------------------------------------------
! new: Sat Jun 10 06:50:51 UTC 2023
subroutine test_noisepictures_rgb_range ()
implicit none
type(t_pixrgb), allocatable :: pix (:,:)
integer :: nombre
integer :: ranges(6)
print *, '------ test des noisepictures RGB range'
allocate(pix(800, 600))
nombre = (800*600)/4
call rgbpix_set_to_rgb(pix, 0, 0, 0)
ranges(1) = 0 ; ranges(2) = 21000
ranges(3) = 22000 ; ranges(4) = 43000
ranges(5) = 44400 ; ranges(6) = 63000
call noise_range_rgb16_pic(pix, ranges, nombre)
call rgbpix_spit_as_pnm_16(pix, 'rngs16.pnm')
deallocate (pix)
end subroutine
!-----------------------------------------------------------------------
subroutine test_noisepictures_gray ()