nxt namespace

Terminal grid geometry.

This is intentionally much smaller than a general units library. It models the dimensions nxt actually needs: columns, rows, ratios, percentages, and terminal positions.

Namespaces

namespace ai
namespace ansi
namespace detail
namespace http
namespace input
namespace io
namespace png
namespace subprocess
namespace theme
namespace tui
namespace ui
namespace utf8
namespace vterm

Classes

struct Cell
Cell data for inspection.
struct ChangeRun
class GlyphTable
struct IndexedCell
A cell with its column position for iteration.
struct Pos
Two-dimensional zero-based terminal position.
class Raster
class RasterView
struct RawChange
struct Rgb8
Opaque 24-bit RGB color.
struct Rgba8
struct Size
Two-dimensional extent in terminal cells.
struct StyleState
struct ansi_origin_t
One-based ANSI-column origin tag.
struct ansi_origin_v_t
One-based ANSI-row origin tag.
struct cancelled
Exception thrown when an operation is cancelled.
struct ch_unit
Literal unit for terminal-cell widths.
struct col_t
Strong type for a zero-based terminal column.
struct disconnected
Exception thrown when trying to push to a channel with no receiver.
struct empty_context
struct height_t
Strong type for vertical extents measured in terminal lines.
struct ln_unit
Literal unit for terminal-line heights.
struct one_unit
Literal unit for dimensionless ratios.
struct percent_t
Percentage value, where 100 means one whole.
struct percent_unit
Literal unit for percentages.
template <typename T, typename Pull>
class pull_source
struct ratio_t
Dimensionless flex or scale ratio.
struct row_t
Strong type for a zero-based terminal row.
template <typename Context = empty_context>
class scope
template <typename T>
struct source_value
template <typename T>
struct source_value<channel<T>>
template <typename T, typename Pull>
struct source_value<pull_source<T, Pull>>
template <typename T>
struct source_value<signal<T>>
struct terminal_origin_t
Zero-based terminal-column origin tag.
struct terminal_origin_v_t
Zero-based terminal-row origin tag.
struct width_t
Strong type for horizontal extents measured in terminal cells.

Concepts

template <typename Sink, typename T>
concept sink
template <typename Source>
concept source
template <typename T>
concept numeric
Arithmetic type accepted by the unit literal operators.
template <typename S>
concept has_context
template <typename S>
concept scoped

Enums

enum class Emphasis: std::uint8_t { none = 0, bold = 1 << 0, faint = 1 << 1, italic = 1 << 2, underline = 1 << 3, blink = 1 << 4, reverse = 1 << 5, conceal = 1 << 6, strikethrough = 1 << 7 }

Typedefs

using ansi_col_t = col_t
ANSI columns share the same representation but are interpreted one-based.
using ansi_row_t = row_t
ANSI rows share the same representation but are interpreted one-based.
template <typename T>
using bound_publisher = detail::bound_publisher<T>
template <typename T>
using channel = nxt::detail::event_queue<T>
Buffered async stream of values.
using color_view_t = std::experimental::mdspan<Rgba8, mdspan_extents, std::experimental::layout_stride>
Mutable 2D color view.
using const_color_view_t = std::experimental::mdspan<const Rgba8, mdspan_extents, std::experimental::layout_stride>
Const 2D color view.
using const_emphasis_view_t = std::experimental::mdspan<const Emphasis, mdspan_extents, std::experimental::layout_stride>
Const 2D emphasis view.
using const_glyph_view_t = std::experimental::mdspan<const GlyphTable::GlyphId, mdspan_extents, std::experimental::layout_stride>
Const 2D glyph view.
using emphasis_view_t = std::experimental::mdspan<Emphasis, mdspan_extents, std::experimental::layout_stride>
Mutable 2D emphasis view.
using event = coro::event
Manually signaled coroutine event.
template <typename T>
using generator = coro::generator<T>
Coroutine generator type.
using glyph_view_t = std::experimental::mdspan<GlyphTable::GlyphId, mdspan_extents, std::experimental::layout_stride>
Mutable 2D glyph view.
using io_scheduler = scheduler
using latch = coro::latch
Coroutine latch primitive.
using mdspan_extents = std::experimental::extents<std::size_t, std::dynamic_extent, std::dynamic_extent>
Dynamic extents for terminal-cell rasters.
using poll_op = coro::poll_op
Poll operation type from libcoro.
using poll_status = coro::poll_status
Poll status type from libcoro.
using poll_stop_source = coro::poll_stop_source
Stop source for cancellable poll operations.
template <typename T>
using publisher = detail::publisher<T>
template <typename T>
using queue = coro::queue<T>
Async multi-producer/multi-consumer queue.
using scheduler = coro::scheduler
Scheduler type used by nxt async operations.
template <std::ptrdiff_t max_value>
using semaphore = coro::semaphore<max_value>
Counting semaphore with a compile-time maximum value.
template <typename T>
using signal = detail::signal<T>
template <typename T>
using source_value_t = typename source_value<std::remove_cvref_t<T>>::type
template <typename T = void>
using task = coro::task<T>
Coroutine task type used throughout nxt.

