trials.f90: buffering is good for the planet
This commit is contained in:
@@ -8,8 +8,9 @@ module spitpgm
|
||||
|
||||
!-------------------------------------------------------------------
|
||||
!-
|
||||
! This subroutine try to scale the values to fit the 16 bit range
|
||||
!
|
||||
! This subroutine try to scale the values to fit the 16 bit range.
|
||||
! XXX may be add a third parameter : the max value required ?
|
||||
!-
|
||||
subroutine spit_as_pgm_eq(pic, fname)
|
||||
|
||||
integer, intent(in), dimension (:,:) :: pic
|
||||
@@ -19,7 +20,7 @@ subroutine spit_as_pgm_eq(pic, fname)
|
||||
integer :: ix, iy
|
||||
real :: fk, fpix
|
||||
|
||||
write(0, '(1X, A)') "> spit_as_pgm_eq to " // trim(fname)
|
||||
! write(0, '(1X, A)') " spit_as_pgm_eq to " // trim(fname)
|
||||
|
||||
open(newunit=io, file=fname)
|
||||
write (io, '(a2)') "P2"
|
||||
@@ -34,7 +35,7 @@ subroutine spit_as_pgm_eq(pic, fname)
|
||||
enddo
|
||||
else
|
||||
fk = float(foo) / 65535.01
|
||||
write (0, *) " max pix value", foo, " fk ", fk
|
||||
! write (0, *) " max pix value", foo, " fk ", fk
|
||||
do iy = 1, ubound(pic, 2)
|
||||
do ix = 1, ubound(pic, 1)
|
||||
fpix = float(pic(ix, iy)) / fk
|
||||
@@ -48,6 +49,7 @@ end subroutine
|
||||
!-------------------------------------------------------------------
|
||||
!-
|
||||
! 16 bits - 65535 levels portable grey map file
|
||||
! no data conversion except upper clippin.
|
||||
!-
|
||||
subroutine spit_as_pgm_16(pic, fname)
|
||||
integer, intent(in), dimension (:,:) :: pic
|
||||
|
||||
Reference in New Issue
Block a user