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
- begin_page
- end_page
- begin_axes
- end_axes
- begin_group
- end_group
- rect
- polyline
- dots
- polygon
- image
- text
- begin_plot_area
- end_plot_area
- data_arrows
- data_label
- data_polyline
- data_dots
- data_bars
- data_polygon
- data_image
- readout
- clear
- px_fill
- px_point
- px_segment
- put
- segment
- unit_segment
- clip_unit
- text_width
- readout_extent
- cell
- col
- row
- color_index
- symbol_of
- scanline
- color_rgb
- ansi_escape
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). | |
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 |
|---|---|---|
begin_page | pass(self) | |
end_page | pass(self) | |
begin_axes | pass(self) | |
end_axes | pass(self) | |
begin_group | pass(self) | |
end_group | pass(self) | |
rect | pass(self) | |
polyline | pass(self) | |
dots | pass(self) | |
polygon | pass(self) | |
image | pass(self) | |
text | pass(self) | |
begin_plot_area | pass(self) | |
end_plot_area | pass(self) | |
data_polyline | pass(self) | |
data_dots | pass(self) | |
data_bars | pass(self) | |
data_polygon | pass(self) | |
data_image | pass(self) | |
text_width | pass(self) | |
readout | pass(self) | |
readout_extent | pass(self) | |
data_arrows | pass(self) | |
data_label | pass(self) | |
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. |
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 in the row of its baseline; superscripts appended after ^; rotated text written top to bottom.
subroutine text(self, x, y, string, anchor, sup, rotate)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]. |
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 [unit square] inside the plot area, moved by the offset; unrotated in text.
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], 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
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