add a "set to rgb" func

This commit is contained in:
tTh 2023-05-07 21:27:52 +02:00
parent 9366c67c4b
commit 5c4ff9133c
1 changed files with 18 additions and 0 deletions

View File

@ -1,5 +1,6 @@
!-
! This module try to write PNM complient RGB files
! ONLY ASCII MODE IS SUPPORTED !
!-
module pixrgb
implicit none
@ -26,6 +27,23 @@ subroutine rgbpix_set_to_zero(pic)
enddo
enddo
end subroutine
!-------------------------------------------------------------------
!-
! set all the pixels to a RGB value
!-
subroutine rgbpix_set_to_rgb(pic, r, g, b)
type(t_pixrgb), intent(out) :: pic(:,:)
integer, intent(in) :: r, g, b
integer :: ix, iy
do iy=1, ubound(pic, 2)
do ix=1, ubound(pic, 1)
pic(ix, iy)%r = r
pic(ix, iy)%g = g
pic(ix, iy)%b = b
enddo
enddo
end subroutine
!-------------------------------------------------------------------
!-
! NOT TESTED !!!