test_025 Subroutine

subroutine test_025(id, nfail)

Uses

  • proc~~test_025~~UsesGraph proc~test_025 test_025 module~forcolormap_utils forcolormap_utils proc~test_025->module~forcolormap_utils module~forcolormap_parameters forcolormap_parameters module~forcolormap_utils->module~forcolormap_parameters iso_fortran_env iso_fortran_env module~forcolormap_parameters->iso_fortran_env

Lagrange colormap output must be clamped to valid 8-bit RGB [0,255].

Arguments

Type IntentOptional Attributes Name
integer, intent(inout) :: id
integer, intent(inout) :: nfail

Calls

proc~~test_025~~CallsGraph proc~test_025 test_025 proc~lagrange lagrange proc~test_025->proc~lagrange proc~report_test report_test proc~test_025->proc~report_test proc~lagrange_poly lagrange_poly proc~lagrange->proc~lagrange_poly

Called by

proc~~test_025~~CalledByGraph proc~test_025 test_025 program~check check program~check->proc~test_025

Source Code

   subroutine test_025(id, nfail)
      use forcolormap_utils, only: lagrange
      integer, intent(inout) :: id, nfail
      character(len=*), parameter :: name = "lagrange: values clamped to [0,255]"
      logical :: ok
      integer :: colors(3,3)
      integer, allocatable :: map(:,:)

      colors(1,:) = [   0,   0,   0 ]
      colors(2,:) = [ 255, 255, 255 ]
      colors(3,:) = [   0, 255,   0 ]

      map = lagrange(colors, 64)
      ok = all(map >= 0) .and. all(map <= 255)
      call report_test(name, ok, id, nfail)
   end subroutine test_025