From f95dc7ed2a442eae578d3a736629529e86b9fa85 Mon Sep 17 00:00:00 2001 From: tTh Date: Sat, 6 Jan 2024 18:47:47 +0100 Subject: [PATCH] more compact PNM8 file --- Modules/chkpixels.f90 | 6 +++--- Modules/pixrgb.f90 | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Modules/chkpixels.f90 b/Modules/chkpixels.f90 index 19f7681..4022fca 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' @@ -59,8 +59,8 @@ contains value = value + increment enddo enddo - call spit_as_pgm_16 (greymap, 'a.pnm') - call spit_as_pgm_eq (greymap, 'b.pnm') +! call spit_as_pgm_16 (greymap, 'a.pnm') +! call spit_as_pgm_eq (greymap, 'b.pnm') call spit_as_pgm_8 (greymap, 'c.pnm') call new_spit_a (greymap, 'x.pnm') end subroutine diff --git a/Modules/pixrgb.f90 b/Modules/pixrgb.f90 index 2545637..b74222c 100644 --- a/Modules/pixrgb.f90 +++ b/Modules/pixrgb.f90 @@ -77,7 +77,8 @@ subroutine rgbpix_spit_as_pnm_8(pic, fname) do iy=1, ubound(pic, 2) do ix=1, ubound(pic, 1) - write(io, "(3I5)") 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)