Skip to content

Commit

Permalink
Utilized allocatable array for 'rgb_image'.
Browse files Browse the repository at this point in the history
  • Loading branch information
gha3mi committed Jan 6, 2024
1 parent ec0056d commit d8ec02f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions example/example1.f90
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
! SOFTWARE.
!-------------------------------------------------------------------------------
! Contributed by gha3mi: 2023-10-26
! Last modification: gha3mi 2023-10-26
! Last modification: gha3mi 2024-01-06
!-------------------------------------------------------------------------------

! This example demonstrates how ForImage can be used to import/export PPM files.
Expand Down Expand Up @@ -64,12 +64,14 @@ subroutine test_colormap(self, filename, encoding)
integer :: k, j ! Pixbuffer coordinates
integer, parameter :: pixwidth = 600
integer, parameter :: pixheight = 600
integer, dimension(pixheight,pixwidth*3) :: rgb_image
integer, dimension(:,:), allocatable :: rgb_image
integer :: red, green, blue
real(wp) :: z
type(format_pnm) :: ppm
character(*), intent(in) :: encoding

allocate(rgb_image(pixheight,pixwidth*3))

do k = 0, pixwidth-1
do j = 0, pixheight-1
! Computing a z=f(x,y) function:
Expand Down

0 comments on commit d8ec02f

Please sign in to comment.