libvt.graphics¶
Zero-dependency sans-I/O SIXEL and Kitty APC G placement tracker.
Bases:
StrEnumTerminal graphics protocol family.
Return the lower-cased version of the member name.
Bases:
objectPer-screen sans-I/O
SIXELand KittyAPC Gstate machine.Truewhen at least one active or scrollbackSIXELplacement is present, gating cell-overwrite hooks inO(1).
Monotonic counter incremented whenever stored placements change.
Return an independent copy of this tracker.
- Return type:
Return shallow copy of stored
ImageMetaentries.
Freeze stored placements into immutable
ImagePlacementrecords.- Return type:
tuple[ImagePlacement, ...]
Return
Truewhen any non-virtual placement covers viewport row.
- Parameters:
pl (
_MutablePlacement)- Return type:
Clear all stored images, placements, and in-progress uploads.
- Return type:
Delete non-virtual placements intersecting the active viewport.
Delete placements located completely inside scrollback (
ED 3).
Reap non-virtual placements scrolled past min_retained_abs_row.
Clip or remove
SIXELplacements intersected by a cell edit/erase.
Scan
SIXELgeometry into(width_px, height_px, rows, cols).
- Parameters:
up (
_PendingKittyUpload)- Return type:
Process one Kitty
APC Gpacket and return optional reply bytes.- Parameters:
control (
dict[str,str]) – Parsedkey=valuecontrol header pairs.payload (
bytes) – Base64 payload segment following;.cursor_row (
int) – Zero-based cursor row at packet arrival.cursor_col (
int) – Zero-based cursor column at packet arrival.screen_rows (
int) – Active screen height in rows.screen_cols (
int) – Active screen width in columns.scrolled_total_getter (
collections.abc.Callable[[],int] |None) – Optional callback returning livescrolled_totalafter advance_cursor runs.scrolled_total (
int) – Fallbackscrolled_totalwhen scrolled_total_getter isNone.cell_width_px (
int) – Nominal cell width in pixels.cell_height_px (
int) – Nominal cell height in pixels.min_row (
int) – Minimum viewport row ceiling when cursor scrolling does not advance scrollback (0default, or activeDECSTBMtop margin).advance_cursor (
collections.abc.Callable[[int,int],int] |None) – Callback invoked with(rows, cols)prior to committing a cursor-movingC=0placement, returning the post-scroll anchor row.
- Returns:
Sans-I/O
APC Gresponse packet, orNonewhen silent.- Return type:
Bases:
objectStored sans-I/O image metadata without buffered pixel bitmaps.
Protocol image identifier (auto-assigned positive integer for
SIXELor unnumbered Kitty uploads).
Optional Kitty
I=non-unique image number (0when unset).
Kitty
f=pixel format (8,16,24,32, or100PNG), or0forSIXEL.
Truewhen transmitted with Kittyo=zzlib compression.
Total encoded payload byte count observed across upload chunks.
Bases:
objectImmutable snapshot of a
SIXELor Kitty image placement on a screen.Referenced
ImageMeta.image_id.
Kitty
p=placement identifier (0when default/unnumbered).
Truefor KittyU=1Unicode-placeholder virtual placements.
Parent image ID for Kitty
P=relative placements (0when none).
Parent placement ID for Kitty
Q=relative placements.
Sub-cell pixel X offset within the anchor cell.
Sub-cell pixel Y offset within the anchor cell.
Bitmask of
rows * colsvisible cells forSIXELunder"cell_mask"erase policy (bitr * cols + cis1when intact);Nonewhen all cells in(rows, cols)are intact.
Return rendering plane derived from
z_index.
Return
Truewhen absolute grid cell(abs_row, col)is covered.
- Parameters:
- Return type:
Bases:
StrEnumKitty graphics z-ordering plane relative to cell background and text.
Return the lower-cased version of the member name.
Extract
(width_px, height_px)from the first 24 bytes of a PNG stream.
Compute
(width_px, height_px)of aSIXELpayload inO(n)time.