Functions

template <scoped Scope, typename... Awaitables>
auto all(Scope& s, Awaitables && ... awaitables) →  auto
template <scoped Scope, typename... Awaitables>
auto any(Scope& s, Awaitables && ... awaitables) →  auto
template <typename T, typename Extents, typename Layout, typename Accessor>
auto as_range(std::experimental::mdspan<T, Extents, Layout, Accessor> m) →  auto
template <scoped Scope>
void cancel(Scope& s)
template <typename T>
auto cancel(channel<T>& ch) →  task<void>
template <typename T>
auto close(channel<T>& ch) →  task<void>
template <typename T>
void close(signal<T>& sig)
template <typename F>
void diff_rasters(const Raster& front, const Raster& back, F&& emit)
auto has_emphasis(Emphasis set, Emphasis flag) →  bool constexpr noexcept
auto indexed_cell_row(const_glyph_view_t glyphs, const_color_view_t fgs, const_color_view_t bgs, const_emphasis_view_t ems, std::size_t row_idx) →  auto
Get a row as indexed cells (col, glyph, fg, bg, em).
template <typename T, typename Extents, typename Layout, typename Accessor>
auto indexed_row(std::experimental::mdspan<T, Extents, Layout, Accessor> m, std::size_t row_idx) →  auto
template <typename T, typename Pull>
auto make_source(Pull&& pull) →  auto
template <typename T>
auto next(const signal<T>& sig) →  auto
template <typename T>
auto next(const signal<T>& sig, std::stop_token stop) →  auto
template <typename T>
auto next(channel<T>& ch, std::stop_token = {}) →  task<std::optional<T>>
template <typename T, typename Pull>
auto next(pull_source<T, Pull>& src, std::stop_token stop = {}) →  task<std::optional<T>>
auto operator&(Emphasis a, Emphasis b) →  Emphasis constexpr noexcept
template <numeric T>
auto operator*(T n, ch_unit) →  width_t constexpr noexcept
Create a width from a number of terminal cells.
template <numeric T>
auto operator*(T n, ln_unit) →  height_t constexpr noexcept
Create a height from a number of terminal lines.
template <numeric T>
auto operator*(T n, one_unit) →  ratio_t constexpr noexcept
Create a dimensionless ratio.
template <numeric T>
auto operator*(T n, percent_unit) →  percent_t constexpr noexcept
Create a percentage value.
auto operator*(width_t a, double b) →  width_t constexpr noexcept
Scale a width by a floating-point factor.
auto operator*(double a, width_t b) →  width_t constexpr noexcept
Scale a width by a floating-point factor.
auto operator*(height_t a, double b) →  height_t constexpr noexcept
Scale a height by a floating-point factor.
auto operator*(double a, height_t b) →  height_t constexpr noexcept
Scale a height by a floating-point factor.
auto operator*(percent_t a, double b) →  percent_t constexpr noexcept
Scale a percentage by a scalar.
auto operator*(double a, percent_t b) →  percent_t constexpr noexcept
Scale a percentage by a scalar.
auto operator+(width_t a, width_t b) →  width_t constexpr noexcept
Add widths.
auto operator+(height_t a, height_t b) →  height_t constexpr noexcept
Add heights.
auto operator+(ratio_t a, ratio_t b) →  ratio_t constexpr noexcept
Add ratios.
auto operator+(percent_t a, percent_t b) →  percent_t constexpr noexcept
Add percentages.
auto operator+(terminal_origin_t, width_t dx) →  col_t constexpr noexcept
Offset the terminal column origin by a width.
auto operator+(terminal_origin_v_t, height_t dy) →  row_t constexpr noexcept
Offset the terminal row origin by a height.
auto operator+(col_t p, width_t dx) →  col_t constexpr noexcept
Move a column to the right.
auto operator+(row_t p, height_t dy) →  row_t constexpr noexcept
Move a row down.
auto operator-(width_t a, width_t b) →  width_t constexpr noexcept
Subtract widths.
auto operator-(height_t a, height_t b) →  height_t constexpr noexcept
Subtract heights.
auto operator-(ratio_t a, ratio_t b) →  ratio_t constexpr noexcept
Subtract ratios.
auto operator-(percent_t a, percent_t b) →  percent_t constexpr noexcept
Subtract percentages.
auto operator-(col_t p, width_t dx) →  col_t constexpr noexcept
Move a column to the left.
auto operator-(col_t a, col_t b) →  width_t constexpr noexcept
Distance between two columns.
auto operator-(col_t p, terminal_origin_t) →  width_t constexpr noexcept
Convert a column back to a zero-based width from terminal origin.
auto operator-(col_t p, ansi_origin_t) →  width_t constexpr noexcept
Convert a zero-based column to a one-based ANSI column value.
auto operator-(row_t p, height_t dy) →  row_t constexpr noexcept
Move a row up.
auto operator-(row_t a, row_t b) →  height_t constexpr noexcept
Distance between two rows.
auto operator-(row_t p, terminal_origin_v_t) →  height_t constexpr noexcept
Convert a row back to a zero-based height from terminal origin.
auto operator-(row_t p, ansi_origin_v_t) →  height_t constexpr noexcept
Convert a zero-based row to a one-based ANSI row value.
auto operator/(percent_t a, double b) →  percent_t constexpr noexcept
Divide a percentage by a scalar.
template <numeric T>
auto operator<(ratio_t a, T b) →  bool constexpr noexcept
Compare a ratio against a numeric value.
auto operator<(percent_t a, ratio_t b) →  bool constexpr noexcept
Compare a percentage with a ratio after converting to a ratio.
template <numeric T>
auto operator<=(ratio_t a, T b) →  bool constexpr noexcept
Compare a ratio against a numeric value.
auto operator<=(percent_t a, ratio_t b) →  bool constexpr noexcept
Compare a percentage with a ratio after converting to a ratio.
template <numeric T>
auto operator>(ratio_t a, T b) →  bool constexpr noexcept
Compare a ratio against a numeric value.
auto operator>(percent_t a, ratio_t b) →  bool constexpr noexcept
Compare a percentage with a ratio after converting to a ratio.
template <numeric T>
auto operator>=(ratio_t a, T b) →  bool constexpr noexcept
Compare a ratio against a numeric value.
auto operator>=(percent_t a, ratio_t b) →  bool constexpr noexcept
Compare a percentage with a ratio after converting to a ratio.
auto operator|(Emphasis a, Emphasis b) →  Emphasis constexpr noexcept
auto operator|=(Emphasis& a, Emphasis b) →  Emphasis& constexpr noexcept
template <typename T>
auto publish(const publisher<T>& pub, T value) →  task<void>
template <typename T>
auto publish(const bound_publisher<T>& pub) →  task<void>
template <typename T>
auto publish(channel<T>& ch, T value) →  task<bool>
template <typename T>
auto publisher_for(const signal<T>& sig) →  auto
template <typename T>
auto publisher_for(const signal<T>& sig, T value) →  auto
auto raw_changes(const Raster& front, const Raster& back) →  auto
auto row_changes(height_t y, auto cells, const Raster& back) →  auto
template <typename T, typename Extents, typename Layout, typename Accessor>
auto row_range(std::experimental::mdspan<T, Extents, Layout, Accessor> m, std::size_t row_idx) →  auto
Get a single row from a 2D mdspan as a range.
template <scoped Scope>
auto scheduler_of(Scope& s) →  auto&
template <scoped Scope, typename... Sources>
auto select(Scope& scope, Sources&... sources) →  task<std::variant<std::optional<source_value_t<Sources>>...>>
template <scoped Scope>
void spawn(Scope& s, task<> t)
auto start(scheduler& sched, task<> t) →  auto
template <scoped Scope>
auto stop_token(Scope& s) →  auto
template <scoped Scope>
auto subscope(Scope& s) →  auto
template <scoped Scope, typename Context>
auto subscope(Scope& s, Context context) →  auto
auto sync_wait(auto&& awaitable) →  auto
Run an awaitable synchronously on the current thread.
auto to_ansi(col_t col) →  ansi_col_t constexpr noexcept
Convert a terminal column to the representation used by ANSI writer calls.
auto to_ansi(row_t row) →  ansi_row_t constexpr noexcept
Convert a terminal row to the representation used by ANSI writer calls.
auto to_ansi_x(Pos pos) →  ansi_col_t constexpr noexcept
Convert a position's column for ANSI writer calls.
auto to_ansi_y(Pos pos) →  ansi_row_t constexpr noexcept
Convert a position's row for ANSI writer calls.
auto when_all(auto&& tasks) →  auto
Await a collection of tasks.
auto when_all(auto&& first, auto&& second, auto && ... rest) →  auto
Await several awaitables.
auto zip_rows(const Raster& front, const Raster& back) →  auto

