DevelopmentAll versions

Module ketraterm-render-cache

Renderer-owned primitive storage and leased publication of copied terminal frames. Its sole production dependency is ketraterm-render-api; synchronization with terminal mutation belongs to the source reader.

The public types in io.github.ketraterm.render.cache have distinct roles:

  • TerminalRenderCache is a mutable, caller-owned frame copy. It retains cell planes, packed cluster codepoints, row metadata, cursor primitives, and source generations. Reader identity qualifies incremental copies. Its images view retains immutable pixel resources and copied primitive placement metadata.
  • TerminalRenderImages provides indexed placement reads and synchronous sink copying. Pixel resources are shared across caches; placement storage is not.
  • TerminalRenderPublisher owns three caches. A serialized writer publishes a copied frame; readers borrow the latest cache through readCurrent.
  • TerminalRenderRangeCopy makes bounded retained-range copies for worker-side analysis, with explicit absolute bounds for the sliced origin.
  • TerminalTextRangeCopy copies bounded text and row metadata for search without rendering attributes, cursor state, or clearing spare array capacity.

Backend-specific layout, glyph runs, selection, and painting belong to renderer modules. Arrays expose cache-owned storage for reading; capacity may exceed the logical frame shape. Copying is allocation-conscious, with allocations permitted for construction, capacity growth, and shape changes.

See the consumer guide and publication contract for ownership, lifetime, failure, and concurrency rules.