fortplot_raster_rendering Module

Specialized rendering functionality for raster backend Extracted from fortplot_raster.f90 for size reduction (SRP compliance)



Subroutines

public subroutine raster_fill_heatmap(raster, width, height, plot_area, x_min, x_max, y_min, y_max, x_grid, y_grid, z_grid, z_min, z_max)

Fill contour plot using scanline method for pixel-by-pixel rendering

Arguments

Type IntentOptional Attributes Name
type(raster_image_t), intent(inout) :: raster
integer, intent(in) :: width
integer, intent(in) :: height
type(plot_area_t), intent(in) :: plot_area
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
real(kind=wp), intent(in) :: x_grid(:)
real(kind=wp), intent(in) :: y_grid(:)
real(kind=wp), intent(in) :: z_grid(:,:)
real(kind=wp), intent(in) :: z_min
real(kind=wp), intent(in) :: z_max

public subroutine raster_fill_quad(raster, width, height, plot_area, x_min, x_max, y_min, y_max, x_quad, y_quad)

Fill quadrilateral with current color

Arguments

Type IntentOptional Attributes Name
type(raster_image_t), intent(inout) :: raster
integer, intent(in) :: width
integer, intent(in) :: height
type(plot_area_t), intent(in) :: plot_area
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
real(kind=wp), intent(in) :: x_quad(4)
real(kind=wp), intent(in) :: y_quad(4)

public subroutine fill_triangle(image_data, img_w, img_h, x1, y1, x2, y2, x3, y3, r, g, b)

Fill triangle using barycentric coordinates

Arguments

Type IntentOptional Attributes Name
integer(kind=1), intent(inout) :: image_data(*)
integer, intent(in) :: img_w
integer, intent(in) :: img_h
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) :: x3
real(kind=wp), intent(in) :: y3
integer(kind=1), intent(in) :: r
integer(kind=1), intent(in) :: g
integer(kind=1), intent(in) :: b

public subroutine fill_horizontal_line(image_data, img_w, img_h, x1, x2, y, r, g, b)

Fill horizontal line segment

Arguments

Type IntentOptional Attributes Name
integer(kind=1), intent(inout) :: image_data(*)
integer, intent(in) :: img_w
integer, intent(in) :: img_h
integer, intent(in) :: x1
integer, intent(in) :: x2
integer, intent(in) :: y
integer(kind=1), intent(in) :: r
integer(kind=1), intent(in) :: g
integer(kind=1), intent(in) :: b

public subroutine raster_render_legend_specialized(legend, legend_x, legend_y)

Render legend using standard algorithm for PNG

Arguments

Type IntentOptional Attributes Name
type(legend_t), intent(in) :: legend
real(kind=wp), intent(in) :: legend_x
real(kind=wp), intent(in) :: legend_y

public subroutine raster_calculate_legend_dimensions(legend, legend_width, legend_height)

Calculate legend dimensions for PNG using real text metrics (pixels)

Arguments

Type IntentOptional Attributes Name
type(legend_t), intent(in) :: legend
real(kind=wp), intent(out) :: legend_width
real(kind=wp), intent(out) :: legend_height

public subroutine raster_set_legend_border_width()

Set thin border width for PNG legend

Arguments

None

public subroutine raster_calculate_legend_position(legend, x, y)

Calculate standard legend position for PNG using plot coordinates

Arguments

Type IntentOptional Attributes Name
type(legend_t), intent(in) :: legend
real(kind=wp), intent(out) :: x
real(kind=wp), intent(out) :: y

public subroutine raster_extract_rgb_data(raster, width, height, rgb_data)

Extract RGB data from PNG backend

Arguments

Type IntentOptional Attributes Name
type(raster_image_t), intent(in) :: raster
integer, intent(in) :: width
integer, intent(in) :: height
real(kind=wp), intent(out) :: rgb_data(width,height,3)

public subroutine raster_get_png_data(width, height, png_data, status)

Raster context doesn't generate PNG data - only PNG context does

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: width
integer, intent(in) :: height
integer(kind=1), intent(out), allocatable :: png_data(:)
integer, intent(out) :: status

public subroutine raster_prepare_3d_data(plots)

Prepare 3D data for PNG backend (no-op - PNG doesn't use 3D data)

Arguments

Type IntentOptional Attributes Name
type(plot_data_t), intent(in) :: plots(:)