Skip to main content

Crate rio_graphics

Crate rio_graphics 

Source
Expand description

Terminal graphics value types shared by Rio’s VT core and renderer.

This crate holds the plain data types produced by the terminal’s image protocols (sixel, kitty, iTerm2) and the glyph protocol, with no rendering, GPU, or windowing dependencies. It is the leaf both rio-vt (the safe terminal core) and sugarloaf (the renderer) depend on, so the core no longer has to pull the render stack just to model an image.

Structs§

Color
RGBA color in linear-light 0..1 space. Mirrors wgpu::Color’s shape so callers don’t have to depend on wgpu. Sugarloaf’s public API takes/returns this type; the wgpu render path converts at the boundary (see the wgpu feature’s From impls).
Graphic
GraphicData
Defines a single graphic read from the PTY.
GraphicId
Unique identifier for every graphic added to a grid. An id of 0 represents a temporary, non-referenceable image (matching kitty’s behavior).
GraphicOverlay
An overlay image placement. Used by the renderer to draw images on top of (or behind) terminal content.
ResizeCommand
Dimensions to resize a graphic.

Enums§

ColorType
Specifies the format of the pixel data.
ResizeParameter
Unit to specify a dimension to resize the graphic.

Constants§

MAX_GRAPHIC_DIMENSIONS

Functions§

atlas_image_key
Key for an atlas graphic (sixel/iTerm2): the sequential GraphicId shifted above the kitty u32 id space so a kitty client picking a high image id (kitten icat uses random u32 ids) can never collide with an atlas texture.
kitty_image_key
Key for Sugarloaf::image_data and the renderer’s per-image texture cache: a kitty image, keyed by its protocol id verbatim. The full u32 space belongs to the client, so atlas graphics live in a disjoint range above it (see atlas_image_key).