From 5c4ff9133cfc451032144d769bcbec9d4a662038 Mon Sep 17 00:00:00 2001 From: tTh Date: Sun, 7 May 2023 21:27:52 +0200 Subject: [PATCH] add a "set to rgb" func --- Modules/pixrgb.f90 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Modules/pixrgb.f90 b/Modules/pixrgb.f90 index 58ecdc3..f8ba52a 100644 --- a/Modules/pixrgb.f90 +++ b/Modules/pixrgb.f90 @@ -1,5 +1,6 @@ !- ! This module try to write PNM complient RGB files +! ONLY ASCII MODE IS SUPPORTED ! !- module pixrgb implicit none @@ -26,6 +27,23 @@ subroutine rgbpix_set_to_zero(pic) enddo enddo end subroutine +!------------------------------------------------------------------- +!- +! set all the pixels to a RGB value +!- +subroutine rgbpix_set_to_rgb(pic, r, g, b) + type(t_pixrgb), intent(out) :: pic(:,:) + integer, intent(in) :: r, g, b + integer :: ix, iy + do iy=1, ubound(pic, 2) + do ix=1, ubound(pic, 1) + pic(ix, iy)%r = r + pic(ix, iy)%g = g + pic(ix, iy)%b = b + enddo + enddo +end subroutine + !------------------------------------------------------------------- !- ! NOT TESTED !!!