Variables

Rgba8 DEFAULT_COLOR constexpr
Emphasis DEFAULT_EMPHASIS constexpr
Default emphasis (none)
ansi_origin_t ansi_origin constexpr
One-based ANSI-column origin.
ansi_origin_v_t ansi_origin_v constexpr
One-based ANSI-row origin.
ch_unit ch constexpr
Character-cell width unit.
auto is_changed constexpr
Did this cell change? (comparing old vs new from a zipped pair)
ln_unit ln constexpr
Terminal line-height unit.
one_unit one constexpr
Dimensionless ratio unit.
percent_unit percent constexpr
Percent unit. A value of 100 * percent is equivalent to 1 * one.
auto same_run constexpr
terminal_origin_t terminal_origin constexpr
Zero-based terminal-column origin.
terminal_origin_v_t terminal_origin_v constexpr
Zero-based terminal-row origin.

Enum documentation

enum class nxt::Emphasis: std::uint8_t

Bitfield for text emphasis attributes. These map directly to SGR codes: bold=1, faint=2, italic=3, etc.

Typedef documentation

using nxt::ansi_col_t = col_t

ANSI columns share the same representation but are interpreted one-based.

using nxt::ansi_row_t = row_t

ANSI rows share the same representation but are interpreted one-based.

template <typename T>
using nxt::bound_publisher = detail::bound_publisher<T>

