Skip to main content

Module render

Module render 

Source

Structs§

RenderOpts
RenderState
Per-source rendering state that persists across line renders. Carries the SGR style register and the current OSC 8 hyperlink so that an unclosed \x1b[31m on line N keeps line N+1 red until reset.

Enums§

AnsiMode
How the renderer treats escape sequences in input bytes.
Cell
TrueColor
Whether the writer should pass 24-bit RGB colors through to the terminal or downsample to the 256-color cube first. Resolved once at startup.

Functions§

color_256_to_rgb
Inverse of the relevant range of rgb_to_256: the RGB triple for an xterm 256-color index in the 6×6×6 cube (16..=231) or the grayscale ramp (232..=255). Indices 0..=15 (terminal-defined) are not produced by rgb_to_256; we map them to black defensively.
count_rows
display_width
Full expanded display width of a line in columns (tabs expanded to tab stops, cluster widths summed). Used by the viewport to clamp horizontal scroll. Independent of cols/left_col.
next_tab_stop
Next tab stop strictly greater than col, honoring explicit tab_stops (with last-interval repetition past the final stop) or uniform width.
render_line
rgb_to_256
Downsample 24-bit RGB to the xterm 256-color palette. Uses the standard 6×6×6 cube plus the 24-step grayscale ramp.