fortplot_raster Module



Derived Types

type, public ::  raster_image_t

Components

Type Visibility Attributes Name Initial
integer(kind=1), public, allocatable :: image_data(:)
integer, public :: width
integer, public :: height
real(kind=wp), public :: current_r = 0.0_wp
real(kind=wp), public :: current_g = 0.0_wp
real(kind=wp), public :: current_b = 0.0_wp
real(kind=wp), public :: current_line_width = 1.0_wp
character(len=10), public :: line_style = '-'
real(kind=wp), public :: line_pattern(20)
integer, public :: pattern_size = 1
real(kind=wp), public :: pattern_length = SOLID_LINE_PATTERN_LENGTH
real(kind=wp), public :: pattern_distance = 0.0_wp
real(kind=wp), public :: marker_edge_r = 0.0_wp
real(kind=wp), public :: marker_edge_g = 0.0_wp
real(kind=wp), public :: marker_edge_b = 0.0_wp
real(kind=wp), public :: marker_edge_alpha = 1.0_wp
real(kind=wp), public :: marker_face_r = 1.0_wp
real(kind=wp), public :: marker_face_g = 0.0_wp
real(kind=wp), public :: marker_face_b = 0.0_wp
real(kind=wp), public :: marker_face_alpha = 1.0_wp

Type-Bound Procedures

procedure, public :: set_color => raster_set_color
procedure, public :: get_color_bytes => raster_get_color_bytes
procedure, public :: set_line_style => raster_set_line_style

type, public, extends(plot_context) ::  raster_context

Components

Type Visibility Attributes Name Initial
integer, public :: width
integer, public :: height
real(kind=wp), public :: x_min
real(kind=wp), public :: x_max
real(kind=wp), public :: y_min
real(kind=wp), public :: y_max
logical, public :: has_rendered_arrows = .false.
logical, public :: uses_vector_arrows = .false.
logical, public :: has_triangular_arrows = .false.
type(raster_image_t), public :: raster
type(plot_margins_t), public :: margins
type(plot_area_t), public :: plot_area

Type-Bound Procedures

procedure, public :: line => raster_draw_line
procedure, public :: color => raster_set_color_context
procedure, public :: text => raster_draw_text
procedure, public :: set_line_width => raster_set_line_width
procedure, public :: set_line_style => raster_set_line_style_context
procedure, public :: save => raster_save_dummy
procedure, public :: draw_marker => raster_draw_marker
procedure, public :: set_marker_colors => raster_set_marker_colors
procedure, public :: set_marker_colors_with_alpha => raster_set_marker_colors_with_alpha
procedure, public :: fill_quad => raster_fill_quad
procedure, public :: draw_arrow => raster_draw_arrow
procedure, public :: get_ascii_output => raster_get_ascii_output

New polymorphic methods to eliminate SELECT TYPE

procedure, public :: get_width_scale => raster_get_width_scale
procedure, public :: get_height_scale => raster_get_height_scale
procedure, public :: fill_heatmap => raster_fill_heatmap
procedure, public :: render_legend_specialized => raster_render_legend_specialized
procedure, public :: calculate_legend_dimensions => raster_calculate_legend_dimensions
procedure, public :: set_legend_border_width => raster_set_legend_border_width
procedure, public :: calculate_legend_position_backend => raster_calculate_legend_position
procedure, public :: extract_rgb_data => raster_extract_rgb_data
procedure, public :: get_png_data_backend => raster_get_png_data
procedure, public :: prepare_3d_data => raster_prepare_3d_data
procedure, public :: render_ylabel => raster_render_ylabel
procedure, public :: draw_axes_and_labels_backend => raster_draw_axes_and_labels
procedure, public :: save_coordinates => raster_save_coordinates
procedure, public :: set_coordinates => raster_set_coordinates
procedure, public :: render_axes => raster_render_axes

Functions

public function create_raster_image(width, height) result(image)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: width
integer, intent(in) :: height

Return Value type(raster_image_t)

public function create_raster_canvas(width, height) result(ctx)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: width
integer, intent(in) :: height

Return Value type(raster_context)


Subroutines

public subroutine destroy_raster_image(image)

Arguments

Type IntentOptional Attributes Name
type(raster_image_t), intent(inout) :: image

public subroutine raster_render_ylabel(this, ylabel)

Render rotated Y-axis label for PNG backend

Arguments

Type IntentOptional Attributes Name
class(raster_context), intent(inout) :: this
character(len=*), intent(in) :: ylabel

public subroutine raster_draw_axes_and_labels(this, xscale, yscale, symlog_threshold, x_min, x_max, y_min, y_max, title, xlabel, ylabel, z_min, z_max, has_3d_plots)

Draw axes and labels for raster backends

Arguments

Type IntentOptional Attributes Name
class(raster_context), intent(inout) :: this
character(len=*), intent(in) :: xscale
character(len=*), intent(in) :: yscale
real(kind=wp), intent(in) :: symlog_threshold
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
character(len=:), intent(in), optional, allocatable :: title
character(len=:), intent(in), optional, allocatable :: xlabel
character(len=:), intent(in), optional, allocatable :: ylabel
real(kind=wp), intent(in), optional :: z_min
real(kind=wp), intent(in), optional :: z_max
logical, intent(in) :: has_3d_plots