As slice, for the colors of a colored chain: c(rgba, point) of points lo .. hi of chunk j (null if not colored or nothing there).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(LineChain), | intent(in) | :: | self | |||
| integer, | intent(in) | :: | j |
the chunk, and points i1 .. i2 (chain indices) |
||
| integer, | intent(in) | :: | i1 |
the chunk, and points i1 .. i2 (chain indices) |
||
| integer, | intent(in) | :: | i2 |
the chunk, and points i1 .. i2 (chain indices) |
||
| integer, | intent(out) | :: | lo |
chain indices (lo > hi: none) |
||
| integer, | intent(out) | :: | hi |
chain indices (lo > hi: none) |
||
| real(kind=c_float), | intent(out), | dimension(:,:), pointer | :: | c |
(4, hi-lo+1): [r, g, b, a] |
subroutine color_slice(self, j, i1, i2, lo, hi, c) class(LineChain), intent(in) :: self integer, intent(in) :: j, i1, i2 !! the chunk, and points i1 .. i2 (chain indices) integer, intent(out) :: lo, hi !! chain indices (lo > hi: none) real(c_float), dimension(:,:), pointer, intent(out) :: c !! (4, hi-lo+1): [r, g, b, a] real(c_float), dimension(:,:), pointer :: all integer(c_int) :: capacity type(c_ptr) :: data c => null() associate (k => self%chunks(j)) lo = max(i1, k%first) hi = min(i2, k%first + k%capacity - 1) if (lo > hi .or. .not. self%colored) return data = vkf_line_colors(k%line, capacity) if (.not. c_associated(data)) return call c_f_pointer(data, all, [4, int(capacity)]) c => all(:, lo-k%first+1:hi-k%first+1) end associate end subroutine color_slice