set_marker_image Function

private function set_marker_image(self, file) result(ok)

Draw the markers as an image file (tinted by the marker color; its transparent parts left out), or as a disk again with ''. Returns false if the image cannot be read (the markers are then unchanged).

Type Bound

MarkerArtist

Arguments

Type IntentOptional Attributes Name
class(MarkerArtist), intent(inout) :: self
character(len=*), intent(in) :: file

the image file ('': a disk again)

Return Value logical


Calls

proc~~set_marker_image~~CallsGraph proc~set_marker_image MarkerArtist%set_marker_image interface~vkf_image_delete vkf_image_delete proc~set_marker_image->interface~vkf_image_delete interface~vkf_image_read vkf_image_read proc~set_marker_image->interface~vkf_image_read proc~rebuild_markers rebuild_markers proc~set_marker_image->proc~rebuild_markers proc~build_marker_nodes build_marker_nodes proc~rebuild_markers->proc~build_marker_nodes proc~detach LineChain%detach proc~rebuild_markers->proc~detach proc~init LineChain%init proc~build_marker_nodes->proc~init proc~marker_style marker_style proc~build_marker_nodes->proc~marker_style proc~marker_uses_colors marker_uses_colors proc~build_marker_nodes->proc~marker_uses_colors proc~redraw_markers redraw_markers proc~build_marker_nodes->proc~redraw_markers proc~reserve LineChain%reserve proc~build_marker_nodes->proc~reserve proc~set_compile LineChain%set_compile proc~build_marker_nodes->proc~set_compile interface~vkf_node_remove_child vkf_node_remove_child proc~detach->interface~vkf_node_remove_child proc~check_status check_status proc~detach->proc~check_status proc~release~2 LineChain%release proc~detach->proc~release~2 proc~is_colored LineChain%is_colored proc~marker_style->proc~is_colored proc~set_marker_style LineChain%set_marker_style proc~marker_style->proc~set_marker_style num_colors num_colors proc~marker_uses_colors->num_colors interface~vkf_node_delete vkf_node_delete proc~release~2->interface~vkf_node_delete proc~reserve->proc~check_status interface~vkf_compile_node vkf_compile_node proc~reserve->interface~vkf_compile_node interface~vkf_line_create vkf_line_create proc~reserve->interface~vkf_line_create interface~vkf_line_create_colored vkf_line_create_colored proc~reserve->interface~vkf_line_create_colored interface~vkf_marker_create vkf_marker_create proc~reserve->interface~vkf_marker_create interface~vkf_node_add_child vkf_node_add_child proc~reserve->interface~vkf_node_add_child interface~vkf_ribbon_create vkf_ribbon_create proc~reserve->interface~vkf_ribbon_create proc~apply_style apply_style proc~reserve->proc~apply_style proc~line_set_segments line_set_segments proc~reserve->proc~line_set_segments proc~move_chunks move_chunks proc~reserve->proc~move_chunks proc~apply_style->proc~check_status interface~vkf_line_set_dash_mode vkf_line_set_dash_mode proc~apply_style->interface~vkf_line_set_dash_mode interface~vkf_line_set_highlight vkf_line_set_highlight proc~apply_style->interface~vkf_line_set_highlight interface~vkf_line_set_trail vkf_line_set_trail proc~apply_style->interface~vkf_line_set_trail proc~line_set_pattern line_set_pattern proc~apply_style->proc~line_set_pattern proc~line_set_style line_set_style proc~apply_style->proc~line_set_style proc~marker_set_style marker_set_style proc~apply_style->proc~marker_set_style interface~vkf_line_style vkf_line_style proc~line_set_segments->interface~vkf_line_style interface~vkf_line_style_changed vkf_line_style_changed proc~line_set_segments->interface~vkf_line_style_changed proc~set_marker_style->proc~apply_style proc~line_set_pattern->interface~vkf_line_style proc~line_set_pattern->interface~vkf_line_style_changed proc~line_set_style->interface~vkf_line_style proc~line_set_style->interface~vkf_line_style_changed proc~marker_set_style->interface~vkf_line_style proc~marker_set_style->interface~vkf_line_style_changed

Source Code

    logical function set_marker_image(self, file) result(ok)
        class(MarkerArtist), intent(inout) :: self
        character(len=*), intent(in) :: file                !! the image file ('': a disk again)
        type(c_ptr) :: image
        ok = .true.
        if (len_trim(file) == 0) then
            image = c_null_ptr
            self%shape_ = MARKER_DISK
        else
            image = vkf_image_read(trim(file), len_trim(file, kind=c_int))
            ok = c_associated(image)
            if (.not. ok) return
            self%shape_ = MARKER_IMAGE
        end if
        if (c_associated(self%image)) call vkf_image_delete(self%image)
        self%image = image
        self%image_file = trim(file)
        call rebuild_markers(self)                    ! the image is part of the marker nodes
    end function set_marker_image