fortplot_ascii_primitives Module

ASCII terminal plotting backend - Drawing Primitives

This module contains primitive drawing functions for ASCII plotting, including line drawing, color management, and shape filling.

Author: fortplot contributors



Subroutines

public subroutine ascii_draw_line_primitive(canvas, x1, y1, x2, y2, x_min, x_max, y_min, y_max, plot_width, plot_height, current_r, current_g, current_b)

Arguments

Type IntentOptional Attributes Name
character(len=1), intent(inout) :: canvas(:,:)
real(kind=wp), intent(in) :: x1
real(kind=wp), intent(in) :: y1
real(kind=wp), intent(in) :: x2
real(kind=wp), intent(in) :: y2
real(kind=wp), intent(in) :: x_min
real(kind=wp), intent(in) :: x_max
real(kind=wp), intent(in) :: y_min
real(kind=wp), intent(in) :: y_max
integer, intent(in) :: plot_width
integer, intent(in) :: plot_height
real(kind=wp), intent(in) :: current_r
real(kind=wp), intent(in) :: current_g
real(kind=wp), intent(in) :: current_b

public subroutine ascii_fill_quad_primitive(canvas, x_quad, y_quad, x_min, x_max, y_min, y_max, plot_width, plot_height, current_r, current_g, current_b)

Fill quadrilateral using character mapping based on current color

Arguments

Type IntentOptional Attributes Name
character(len=1), intent(inout) :: canvas(:,:)
real(kind=wp), intent(in) :: x_quad(4)
real(kind=wp), intent(in) :: y_quad(4)
real(kind=wp), intent(in) :: x_min
real(kind=wp), intent(in) :: x_max
real(kind=wp), intent(in) :: y_min
real(kind=wp), intent(in) :: y_max
integer, intent(in) :: plot_width
integer, intent(in) :: plot_height
real(kind=wp), intent(in) :: current_r
real(kind=wp), intent(in) :: current_g
real(kind=wp), intent(in) :: current_b

public subroutine ascii_draw_text_primitive(text_x, text_y, text, x, y, text_input, x_min, x_max, y_min, y_max, plot_width, plot_height, current_r, current_g, current_b)

Arguments

Type IntentOptional Attributes Name
integer, intent(out) :: text_x
integer, intent(out) :: text_y
character(len=:), intent(out), allocatable :: text
real(kind=wp), intent(in) :: x
real(kind=wp), intent(in) :: y
character(len=*), intent(in) :: text_input
real(kind=wp), intent(in) :: x_min
real(kind=wp), intent(in) :: x_max
real(kind=wp), intent(in) :: y_min
real(kind=wp), intent(in) :: y_max
integer, intent(in) :: plot_width
integer, intent(in) :: plot_height
real(kind=wp), intent(in) :: current_r
real(kind=wp), intent(in) :: current_g
real(kind=wp), intent(in) :: current_b