template <typename T>
using nxt::channel = nxt::detail::event_queue<T>

Buffered async stream of values.

using nxt::event = coro::event

Manually signaled coroutine event.

template <typename T>
using nxt::generator = coro::generator<T>

Coroutine generator type.

using nxt::latch = coro::latch

Coroutine latch primitive.

using nxt::mdspan_extents = std::experimental::extents<std::size_t, std::dynamic_extent, std::dynamic_extent>

Dynamic extents for terminal-cell rasters.

using nxt::poll_op = coro::poll_op

Poll operation type from libcoro.

using nxt::poll_status = coro::poll_status

Poll status type from libcoro.

using nxt::poll_stop_source = coro::poll_stop_source

Stop source for cancellable poll operations.

template <typename T>
using nxt::publisher = detail::publisher<T>

template <typename T>
using nxt::queue = coro::queue<T>

Async multi-producer/multi-consumer queue.

using nxt::scheduler = coro::scheduler

Scheduler type used by nxt async operations.

template <std::ptrdiff_t max_value>
using nxt::semaphore = coro::semaphore<max_value>

Counting semaphore with a compile-time maximum value.

template <typename T>
using nxt::signal = detail::signal<T>

template <typename T>
using nxt::source_value_t = typename source_value<std::remove_cvref_t<T>>::type

