Lagrange colormap output must be clamped to valid 8-bit RGB [0,255].
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(inout) | :: | id | |||
| integer, | intent(inout) | :: | nfail |
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