tail_colors Subroutine

private subroutine tail_colors(self, k, k2, frac)

The tail's colors: from point k's to the color at frac along to point k2's (white, showing the style's color, if the chain has none).

Arguments

Type IntentOptional Attributes Name
type(CurveArtist), intent(inout) :: self
integer, intent(in) :: k

the tail's ends

integer, intent(in) :: k2

the tail's ends

real(kind=wp), intent(in) :: frac

of the way from k's time to k2's (0 to 1)


Calls

proc~~tail_colors~~CallsGraph proc~tail_colors tail_colors interface~vkf_line_colors vkf_line_colors proc~tail_colors->interface~vkf_line_colors is_colored is_colored proc~tail_colors->is_colored proc~point_rgba point_rgba proc~tail_colors->proc~point_rgba color color proc~point_rgba->color num_colors num_colors proc~point_rgba->num_colors

Called by

proc~~tail_colors~~CalledByGraph proc~tail_colors tail_colors proc~update_tail CurveArtist%update_tail proc~update_tail->proc~tail_colors

Source Code

    subroutine tail_colors(self, k, k2, frac)
        type(CurveArtist), intent(inout) :: self
        integer, intent(in) :: k, k2                        !! the tail's ends
        real(wp), intent(in) :: frac                        !! of the way from k's time to k2's (0 to 1)
        real(c_float), dimension(:,:), pointer :: c
        real(wp) :: c0(4), c1(4)
        integer(c_int) :: capacity
        type(c_ptr) :: data
        data = vkf_line_colors(self%tail, capacity)
        if (.not. c_associated(data) .or. capacity < 2) return
        call c_f_pointer(data, c, [4, 2])
        if (self%chain%is_colored()) then
            c0 = point_rgba(self, k)
            c1 = point_rgba(self, k2)
            c(:, 1) = real(c0, c_float)
            c(:, 2) = real(c0 + frac * (c1 - c0), c_float)
        else
            c = 1.0_c_float
        end if
    end subroutine tail_colors