template <typename T = void>
using nxt::task = coro::task<T>

Coroutine task type used throughout nxt.

Function documentation

template <scoped Scope, typename... Awaitables>
auto nxt::all(Scope& s, Awaitables && ... awaitables)

template <scoped Scope, typename... Awaitables>
auto nxt::any(Scope& s, Awaitables && ... awaitables)

template <typename T, typename Extents, typename Layout, typename Accessor>
auto nxt::as_range(std::experimental::mdspan<T, Extents, Layout, Accessor> m)

Convert a 2D mdspan to a flat range (row-major order). Works with any layout (contiguous or strided from submdspan).

template <scoped Scope>
void nxt::cancel(Scope& s)

template <typename T>
task<void> nxt::cancel(channel<T>& ch)

template <typename T>
task<void> nxt::close(channel<T>& ch)

template <typename T>
void nxt::close(signal<T>& sig)

template <typename F>
void nxt::diff_rasters(const Raster& front, const Raster& back, F&& emit)

Iterate changed regions, tracking style state for minimal ANSI output.

bool nxt::has_emphasis(Emphasis set, Emphasis flag) constexpr noexcept

auto nxt::indexed_cell_row(const_glyph_view_t glyphs, const_color_view_t fgs, const_color_view_t bgs, const_emphasis_view_t ems, std::size_t row_idx)

Get a row as indexed cells (col, glyph, fg, bg, em).

template <typename T, typename Extents, typename Layout, typename Accessor>
auto nxt::indexed_row(std::experimental::mdspan<T, Extents, Layout, Accessor> m, std::size_t row_idx)

Get an indexed row range (pairs of column index and value reference).

template <typename T, typename Pull>
auto nxt::make_source(Pull&& pull)

template <typename T>
auto nxt::next(const signal<T>& sig)

template <typename T>
auto nxt::next(const signal<T>& sig, std::stop_token stop)

template <typename T>
task<std::optional<T>> nxt::next(channel<T>& ch, std::stop_token = {})

template <typename T, typename Pull>
task<std::optional<T>> nxt::next(pull_source<T, Pull>& src, std::stop_token stop = {})

Emphasis nxt::operator&(Emphasis a, Emphasis b) constexpr noexcept

template <numeric T>
width_t nxt::operator*(T n, ch_unit) constexpr noexcept

Create a width from a number of terminal cells.

template <numeric T>
height_t nxt::operator*(T n, ln_unit) constexpr noexcept

Create a height from a number of terminal lines.

template <numeric T>
ratio_t nxt::operator*(T n, one_unit) constexpr noexcept

Create a dimensionless ratio.

template <numeric T>
percent_t nxt::operator*(T n, percent_unit) constexpr noexcept

Create a percentage value.

width_t nxt::operator*(width_t a, double b) constexpr noexcept

Scale a width by a floating-point factor.

width_t nxt::operator*(double a, width_t b) constexpr noexcept

Scale a width by a floating-point factor.

height_t nxt::operator*(height_t a, double b) constexpr noexcept

Scale a height by a floating-point factor.

