foresight_backend_block
foresight_backend_block, text output device drawing with Unicode block or Braille characters (gnuplot
block).
The page is the character grid of foresight_backend_dumb, its layout and text unchanged; the graphics (frame, ticks, grid, series, key samples) are drawn on a bitmap of sx x sy dots per cell, each cell written as the character of its dots: half (1x2, half blocks), quadrants (2x2, the default as in gnuplot), sextants (2x3, Unicode 13) or braille (2x4). Text is written over the graphics. Unlike gnuplot, a cell without dots is a blank, Braille included, so rows trim and copy as text; a point is its dot and the four neighbours. A cell takes the color of the last series drawn in it.
Source: src/lib/foresight_backend_block.F90
Dependencies
Contents
- backend_block
- begin_page
- begin_plot_area
- end_plot_area
- clear
- polyline
- px_fill
- px_point
- px_segment
- rect
- dot
- dot_line
- cell
- dot_index
- code_point
- utf8
Variables
| Name | Type | Attributes | Description |
|---|---|---|---|
BLOCK_CHARSETS | character(len=*) | parameter | Character sets (gnuplot names). |
Derived Types
backend_block
Block character text device.
Inheritance
Extends: backend_dumb
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
theme | type(theme_object) | Output theme: colors the layout's ones are mapped to (foresight_theme). | |
enhanced | logical | Texts read as gnuplot's enhanced text (foresight_enhanced). | |
latin1 | logical | Texts in ISO 8859-1, written in UTF-8 (set encoding iso_8859_1). | |
literal | logical | The texts written now as they are (an automatic title, noenhanced). | |
tex | logical | Texts are LaTeX source, set by LaTeX (cairolatex): numbers in math mode. | |
text_size | real(kind=R8P) | Default font size of the texts [px]. | |
boxed | logical | The texts written now are boxed (gnuplot's textbox): on the background. | |
page_family | character(len=48) | Font family of the page (set terminal ... font), empty: the device's. | |
font | type(font_object) | The font of the texts written now (gnuplot font "..."); unset parts the page's. | |
head_px | real(kind=R8P) | Length [px] and angle [deg] of the data arrowheads drawn now, 0 for the default head. | |
head_fixed | logical | Those heads keep their size on short arrows (gnuplot fixed). | |
clear_screen | logical | Clear the terminal before writing to standard output. | |
file | character(len=:) | allocatable | Output file, - for standard output. |
grid | character(len=1) | allocatable | Cells, (column, row). |
symbols | type(color_symbol) | allocatable | Symbols in use. |
tint | integer(kind=I4P) | allocatable | Cell color, index in symbols, 0 for the default. |
colors | character(len=7) | Color mode: mono, ansi, ansi256, ansirgb. | |
cw | real(kind=R8P) | Cell width [px]. | |
ch | real(kind=R8P) | Cell height [px]. | |
font_size | real(kind=R8P) | Font size [px]. | |
area | real(kind=R8P) | Plot area: left, top, width, height [px]. | |
hidden | logical | Inside a hidden group: nothing is drawn. | |
charset | character(len=9) | Character set. | |
sx | integer(kind=I4P) | Dots per cell, horizontally. | |
sy | integer(kind=I4P) | Dots per cell, vertically. | |
dots_on | logical | allocatable | Bitmap, (dot column, dot row). |
clip | integer(kind=I4P) | Dots of the open plot area: first, last column, first, last row; all 0 outside one. |
Type-Bound Procedures
| Name | Attributes | Description |
|---|---|---|
wants_scene | pass(self) | Whether 3D scenes are written. |
scene | pass(self) | A 3D view's scene (JSON). |
hover | pass(self) | Text on mouse-over of a point. |
pixmap | pass(self) | A PNG image [px]. |
front_area | pass(self) | Open or close the front layer of the plot area. |
end_page | pass(self) | Write the page, rows right-trimmed: to standard output, or atomically to the file. |
begin_axes | pass(self) | No panel metadata in text. |
end_axes | pass(self) | No panel metadata in text. |
begin_group | pass(self) | A hidden group (the grid when off) is not drawn at all. |
end_group | pass(self) | Leave the group. |
dots | pass(self) | Dots are the color symbol, whatever the point type. |
polygon | pass(self) | Closed polygon [px]: its inside filled (px_fill) unless fill is none, then its border with the symbol of stroke unless none; the opacity has no meaning in text, a ghost (unlit cell) is not drawn. |
image | pass(self) | Raster image over the box of top-left (x0, y0) and bottom-right (x1, y1) corners [px]: a character per cell whose centre lies inside, the density of the pixel luminance, in the pixel color. |
text | pass(self) | Text (text_raw), ISO 8859-1 texts in UTF-8 first (latin1). |
text_raw | pass(self) | text without the ISO 8859-1 conversion. |
data_polyline | pass(self) | Polyline [unit square] drawn with the color symbol, clipped to the plot area; grid lines (the polar grid) with ., frame lines (the polar border, the r axis) with -, | or + by their slope, as gnuplot's dumb. |
data_dots | pass(self) | Dots [unit square] inside the plot area drawn with the color symbol, whatever the point type. |
data_bars | pass(self) | Error bars [unit square] as | (vertical) or - (horizontal) runs, clipped to the plot area; no caps. |
data_polygon | pass(self) | Closed polygon [unit square] clipped to the plot area, then drawn in it as polygon. |
data_image | pass(self) | Raster image over the box of bottom-left (x0, y0) and top-right (x1, y1) corners [unit square], clipped to the plot area: the pixels of the visible part drawn as image. |
text_width | pass(self) | Width of string in cells [px]: superscripts take full cells after a ^. |
rotates_text | pass(self) | Tick labels stay horizontal on text devices, as on gnuplot's dumb terminal. |
row_height | pass(self) | Height of a character row [px]: text is written row by row. |
readout | pass(self) | Seven-segment readout of top-left corner (x, y) [px] in characters: the label row, then 3 rows of 4 columns per cell, lit segments in the series color, the whole glass written so that it covers what lies below; the digit height is not used, characters have one size. |
readout_extent | pass(self) | Width and height [px] of a readout in characters: 4 columns per cell and the unit text, 3 rows and the label. |
data_arrows | pass(self) | Arrows [unit square]: shafts clipped to the plot area with the color symbol, heads (at a tip inside the plot area) as two short segments, filled or not. |
data_label | pass(self) | Text at a data point (data_label_raw), ISO 8859-1 texts in UTF-8 first (latin1). |
data_label_raw | pass(self) | data_label without the ISO 8859-1 conversion. |
col | pass(self) | Column of an abscissa [px]. |
color_index | pass(self) | Index of a color in symbols. |
row | pass(self) | Row of an ordinate [px]. |
put | pass(self) | Set a cell. |
begin_page | pass(self) | Start a blank page and its bitmap. |
begin_plot_area | pass(self) | Remember the plot area and its dots, where point markers are clipped. |
end_plot_area | pass(self) | Leave the plot area: markers are no longer clipped (key samples). |
cell | pass(self) | Text of the cell (c, r): its text character, else the character of its dots, a blank if none. |
clear | pass(self) | Blank the cells and the dots of the box of top-left corner (x, y) and size width x height [px]. |
polyline | pass(self) | Frame lines (ticks) and key samples drawn on the bitmap, grid lines dotted (every other dot). |
px_fill | pass(self) | Fill the dots whose centre lies inside the polygon (x, y) [px], coloring their cells (even-odd rule). |
px_point | pass(self) | A data point at p [px]: its dot and the four neighbours, inside the plot area when in one. |
px_segment | pass(self) | A data segment from a to b [px] on the bitmap; symbol (the error bar character in text) is not used, but for the grid one .: a dotted line. |
rect | pass(self) | Stroked rectangles drawn on the bitmap; a fill blanks the cells and dots covered. |
dot | pass(self) | Set a dot. |
dot_line | pass(self) | Rasterise a dot segment. |
backend_block%wants_scene
Whether the device writes the scene of a 3D view (the HTML page, for the viewer's mouse rotation): no.
Attributes: pure
Returns: logical
function wants_scene(self) result(wants)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_object) | in | Device. |
Call graph
backend_block%scene
The scene of a 3D view (foresight_scene3d's JSON), in the open panel: nothing on a device without a viewer.
subroutine scene(self, json)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_object) | inout | Device. | |
json | character(len=*) | in | Scene. |
Call graph
backend_block%hover
text shown on mouse-over of the point (x, y) [unit square], a disk of diameter [px] (gnuplot's hypertext): nothing on a device without a mouse.
subroutine hover(self, x, y, text, diameter)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_object) | inout | Device. | |
x | real(kind=R8P) | in | Abscissa [unit]. | |
y | real(kind=R8P) | in | Ordinate [unit]. | |
text | character(len=*) | in | Text. | |
diameter | real(kind=R8P) | in | Sensitive disk [px]. |
backend_block%pixmap
The PNG image png (base64) with its top left corner at (x, y), width x height [px], stretched (gnuplot set pixmap): nothing on a device without images.
subroutine pixmap(self, x, y, width, height, png)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_object) | inout | Device. | |
x | real(kind=R8P) | in | Left side [px]. | |
y | real(kind=R8P) | in | Top side [px]. | |
width | real(kind=R8P) | in | Width [px]. | |
height | real(kind=R8P) | in | Height [px]. | |
png | character(len=*) | in | The PNG file, base64. |
Call graph
backend_block%front_area
Open (opening) or close the front layer of the plot area, after its overlays (markers, caps): the data space objects of gnuplot's front layer go above the points. separate false on a device that draws them in the plot area (before it closes): this one, nothing to open or close.
subroutine front_area(self, opening, separate)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_object) | inout | Device. | |
opening | logical | in | Open, else close. | |
separate | logical | out | A layer of its own. |
Call graph
backend_block%end_page
Write the page, rows right-trimmed: to standard output, or atomically to the file.
subroutine end_page(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | inout | Device. |
Call graph
backend_block%begin_axes
No panel metadata in text.
subroutine begin_axes(self, view)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | inout | Device. | |
view | type(axes_view) | in | Panel geometry and axis ranges. |
Call graph
backend_block%end_axes
No panel metadata in text.
subroutine end_axes(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | inout | Device. |
Call graph
backend_block%begin_group
A hidden group (the grid when off) is not drawn at all.
subroutine begin_group(self, name, visible, series)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | inout | Device. | |
name | character(len=*) | in | Group name. | |
visible | logical | in | optional | Group shown. |
series | integer(kind=I4P) | in | optional | Series number, unused in text. |
Call graph
backend_block%end_group
Leave the group.
subroutine end_group(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | inout | Device. |
Call graph
backend_block%dots
Dots are the color symbol, whatever the point type.
subroutine dots(self, x, y, color, diameter, pt, line_width)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | inout | Device. | |
x | real(kind=R8P) | in | Abscissae [px]. | |
y | real(kind=R8P) | in | Ordinates [px]. | |
color | character(len=*) | in | Fill color. | |
diameter | real(kind=R8P) | in | Dot diameter [px]. | |
pt | integer(kind=I4P) | in | optional | Point type, ignored. |
line_width | real(kind=R8P) | in | optional | Marker line width, ignored. |
Call graph
backend_block%polygon
Closed polygon [px]: its inside filled (px_fill) unless fill is none, then its border with the symbol of stroke unless none; the opacity has no meaning in text, a ghost (unlit cell) is not drawn.
subroutine polygon(self, x, y, fill, opacity, stroke, line_width, ghost)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | inout | Device. | |
x | real(kind=R8P) | in | Vertex abscissae [px]. | |
y | real(kind=R8P) | in | Vertex ordinates [px]. | |
fill | character(len=*) | in | Fill color. | |
opacity | real(kind=R8P) | in | Fill opacity, unused. | |
stroke | character(len=*) | in | Border color. | |
line_width | real(kind=R8P) | in | Border width, unused. | |
ghost | logical | in | optional | Unlit cell of a segmented fill. |
Call graph
backend_block%image
Raster image over the box of top-left (x0, y0) and bottom-right (x1, y1) corners [px]: a character per cell whose centre lies inside, the density of the pixel luminance, in the pixel color.
subroutine image(self, x0, y0, x1, y1, rgba)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | inout | Device. | |
x0 | real(kind=R8P) | in | Left [px]. | |
y0 | real(kind=R8P) | in | Top [px]. | |
x1 | real(kind=R8P) | in | Right [px]. | |
y1 | real(kind=R8P) | in | Bottom [px]. | |
rgba | integer(kind=I4P) | in | Pixels. |
Call graph
backend_block%text
Text (text_raw), ISO 8859-1 texts in UTF-8 first (latin1).
subroutine text(self, x, y, string, anchor, sup, rotate, color)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | inout | Device. | |
x | real(kind=R8P) | in | Anchor abscissa [px]. | |
y | real(kind=R8P) | in | Anchor ordinate (baseline) [px]. | |
string | character(len=*) | in | Text. | |
anchor | character(len=*) | in | Horizontal anchor: start, middle or end. | |
sup | character(len=*) | in | optional | Superscript appended to string. |
rotate | real(kind=R8P) | in | optional | Rotation. |
color | character(len=*) | in | optional | Text color. |
Call graph
backend_block%text_raw
Text in the row of its baseline; superscripts appended after ^; rotated text written top to bottom; the color is not drawn.
subroutine text_raw(self, x, y, string, anchor, sup, rotate, color)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | inout | Device. | |
x | real(kind=R8P) | in | Anchor abscissa [px]. | |
y | real(kind=R8P) | in | Anchor ordinate (baseline) [px]. | |
string | character(len=*) | in | Text. | |
anchor | character(len=*) | in | Horizontal anchor: start, middle or end. | |
sup | character(len=*) | in | optional | Superscript appended to string. |
rotate | real(kind=R8P) | in | optional | Rotation [deg]. |
color | character(len=*) | in | optional | Text color (not drawn). |
Call graph
backend_block%data_polyline
Polyline [unit square] drawn with the color symbol, clipped to the plot area; grid lines (the polar grid) with ., frame lines (the polar border, the r axis) with -, | or + by their slope, as gnuplot's dumb.
subroutine data_polyline(self, x, y, color, line_width, dasharray)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | inout | Device. | |
x | real(kind=R8P) | in | Abscissae [unit]. | |
y | real(kind=R8P) | in | Ordinates [unit]. | |
color | character(len=*) | in | Stroke color. | |
line_width | real(kind=R8P) | in | Stroke width [px]. | |
dasharray | character(len=*) | in | SVG dash array. |
Call graph
backend_block%data_dots
Dots [unit square] inside the plot area drawn with the color symbol, whatever the point type.
subroutine data_dots(self, x, y, color, diameter, pt, line_width)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | inout | Device. | |
x | real(kind=R8P) | in | Abscissae [unit]. | |
y | real(kind=R8P) | in | Ordinates [unit]. | |
color | character(len=*) | in | Fill color. | |
diameter | real(kind=R8P) | in | Dot diameter [px]. | |
pt | integer(kind=I4P) | in | optional | Point type, ignored. |
line_width | real(kind=R8P) | in | optional | Marker line width, ignored. |
Call graph
backend_block%data_bars
Error bars [unit square] as | (vertical) or - (horizontal) runs, clipped to the plot area; no caps.
subroutine data_bars(self, x1, y1, x2, y2, color, line_width, cap, vertical)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | inout | Device. | |
x1 | real(kind=R8P) | in | Bar start abscissae. | |
y1 | real(kind=R8P) | in | Bar start ordinates. | |
x2 | real(kind=R8P) | in | Bar end abscissae. | |
y2 | real(kind=R8P) | in | Bar end ordinates. | |
color | character(len=*) | in | Stroke color. | |
line_width | real(kind=R8P) | in | Stroke width [px]. | |
cap | real(kind=R8P) | in | Cap length [px]. | |
vertical | logical | in | Vertical bars. |
Call graph
backend_block%data_polygon
Closed polygon [unit square] clipped to the plot area, then drawn in it as polygon.
subroutine data_polygon(self, x, y, fill, opacity, stroke, line_width, ghost)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | inout | Device. | |
x | real(kind=R8P) | in | Vertex abscissae [unit]. | |
y | real(kind=R8P) | in | Vertex ordinates [unit]. | |
fill | character(len=*) | in | Fill color. | |
opacity | real(kind=R8P) | in | Fill opacity. | |
stroke | character(len=*) | in | Border color. | |
line_width | real(kind=R8P) | in | Border width [px]. | |
ghost | logical | in | optional | Unlit cell of a segmented fill. |
Call graph
backend_block%data_image
Raster image over the box of bottom-left (x0, y0) and top-right (x1, y1) corners [unit square], clipped to the plot area: the pixels of the visible part drawn as image.
subroutine data_image(self, x0, y0, x1, y1, rgba)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | inout | Device. | |
x0 | real(kind=R8P) | in | Left [unit]. | |
y0 | real(kind=R8P) | in | Bottom [unit]. | |
x1 | real(kind=R8P) | in | Right [unit]. | |
y1 | real(kind=R8P) | in | Top [unit]. | |
rgba | integer(kind=I4P) | in | Pixels. |
Call graph
backend_block%text_width
Width of string in cells [px]: superscripts take full cells after a ^.
Attributes: pure
Returns: real(kind=R8P)
function text_width(self, string, sup, font_size) result(width)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | in | Device. | |
string | character(len=*) | in | Text. | |
sup | character(len=*) | in | Superscript. | |
font_size | real(kind=R8P) | in | Font size [px]. |
Call graph
backend_block%rotates_text
Tick labels stay horizontal on text devices, as on gnuplot's dumb terminal.
Attributes: pure
Returns: logical
function rotates_text(self) result(rotates)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | in | Device. |
Call graph
backend_block%row_height
Height of a character row [px]: text is written row by row.
Attributes: pure
Returns: real(kind=R8P)
function row_height(self) result(height)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | in | Device. |
Call graph
backend_block%readout
Seven-segment readout of top-left corner (x, y) [px] in characters: the label row, then 3 rows of 4 columns per cell, lit segments in the series color, the whole glass written so that it covers what lies below; the digit height is not used, characters have one size.
subroutine readout(self, x, y, height, masks, label, prefix, suffix, color, font_size)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | inout | Device. | |
x | real(kind=R8P) | in | Left side [px]. | |
y | real(kind=R8P) | in | Top side [px]. | |
height | real(kind=R8P) | in | Digit height [px], unused. | |
masks | integer(kind=I4P) | in | Segments of each cell. | |
label | character(len=*) | in | Label, empty for none. | |
prefix | character(len=*) | in | Text before the glass. | |
suffix | character(len=*) | in | Text after the glass. | |
color | character(len=*) | in | Color of the lit segments. | |
font_size | real(kind=R8P) | in | Font size [px], unused. |
Call graph
backend_block%readout_extent
Width and height [px] of a readout in characters: 4 columns per cell and the unit text, 3 rows and the label.
Attributes: pure
Returns: real(kind=R8P)
function readout_extent(self, height, cells, label, prefix, suffix, font_size) result(extent)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | in | Device. | |
height | real(kind=R8P) | in | Digit height [px], unused. | |
cells | integer(kind=I4P) | in | Glass cells. | |
label | character(len=*) | in | Label, empty for none. | |
prefix | character(len=*) | in | Text before the glass. | |
suffix | character(len=*) | in | Text after the glass. | |
font_size | real(kind=R8P) | in | Font size [px]. |
Call graph
backend_block%data_arrows
Arrows [unit square]: shafts clipped to the plot area with the color symbol, heads (at a tip inside the plot area) as two short segments, filled or not.
subroutine data_arrows(self, x1, y1, x2, y2, color, line_width, head, filled)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | inout | Device. | |
x1 | real(kind=R8P) | in | Tail abscissae [unit]. | |
y1 | real(kind=R8P) | in | Tail ordinates [unit]. | |
x2 | real(kind=R8P) | in | Tip abscissae [unit]. | |
y2 | real(kind=R8P) | in | Tip ordinates [unit]. | |
color | character(len=*) | in | Stroke color. | |
line_width | real(kind=R8P) | in | Stroke width [px]. | |
head | integer(kind=I4P) | in | Heads: 0 none, 1 end, 2 start, 3 both. | |
filled | logical | in | Filled heads. |
Call graph
backend_block%data_label
Text at a data point (data_label_raw), ISO 8859-1 texts in UTF-8 first (latin1).
subroutine data_label(self, x, y, string, anchor, rotate, color, dx, dy)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | inout | Device. | |
x | real(kind=R8P) | in | Anchor abscissa [unit]. | |
y | real(kind=R8P) | in | Anchor ordinate [unit]. | |
string | character(len=*) | in | Text. | |
anchor | character(len=*) | in | Horizontal anchor: start, middle or end. | |
rotate | real(kind=R8P) | in | Rotation [deg, counterclockwise]. | |
color | character(len=*) | in | Text color. | |
dx | real(kind=R8P) | in | Horizontal offset [px]. | |
dy | real(kind=R8P) | in | Vertical offset [px, downward]. |
Call graph
backend_block%data_label_raw
Text at a data point [unit square] inside the plot area, moved by the offset; unrotated in text.
subroutine data_label_raw(self, x, y, string, anchor, rotate, color, dx, dy)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | inout | Device. | |
x | real(kind=R8P) | in | Anchor abscissa [unit]. | |
y | real(kind=R8P) | in | Anchor ordinate [unit]. | |
string | character(len=*) | in | Text. | |
anchor | character(len=*) | in | Horizontal anchor: start, middle or end. | |
rotate | real(kind=R8P) | in | Rotation [deg, counterclockwise], ignored. | |
color | character(len=*) | in | Text color, ignored. | |
dx | real(kind=R8P) | in | Horizontal offset [px]. | |
dy | real(kind=R8P) | in | Vertical offset [px, downward]. |
Call graph
backend_block%col
Column of the cell containing the abscissa x [px], clamped to the page.
Attributes: elemental
Returns: integer(kind=I4P)
function col(self, x) result(c)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | in | Device. | |
x | real(kind=R8P) | in | Abscissa [px]. |
Call graph
backend_block%color_index
Index of color in symbols, assigning the next symbol on first use.
Returns: integer(kind=I4P)
function color_index(self, color) result(k)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | inout | Device. | |
color | character(len=*) | in | SVG color. |
Call graph
backend_block%row
Row of the cell containing the ordinate y [px], clamped to the page.
Attributes: elemental
Returns: integer(kind=I4P)
function row(self, y) result(r)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | in | Device. | |
y | real(kind=R8P) | in | Ordinate [px]. |
Call graph
backend_block%put
Set cell (c, r) and its color index tint (default 0), ignoring cells off the page.
Attributes: pure
subroutine put(self, c, r, symbol, tint)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | inout | Device. | |
c | integer(kind=I4P) | in | Column. | |
r | integer(kind=I4P) | in | Row. | |
symbol | character(len=1) | in | Symbol. | |
tint | integer(kind=I4P) | in | optional | Color index in symbols. |
Call graph
Subroutines
begin_page
Start a blank page and its bitmap.
subroutine begin_page(self, file, width, height, font_size)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_block) | inout | Device. | |
file | character(len=*) | in | Output file, - for standard output. | |
width | real(kind=R8P) | in | Page width [px]. | |
height | real(kind=R8P) | in | Page height [px]. | |
font_size | real(kind=R8P) | in | Font size [px]. |
Call graph
begin_plot_area
Remember the plot area and its dots, where point markers are clipped.
subroutine begin_plot_area(self, x, y, width, height)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_block) | inout | Device. | |
x | real(kind=R8P) | in | Left side [px]. | |
y | real(kind=R8P) | in | Top side [px]. | |
width | real(kind=R8P) | in | Width [px]. | |
height | real(kind=R8P) | in | Height [px]. |
Call graph
end_plot_area
Leave the plot area: markers are no longer clipped (key samples).
subroutine end_plot_area(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_block) | inout | Device. |
Call graph
clear
Blank the cells and the dots of the box of top-left corner (x, y) and size width x height [px].
subroutine clear(self, x, y, width, height)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_block) | inout | Device. | |
x | real(kind=R8P) | in | Left side [px]. | |
y | real(kind=R8P) | in | Top side [px]. | |
width | real(kind=R8P) | in | Width [px]. | |
height | real(kind=R8P) | in | Height [px]. |
Call graph
polyline
Frame lines (ticks) and key samples drawn on the bitmap, grid lines dotted (every other dot).
subroutine polyline(self, x, y, color, line_width, dasharray)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_block) | inout | Device. | |
x | real(kind=R8P) | in | Abscissae [px]. | |
y | real(kind=R8P) | in | Ordinates [px]. | |
color | character(len=*) | in | Stroke color. | |
line_width | real(kind=R8P) | in | Stroke width [px]. | |
dasharray | character(len=*) | in | SVG dash array. |
Call graph
px_fill
Fill the dots whose centre lies inside the polygon (x, y) [px], coloring their cells (even-odd rule).
subroutine px_fill(self, x, y, color)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_block) | inout | Device. | |
x | real(kind=R8P) | in | Vertex abscissae [px]. | |
y | real(kind=R8P) | in | Vertex ordinates [px]. | |
color | character(len=*) | in | Fill color. |
Call graph
px_point
A data point at p [px]: its dot and the four neighbours, inside the plot area when in one.
subroutine px_point(self, p, color)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_block) | inout | Device. | |
p | real(kind=R8P) | in | Point [px]. | |
color | character(len=*) | in | Color. |
Call graph
px_segment
A data segment from a to b [px] on the bitmap; symbol (the error bar character in text) is not used, but for the grid one .: a dotted line.
subroutine px_segment(self, a, b, color, symbol)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_block) | inout | Device. | |
a | real(kind=R8P) | in | Start [px]. | |
b | real(kind=R8P) | in | End [px]. | |
color | character(len=*) | in | Color. | |
symbol | character(len=*) | in |
Call graph
rect
Stroked rectangles drawn on the bitmap; a fill blanks the cells and dots covered.
subroutine rect(self, x, y, width, height, stroke, fill, line_width)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_block) | inout | Device. | |
x | real(kind=R8P) | in | Left side [px]. | |
y | real(kind=R8P) | in | Top side [px]. | |
width | real(kind=R8P) | in | Width [px]. | |
height | real(kind=R8P) | in | Height [px]. | |
stroke | character(len=*) | in | Stroke color. | |
fill | character(len=*) | in | Fill color. | |
line_width | real(kind=R8P) | in | Stroke width [px]. |
Call graph
dot
Set dot (i, j) and color its cell with tint (unless 0, or the cell holds text), ignoring dots off the page.
Attributes: pure
subroutine dot(self, i, j, tint)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_block) | inout | Device. | |
i | integer(kind=I4P) | in | Dot column. | |
j | integer(kind=I4P) | in | Dot row. | |
tint | integer(kind=I4P) | in | Color index, 0 to keep the cell color. |
Call graph
dot_line
Bresenham segment of dots from a to b [px], every other dot if dotted.
Attributes: pure
subroutine dot_line(self, a, b, tint, dotted)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_block) | inout | Device. | |
a | real(kind=R8P) | in | Start [px]. | |
b | real(kind=R8P) | in | End [px]. | |
tint | integer(kind=I4P) | in | Color index, 0 for the default. | |
dotted | logical | in | Every other dot only. |
Call graph
Functions
cell
Text of the cell (c, r): its text character, else the character of its dots, a blank if none.
Attributes: pure
Returns: character(len=:)
function cell(self, c, r) result(text)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_block) | in | Device. | |
c | integer(kind=I4P) | in | Column. | |
r | integer(kind=I4P) | in | Row. |
Call graph
dot_index
Dot containing the coordinate p [px] with cells cell_size px wide of per_cell dots, clamped to 1..last.
Attributes: elemental
Returns: integer(kind=I4P)
function dot_index(p, cell_size, per_cell, last) result(d)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
p | real(kind=R8P) | in | Coordinate [px]. | |
cell_size | real(kind=R8P) | in | Cell size [px]. | |
per_cell | integer(kind=I4P) | in | Dots per cell. | |
last | integer(kind=I4P) | in | Last dot. |
Call graph
code_point
Unicode code point of the cell character of charset with the dots bits, non-zero: bit i + sx * j for the dot of column i and row j (from 0, left to right, top to bottom).
Attributes: pure
Returns: integer(kind=I4P)
function code_point(charset, bits) result(code)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
charset | character(len=*) | in | Character set. | |
bits | integer(kind=I4P) | in | Dots. |
Call graph
utf8
UTF-8 encoding of the code point code (at most U+10FFFF).
Attributes: pure
Returns: character(len=:)
function utf8(code) result(text)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
code | integer(kind=I4P) | in | Code point. |
Call graph