test_030 Subroutine

subroutine test_030(id, nfail)

Uses

  • proc~~test_030~~UsesGraph proc~test_030 test_030 module~forcolormap_utils forcolormap_utils proc~test_030->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

Bézier 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_030~~CallsGraph proc~test_030 test_030 proc~bezier bezier proc~test_030->proc~bezier proc~report_test report_test proc~test_030->proc~report_test proc~factorial factorial proc~bezier->proc~factorial

Called by

proc~~test_030~~CalledByGraph proc~test_030 test_030 program~check check program~check->proc~test_030

Source Code

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

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

      map = bezier(colors, 128)
      ok = all(map >= 0) .and. all(map <= 255)
      call report_test(name, ok, id, nfail)
   end subroutine test_030