height_t nxt::operator*(double a, height_t b) constexpr noexcept

Scale a height by a floating-point factor.

percent_t nxt::operator*(percent_t a, double b) constexpr noexcept

Scale a percentage by a scalar.

percent_t nxt::operator*(double a, percent_t b) constexpr noexcept

Scale a percentage by a scalar.

width_t nxt::operator+(width_t a, width_t b) constexpr noexcept

Add widths.

height_t nxt::operator+(height_t a, height_t b) constexpr noexcept

Add heights.

ratio_t nxt::operator+(ratio_t a, ratio_t b) constexpr noexcept

Add ratios.

percent_t nxt::operator+(percent_t a, percent_t b) constexpr noexcept

Add percentages.

col_t nxt::operator+(terminal_origin_t, width_t dx) constexpr noexcept

Offset the terminal column origin by a width.

row_t nxt::operator+(terminal_origin_v_t, height_t dy) constexpr noexcept

Offset the terminal row origin by a height.

col_t nxt::operator+(col_t p, width_t dx) constexpr noexcept

Move a column to the right.

row_t nxt::operator+(row_t p, height_t dy) constexpr noexcept

Move a row down.

width_t nxt::operator-(width_t a, width_t b) constexpr noexcept

Subtract widths.

height_t nxt::operator-(height_t a, height_t b) constexpr noexcept

Subtract heights.

ratio_t nxt::operator-(ratio_t a, ratio_t b) constexpr noexcept

Subtract ratios.

percent_t nxt::operator-(percent_t a, percent_t b) constexpr noexcept

Subtract percentages.

col_t nxt::operator-(col_t p, width_t dx) constexpr noexcept

Move a column to the left.

width_t nxt::operator-(col_t a, col_t b) constexpr noexcept

Distance between two columns.

width_t nxt::operator-(col_t p, terminal_origin_t) constexpr noexcept

Convert a column back to a zero-based width from terminal origin.

width_t nxt::operator-(col_t p, ansi_origin_t) constexpr noexcept

Convert a zero-based column to a one-based ANSI column value.

row_t nxt::operator-(row_t p, height_t dy) constexpr noexcept

Move a row up.

height_t nxt::operator-(row_t a, row_t b) constexpr noexcept

Distance between two rows.

height_t nxt::operator-(row_t p, terminal_origin_v_t) constexpr noexcept

Convert a row back to a zero-based height from terminal origin.

height_t nxt::operator-(row_t p, ansi_origin_v_t) constexpr noexcept

Convert a zero-based row to a one-based ANSI row value.

percent_t nxt::operator/(percent_t a, double b) constexpr noexcept

Divide a percentage by a scalar.

template <numeric T>
bool nxt::operator<(ratio_t a, T b) constexpr noexcept

Compare a ratio against a numeric value.

bool nxt::operator<(percent_t a, ratio_t b) constexpr noexcept

Compare a percentage with a ratio after converting to a ratio.

template <numeric T>
bool nxt::operator<=(ratio_t a, T b) constexpr noexcept

Compare a ratio against a numeric value.

bool nxt::operator<=(percent_t a, ratio_t b) constexpr noexcept

Compare a percentage with a ratio after converting to a ratio.

template <numeric T>
bool nxt::operator>(ratio_t a, T b) constexpr noexcept

Compare a ratio against a numeric value.

bool nxt::operator>(percent_t a, ratio_t b) constexpr noexcept

Compare a percentage with a ratio after converting to a ratio.

template <numeric T>
bool nxt::operator>=(ratio_t a, T b) constexpr noexcept

Compare a ratio against a numeric value.

bool nxt::operator>=(percent_t a, ratio_t b) constexpr noexcept

Compare a percentage with a ratio after converting to a ratio.

Emphasis nxt::operator|(Emphasis a, Emphasis b) constexpr noexcept

Emphasis& nxt::operator|=(Emphasis& a, Emphasis b) constexpr noexcept

