Skip to content

Commit

Permalink
example/modify.f90: removed unused test_colormap()
Browse files Browse the repository at this point in the history
  • Loading branch information
vmagnin committed Feb 15, 2024
1 parent 3fe57f6 commit 4dabacb
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions example/modify.f90
Original file line number Diff line number Diff line change
Expand Up @@ -58,40 +58,4 @@ program modify
call cmap%colorbar("bam_shifted", encoding='binary')
print *, "See the bam.ppm and bam_shifted.ppm colorbars"

contains

subroutine test_colormap(self, filename, encoding)
use forimage, only: format_pnm
type(Colormap), intent(inout) :: self
character(*), intent(in) :: filename
integer :: k, j ! Pixbuffer coordinates
integer, parameter :: pixwidth = 600
integer, parameter :: pixheight = 600
integer, dimension(pixheight,pixwidth*3) :: rgb_image
integer :: red, green, blue
real(wp) :: z
type(format_pnm) :: ppm
character(*), intent(in) :: encoding

do k = 0, pixwidth-1
do j = 0, pixheight-1
! Computing a z=f(x,y) function:
z = 1.0_wp + sin(k*j/10000.0_wp) * cos(j/100.0_wp)
! The corresponding RGB values in our colormap:
call self%compute_RGB(z, red, green, blue)
rgb_image(pixheight-j, 3*(k+1)-2) = red
rgb_image(pixheight-j, 3*(k+1)-1) = green
rgb_image(pixheight-j, 3*(k+1)) = blue
end do
end do

call ppm%set_pnm(encoding = encoding,&
file_format = 'ppm',&
width = pixwidth,&
height = pixheight,&
max_color = 255,&
comment = 'comment',&
pixels = rgb_image)
call ppm%export_pnm(filename)
end subroutine test_colormap
end program modify

0 comments on commit 4dabacb

Please sign in to comment.