fortplot_raster_core Module

Core raster image management and basic operations Extracted from fortplot_raster.f90 for size reduction (SRP compliance)



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 :: dpi = REFERENCE_DPI
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
real(kind=wp), public :: config_title_font_size = -1.0_wp
real(kind=wp), public :: config_label_font_size = -1.0_wp
real(kind=wp), public :: config_tick_font_size = -1.0_wp
real(kind=wp), public, allocatable :: config_xtick_values(:)
real(kind=wp), public, allocatable :: config_ytick_values(:)
integer, public :: last_y_tick_max_width = 0
integer, public :: last_y_tick_max_width_right = 0
integer, public :: last_x_tick_max_height_top = 0
integer, public :: last_x_tick_max_height_bottom = 0

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

Functions

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

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: width
integer, intent(in) :: height
real(kind=wp), intent(in), optional :: dpi

Return Value type(raster_image_t)

public pure function scale_px(px, dpi) result(scaled)

Scale a pixel value from reference DPI (100) to target DPI. At REFERENCE_DPI the value is unchanged.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: px
real(kind=wp), intent(in) :: dpi

Return Value integer

public pure function pt2px(pt, dpi) result(px)

Convert points (1/72 inch) to pixels at given DPI.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: pt
real(kind=wp), intent(in) :: dpi

Return Value real(kind=wp)


Subroutines

public subroutine destroy_raster_image(image)

Arguments

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