Specialized rendering functionality for raster backend Extracted from fortplot_raster.f90 for size reduction (SRP compliance)
Fill contour plot using scanline method for pixel-by-pixel rendering
| Type | Intent | Optional | 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 | 
Fill quadrilateral with current color
| Type | Intent | Optional | 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) | 
Fill triangle using barycentric coordinates
| Type | Intent | Optional | 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 | 
Fill horizontal line segment
| Type | Intent | Optional | 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 | 
Render legend using standard algorithm for PNG
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(legend_t), | intent(in) | :: | legend | |||
| real(kind=wp), | intent(in) | :: | legend_x | |||
| real(kind=wp), | intent(in) | :: | legend_y | 
Calculate legend dimensions for PNG using real text metrics (pixels)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(legend_t), | intent(in) | :: | legend | |||
| real(kind=wp), | intent(out) | :: | legend_width | |||
| real(kind=wp), | intent(out) | :: | legend_height | 
Set thin border width for PNG legend
Calculate standard legend position for PNG using plot coordinates
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(legend_t), | intent(in) | :: | legend | |||
| real(kind=wp), | intent(out) | :: | x | |||
| real(kind=wp), | intent(out) | :: | y | 
Extract RGB data from PNG backend
| Type | Intent | Optional | 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) | 
Raster context doesn't generate PNG data - only PNG context does
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | width | |||
| integer, | intent(in) | :: | height | |||
| integer(kind=1), | intent(out), | allocatable | :: | png_data(:) | ||
| integer, | intent(out) | :: | status | 
Prepare 3D data for PNG backend (no-op - PNG doesn't use 3D data)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(plot_data_t), | intent(in) | :: | plots(:) |