foresight_backend_dumb
foresight_backend_dumb, text output device (gnuplot
dumbterminal).
The page is a grid of character cells, CELL_WIDTH x CELL_HEIGHT font sizes each, so the layout engine works unchanged in its virtual pixels. Series are drawn with gnuplot's dumb symbols, one per color in order of use, the frame with +, - and |, the grid with .; superscripts become ^. Data segments are clipped to the plot area before rasterisation: points far outside the range never cost more than the cells actually drawn.
With colors other than mono (gnuplot ansi, ansi256, ansirgb) the cells of each series take its color through ANSI escape sequences, the nearest of the 6 basic colors, of the 256-color palette, or the color itself; frame, grid, text, and black, white or named series colors keep the terminal's own color.
Data are drawn through px_segment and px_point, in pixels: a device drawing at a finer resolution than the cells (foresight_backend_block) overrides them, cell, clear, rect and polyline, and keeps the rest.
Readouts are seven-segment digits in characters, 3 rows of 4 columns per cell (_, |_|, |_|, the decimal point a . in the fourth column); the unlit segments are not drawn, text has no faint intensity. A filled rectangle (the readout window) clears the cells it covers.
Filled polygons (boxes, filledcurves) fill the cells whose centre lies inside with the symbol of the fill color (gnuplot's dumb uses #, which is also a series symbol here: a fill would hide the second curve), whatever the opacity, then draw the border with the color symbol; in the plot area they are clipped to it first (Sutherland-Hodgman). Fills go through px_fill, which a finer device overrides.
Images (with image, color boxes) are drawn a character per cell, the cell taking the pixel at its centre: a character of density growing with the pixel luminance ( .:-=+*#%@), in its color with ansi; transparent pixels (undefined values) are left blank.
Source: src/lib/foresight_backend_dumb.F90
Dependencies
Contents
- color_symbol
- backend_dumb
- push
- begin_page
- end_page
- begin_axes
- end_axes
- begin_group
- end_group
- rect
- polyline
- dots
- polygon
- image
- text
- text_raw
- begin_plot_area
- end_plot_area
- data_arrows
- data_label
- data_label_raw
- data_polyline
- data_dots
- data_bars
- data_polygon
- data_image
- readout
- clear
- px_fill
- px_point
- px_segment
- put
- segment
- unit_segment
- clip_unit
- push_symbol
- text_width
- readout_extent
- cell
- col
- row
- color_index
- symbol_of
- scanline
- color_rgb
- ansi_escape
- rotates_text
- row_height
- segment_char
Variables
| Name | Type | Attributes | Description |
|---|---|---|---|
SYMBOLS | character(len=*) | parameter | Series symbols, cycled. |
FRAME_COLOR | character(len=*) | parameter | Frame color, drawn as ticks. |
GRID_COLOR | character(len=*) | parameter | Grid color, drawn as dots on blank cells. |
PATTERN_SYMBOLS | character(len=*) | parameter | Cell symbols of the fill patterns 1 to 7. |
CELL_WIDTH | real(kind=R8P) | parameter | Cell width [font size]. |
CELL_HEIGHT | real(kind=R8P) | parameter | Cell height [font size]. |
TEXT_COLORS | character(len=*) | parameter | Color modes (gnuplot names). |
ESC | character(len=1) | parameter | Escape character. |
Derived Types
color_symbol
Symbol assigned to a color.
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
color | character(len=:) | allocatable | SVG color. |
symbol | character(len=1) | Cell symbol. |
backend_dumb
Text output device.
Inheritance
Extends: backend_object
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. |
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. |
begin_page | pass(self) | Start a blank page of width x height px. |
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. |
rect | pass(self) | Stroked rectangles are drawn with -, | and + corners; a fill blanks the cells covered. |
polyline | pass(self) | Frame polylines (ticks) mark their start with +, grid lines dot blank cells, others use the color symbol. |
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. |
begin_plot_area | pass(self) | Remember the plot area, where unit-square coordinates map. |
end_plot_area | pass(self) | Nothing to close in text. |
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. |
cell | pass(self) | Text of a cell. |
clear | pass(self) | Blank a box. |
col | pass(self) | Column of an abscissa [px]. |
color_index | pass(self) | Index of a color in symbols. |
px_fill | pass(self) | Fill a polygon [px]. |
px_point | pass(self) | Draw a data point [px]. |
px_segment | pass(self) | Draw a data segment [px]. |
row | pass(self) | Row of an ordinate [px]. |
put | pass(self) | Set a cell. |
segment | pass(self) | Rasterise a cell segment. |
symbol_of | pass(self) | Symbol of a color. |
unit_segment | pass(self) | Clip and draw a unit-square segment. |
backend_dumb%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_dumb%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_dumb%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_dumb%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_dumb%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
Interfaces
push
Append an item through a temporary: nvfortran 26.9 corrupts list = [list, item] (and any list = f(list)) when the items hold deferred-length characters.
Module procedures: push_symbol
Subroutines
begin_page
Start a blank page of width x height px.
subroutine begin_page(self, file, width, height, font_size)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | 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
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
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
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
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
end_group
Leave the group.
subroutine end_group(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | inout | Device. |
Call graph
rect
Stroked rectangles are drawn with -, | and + corners; a fill blanks the cells covered.
subroutine rect(self, x, y, width, height, stroke, fill, line_width)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]. | |
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
polyline
Frame polylines (ticks) mark their start with +, grid lines dot blank cells, others use the color symbol.
subroutine 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 [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
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
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
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
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
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
begin_plot_area
Remember the plot area, where unit-square coordinates map.
subroutine begin_plot_area(self, x, y, width, height)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]. | |
width | real(kind=R8P) | in | Width [px]. | |
height | real(kind=R8P) | in | Height [px]. |
Call graph
end_plot_area
Nothing to close in text.
subroutine end_plot_area(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | inout | Device. |
Call graph
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
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
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
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
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
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
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
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
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
clear
Blank the cells 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_dumb) | 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
px_fill
Fill the cells whose centre lies inside the polygon (x, y) [px] with the symbol of color (even-odd rule).
subroutine px_fill(self, x, y, color)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]. | |
color | character(len=*) | in | Fill color. |
Call graph
px_point
A data point at p [px]: the color symbol in its cell.
subroutine px_point(self, p, color)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | 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] with symbol, or the color symbol if empty.
subroutine px_segment(self, a, b, color, symbol)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | 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 | Symbol, empty for the color symbol. |
Call graph
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
segment
Bresenham segment between cells, optionally writing blank cells only.
Attributes: pure
subroutine segment(self, c1, r1, c2, r2, symbol, blank_only, tint)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | inout | Device. | |
c1 | integer(kind=I4P) | in | Start column. | |
r1 | integer(kind=I4P) | in | Start row. | |
c2 | integer(kind=I4P) | in | End column. | |
r2 | integer(kind=I4P) | in | End row. | |
symbol | character(len=1) | in | Symbol. | |
blank_only | logical | in | Write blank cells only. | |
tint | integer(kind=I4P) | in | optional | Color index in symbols. |
Call graph
unit_segment
Clip the unit-square segment to [0, 1]^2 (Liang-Barsky), then draw it in the plot area.
subroutine unit_segment(self, u1, v1, u2, v2, color, symbol)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | inout | Device. | |
u1 | real(kind=R8P) | in | Start abscissa [unit]. | |
v1 | real(kind=R8P) | in | Start ordinate [unit]. | |
u2 | real(kind=R8P) | in | End abscissa [unit]. | |
v2 | real(kind=R8P) | in | End ordinate [unit]. | |
color | character(len=*) | in | Color. | |
symbol | character(len=*) | in | Symbol, empty for the color symbol. |
Call graph
clip_unit
The polygon (x, y) clipped to the unit square (Sutherland-Hodgman, one side at a time).
Attributes: pure
subroutine clip_unit(x, y, cx, cy)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
x | real(kind=R8P) | in | Vertex abscissae. | |
y | real(kind=R8P) | in | Vertex ordinates. | |
cx | real(kind=R8P) | out | allocatable | Clipped abscissae. |
cy | real(kind=R8P) | out | allocatable | Clipped ordinates. |
Call graph
push_symbol
Append item to list (an unallocated list is empty), through a temporary: see push.
Attributes: pure
subroutine push_symbol(list, item)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
list | type(color_symbol) | inout | allocatable | List. |
item | type(color_symbol) | in | New item. |
Functions
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
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
cell
Text of the cell (c, r): its character.
Attributes: pure
Returns: character(len=:)
function cell(self, c, r) result(text)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | in | Device. | |
c | integer(kind=I4P) | in | Column. | |
r | integer(kind=I4P) | in | Row. |
Call graph
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
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
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
symbol_of
Symbol of color, assigning the next one on first use.
Returns: character(len=1)
function symbol_of(self, color) result(symbol)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(backend_dumb) | inout | Device. | |
color | character(len=*) | in | SVG color. |
Call graph
scanline
Sorted abscissae where the horizontal line yc crosses the edges of the closed polygon (x, y): pairs bound its inside (even-odd rule). An edge counts its lower end and not its upper one, so a vertex on the line counts once.
Attributes: pure
Returns: real(kind=R8P)
function scanline(x, y, yc) result(xs)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
x | real(kind=R8P) | in | Vertex abscissae. | |
y | real(kind=R8P) | in | Vertex ordinates. | |
yc | real(kind=R8P) | in | Line ordinate. |
Call graph
color_rgb
Red, green, blue (0-255) of the color k of symbols in the theme; -1 for the terminal's own color: index 0, a color that is not #rrggbb, black or white (unreadable on one of the backgrounds).
Attributes: pure
Returns: integer(kind=I4P)
function color_rgb(symbols, k, theme) result(rgb)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
symbols | type(color_symbol) | in | Symbols in use. | |
k | integer(kind=I4P) | in | Index, 0 for the default. | |
theme | type(theme_object) | in | Output theme. |
Call graph
ansi_escape
ANSI escape sequence setting the foreground to rgb in the color mode, or to the default if rgb is -1: the nearest of the 6 basic colors (no black and white) for ansi, of the 6x6x6 cube and the gray ramp for ansi256, the color itself for ansirgb.
Attributes: pure
Returns: character(len=:)
function ansi_escape(mode, rgb) result(escape)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
mode | character(len=*) | in | ansi, ansi256 or ansirgb. | |
rgb | integer(kind=I4P) | in | Color, -1 for the default. |
Call graph
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
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
segment_char
symbol if segment of the seven-segment cell mask is lit, else a blank.
Attributes: pure
Returns: character(len=1)
function segment_char(mask, segment, symbol) result(c)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
mask | integer(kind=I4P) | in | Segments of the cell. | |
segment | integer(kind=I4P) | in | Segment bit. | |
symbol | character(len=1) | in | Symbol. |
Call graph