add a molly-guard
This commit is contained in:
@@ -49,7 +49,7 @@ end subroutine
|
|||||||
!-------------------------------------------------------------------
|
!-------------------------------------------------------------------
|
||||||
!-
|
!-
|
||||||
! 16 bits - 65535 levels portable grey map file
|
! 16 bits - 65535 levels portable grey map file
|
||||||
! no data conversion except upper clippin.
|
! no data conversion except upper clipping.
|
||||||
!-
|
!-
|
||||||
subroutine spit_as_pgm_16(pic, fname)
|
subroutine spit_as_pgm_16(pic, fname)
|
||||||
integer, intent(in), dimension (:,:) :: pic
|
integer, intent(in), dimension (:,:) :: pic
|
||||||
@@ -69,6 +69,7 @@ subroutine spit_as_pgm_16(pic, fname)
|
|||||||
do ix=1, ubound(pic, 1)
|
do ix=1, ubound(pic, 1)
|
||||||
foo = pic(ix, iy)
|
foo = pic(ix, iy)
|
||||||
if (foo .GT. 65535) foo = 65535
|
if (foo .GT. 65535) foo = 65535
|
||||||
|
if (foo .LT. 0) foo = 0
|
||||||
write(io, "(i0)") foo
|
write(io, "(i0)") foo
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
@@ -96,6 +97,7 @@ subroutine spit_as_pgm_8(pic, fname)
|
|||||||
do ix=1, ubound(pic, 1)
|
do ix=1, ubound(pic, 1)
|
||||||
foo = pic(ix, iy)
|
foo = pic(ix, iy)
|
||||||
if (foo .GT. 255) foo = 255
|
if (foo .GT. 255) foo = 255
|
||||||
|
if (foo .LT. 0) foo = 0
|
||||||
write(io, "(i0)") foo
|
write(io, "(i0)") foo
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
|
|||||||
Reference in New Issue
Block a user