From 9c148c3d7edd8ba621c543c591a3311000611327 Mon Sep 17 00:00:00 2001 From: tTh Date: Sat, 6 Jan 2024 02:52:50 +0100 Subject: [PATCH] more compact PNM16 file --- Modules/chkpixels.f90 | 5 +++-- Modules/pixrgb.f90 | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Modules/chkpixels.f90 b/Modules/chkpixels.f90 index b1b9750..19f7681 100644 --- a/Modules/chkpixels.f90 +++ b/Modules/chkpixels.f90 @@ -11,7 +11,7 @@ program chkpixels implicit none write(0, *) "------ CHKPIXELS ------" - call test_spit_as(3) + ! call test_spit_as(3) call test_spit_rgb(128, 222) STOP 'BECAUSE NO CPU AVAILABLE' @@ -37,7 +37,8 @@ contains pixrgb(ix, iy)%b = iy end do end do - call rgbpix_spit_as_pnm_8(pixrgb, "rgb.pnm") + call rgbpix_spit_as_pnm_8(pixrgb, "rgb8.pnm") + call rgbpix_spit_as_pnm_16(pixrgb, "rgb16.pnm") deallocate(pixrgb) end subroutine diff --git a/Modules/pixrgb.f90 b/Modules/pixrgb.f90 index f8ba52a..2545637 100644 --- a/Modules/pixrgb.f90 +++ b/Modules/pixrgb.f90 @@ -102,7 +102,8 @@ subroutine rgbpix_spit_as_pnm_16(pic, fname) 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 + write(io, "(I0,' ', I0,' ',I0)") & + pic(ix, iy)%r, pic(ix, iy)%g, pic(ix, iy)%b enddo enddo close(unit=io)