template <typename T>
task<void> nxt::publish(const publisher<T>& pub, T value)

template <typename T>
task<void> nxt::publish(const bound_publisher<T>& pub)

template <typename T>
task<bool> nxt::publish(channel<T>& ch, T value)

template <typename T>
auto nxt::publisher_for(const signal<T>& sig)

template <typename T>
auto nxt::publisher_for(const signal<T>& sig, T value)

auto nxt::raw_changes(const Raster& front, const Raster& back)

Iterate changed regions between two rasters as a lazy range.

Pipeline: zip_rows(front, back) – pair up rows from both rasters | transform(row_changes) – extract changed runs from each row | join – flatten into single stream

auto nxt::row_changes(height_t y, auto cells, const Raster& back)

Extract changed runs from a single row. Groups cells by run boundaries, keeps only changed runs, converts to RawChange.

template <typename T, typename Extents, typename Layout, typename Accessor>
auto nxt::row_range(std::experimental::mdspan<T, Extents, Layout, Accessor> m, std::size_t row_idx)

Get a single row from a 2D mdspan as a range.

template <scoped Scope>
auto& nxt::scheduler_of(Scope& s)

template <scoped Scope, typename... Sources>
task<std::variant<std::optional<source_value_t<Sources>>...>> nxt::select(Scope& scope, Sources&... sources)

template <scoped Scope>
void nxt::spawn(Scope& s, task<> t)

auto nxt::start(scheduler& sched, task<> t)

Schedule a task to run on the given scheduler. Use this instead of co_await scheduler.schedule() at the top of coroutines.

template <scoped Scope>
auto nxt::stop_token(Scope& s)

template <scoped Scope>
auto nxt::subscope(Scope& s)

template <scoped Scope, typename Context>
auto nxt::subscope(Scope& s, Context context)

auto nxt::sync_wait(auto&& awaitable)

Run an awaitable synchronously on the current thread.

ansi_col_t nxt::to_ansi(col_t col) constexpr noexcept

Convert a terminal column to the representation used by ANSI writer calls.

ansi_row_t nxt::to_ansi(row_t row) constexpr noexcept

Convert a terminal row to the representation used by ANSI writer calls.

ansi_col_t nxt::to_ansi_x(Pos pos) constexpr noexcept

Convert a position's column for ANSI writer calls.

ansi_row_t nxt::to_ansi_y(Pos pos) constexpr noexcept

Convert a position's row for ANSI writer calls.

auto nxt::when_all(auto&& tasks)

Await a collection of tasks.

auto nxt::when_all(auto&& first, auto&& second, auto && ... rest)

Await several awaitables.

auto nxt::zip_rows(const Raster& front, const Raster& back)

Zip two rasters' rows together for comparison. Yields (height_t y, zipped_row) where zipped_row pairs corresponding cells.

Variable documentation

Rgba8 nxt::DEFAULT_COLOR constexpr

Default color for terminal cells (resets to terminal's configured color)

Emphasis nxt::DEFAULT_EMPHASIS constexpr

Default emphasis (none)

ansi_origin_t nxt::ansi_origin constexpr

One-based ANSI-column origin.

ansi_origin_v_t nxt::ansi_origin_v constexpr

One-based ANSI-row origin.

ch_unit nxt::ch constexpr

Character-cell width unit.

auto nxt::is_changed constexpr

Did this cell change? (comparing old vs new from a zipped pair)

ln_unit nxt::ln constexpr

Terminal line-height unit.

one_unit nxt::one constexpr

Dimensionless ratio unit.

percent_unit nxt::percent constexpr

Percent unit. A value of 100 * percent is equivalent to 1 * one.

auto nxt::same_run constexpr

Should two cell pairs belong in the same run? Yes if: both changed (or both unchanged) AND same style in new buffer.

terminal_origin_t nxt::terminal_origin constexpr

Zero-based terminal-column origin.

terminal_origin_v_t nxt::terminal_origin_v constexpr

Zero-based terminal-row origin.