need more tuning ?
This commit is contained in:
parent
252ea6d764
commit
c0d8ee443f
@ -39,7 +39,7 @@ contains
|
|||||||
end do
|
end do
|
||||||
end do
|
end do
|
||||||
|
|
||||||
call rgbpix_spit_as_pnm(pixrgb, "rgb.pnm")
|
call rgbpix_spit_as_pnm_8(pixrgb, "rgb.pnm")
|
||||||
|
|
||||||
deallocate(pixrgb)
|
deallocate(pixrgb)
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ end type
|
|||||||
contains
|
contains
|
||||||
!-------------------------------------------------------------------
|
!-------------------------------------------------------------------
|
||||||
!-
|
!-
|
||||||
subroutine rgbpix_spit_as_pnm(pic, fname)
|
subroutine rgbpix_spit_as_pnm_8(pic, fname)
|
||||||
|
|
||||||
type(t_pixrgb), intent(in) :: pic(:,:)
|
type(t_pixrgb), intent(in) :: pic(:,:)
|
||||||
character (len=*), intent(in) :: fname
|
character (len=*), intent(in) :: fname
|
||||||
@ -24,14 +24,39 @@ subroutine rgbpix_spit_as_pnm(pic, fname)
|
|||||||
|
|
||||||
open(newunit=io, file=fname)
|
open(newunit=io, file=fname)
|
||||||
write (io, '(a2)') "P3"
|
write (io, '(a2)') "P3"
|
||||||
write (io, '("# spit_rgb_pnm")')
|
write (io, '("# rgbpix_spit_as_pnm_8")')
|
||||||
write (io, '(i0," ",i0)') size(pic, 1), size(pic, 2)
|
write (io, '(i0," ",i0)') size(pic, 1), size(pic, 2)
|
||||||
write (io, '(i0)') 255
|
write (io, '(i0)') 255
|
||||||
|
|
||||||
do iy=1, ubound(pic, 2)
|
do iy=1, ubound(pic, 2)
|
||||||
do ix=1, ubound(pic, 1)
|
do ix=1, ubound(pic, 1)
|
||||||
|
|
||||||
write(io, "(3I7)") pic(ix, iy)%r, pic(ix, iy)%g, pic(ix, iy)%b
|
write(io, "(3I4)") pic(ix, iy)%r, pic(ix, iy)%g, pic(ix, iy)%b
|
||||||
|
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
close(unit=io)
|
||||||
|
|
||||||
|
end subroutine
|
||||||
|
!-------------------------------------------------------------------
|
||||||
|
!-
|
||||||
|
subroutine rgbpix_spit_as_pnm_16(pic, fname)
|
||||||
|
|
||||||
|
type(t_pixrgb), intent(in) :: pic(:,:)
|
||||||
|
character (len=*), intent(in) :: fname
|
||||||
|
|
||||||
|
integer :: io, ix, iy
|
||||||
|
|
||||||
|
open(newunit=io, file=fname)
|
||||||
|
write (io, '(a2)') "P3"
|
||||||
|
write (io, '("# rgbpix_spit_as_pnm_16")')
|
||||||
|
write (io, '(i0," ",i0)') size(pic, 1), size(pic, 2)
|
||||||
|
write (io, '(i0)') 65535
|
||||||
|
|
||||||
|
do iy=1, ubound(pic, 2)
|
||||||
|
do ix=1, ubound(pic, 1)
|
||||||
|
|
||||||
|
write(io, "(3I6)") pic(ix, iy)%r, pic(ix, iy)%g, pic(ix, iy)%b
|
||||||
|
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
|
@ -87,6 +87,7 @@ subroutine spit_as_pgm_8(pic, fname)
|
|||||||
! XXX print *, " max = ", foo
|
! XXX print *, " max = ", foo
|
||||||
open(newunit=io, file=fname)
|
open(newunit=io, file=fname)
|
||||||
write (io, '(a2)') "P2"
|
write (io, '(a2)') "P2"
|
||||||
|
write (io, '(A)') "# spit_as_pgm_8"
|
||||||
write (io, '(i0," ",i0)') size(pic, 1), size(pic, 2)
|
write (io, '(i0," ",i0)') size(pic, 1), size(pic, 2)
|
||||||
write (io, '(i0)') 255
|
write (io, '(i0)') 255
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user