Published release 0.2.1. Unreleased PR #2 reference.
LOOM 0.2.1 / RENDERING AND LAYOUT
CellDiff
Stateful ANSI encoder used by ANSIRenderBackend. It produces Data and RenderStats without writing. Retain the encoder across frames; pass the previous logical buffer and configure physical origin/clear ownership. Bounded rendering does not clear the whole screen. Hyperlinks are opt-in HTTP(S) destinations with a host, no controls, and at most 2,048 UTF-8 bytes.
Standard inherited Swift protocol operations such as synthesized equality and OptionSet set operations are not repeated. The public declarations below are extracted from the exact source revision listed in the coverage manifest.
Example
var encoder = CellDiff(hyperlinks: true)
let next = Buffer(width: 80, height: 24)
let (bytes, stats) = encoder.encode(next, previous: nil, cursor: nil)
_ = (bytes, stats)Members on this page
Feature guides and release status
CellDiff
struct CellDiffStateful output encoder.
Unchanged frames (including cursor state) emit no bytes.
Source · CellDiff.swift:7synchronizedOutput
var synchronizedOutput: BoolWhether writes are enclosed in synchronized-output escape sequences.
Source · CellDiff.swift:8colorDepth
var colorDepth: TerminalColorDepthExpected terminal color encoding.
Source · CellDiff.swift:9hyperlinks
var hyperlinks: BoolWhether HTTP(S) cell links may be emitted as OSC 8 links.
Source · CellDiff.swift:10init(synchronizedOutput:colorDepth:hyperlinks:)
init(synchronizedOutput: Bool = true, colorDepth: TerminalColorDepth = .trueColor, hyperlinks: Bool = false)Creates a value with the supplied arguments. Default arguments are shown in the declaration.
Parameters (3)
synchronizedOutput- Argument type and any default are shown in the declaration; see the behavior notes above.
colorDepth- Argument type and any default are shown in the declaration; see the behavior notes above.
hyperlinks- Argument type and any default are shown in the declaration; see the behavior notes above.
reset()
mutating func reset()Discards remembered cursor and presentation assumptions. Resynchronize using an appropriate previous frame and clear ownership after outside output.
Source · CellDiff.swift:22encode(_:previous:cursor:origin:clearScreen:)
mutating func encode(_ next: Buffer, previous: Buffer?, cursor: Point?, origin: Point = Point(x: 0, y: 0), clearScreen: Bool = true) -> (Data, RenderStats)Encodes local cells at a physical origin.
Disable clearScreen for bounded regions.
A bounded full repaint writes default blanks explicitly and never emits ED 2.
Parameters (5)
next- Next logical cell buffer.
previous- Previously presented cell buffer, or nil for a full repaint.
cursor- Requested display cursor; nil hides it.
origin- Argument type and any default are shown in the declaration; see the behavior notes above.
clearScreen- Argument type and any default are shown in the declaration; see the behavior notes above.
Returns (Data, RenderStats).