yera.runtime.handlers.image.ansi

ANSI handler for image output.

Symbols

class ANSIImageHandler — Render a concise image placeholder in unsupported terminals.

ANSIImageHandler

Inherits: BaseHandler
Subclasses: KittyImageHandler

Render a concise image placeholder in unsupported terminals.

Methods

__init__ — Initialize the image fallback with its destination console.
push — Render an image event as a textual placeholder.

ANSIImageHandler.__init__

__init__(
    console: Console,
) → None

Initialize the image fallback with its destination console.

Parameters

console
type: Console

Rich console used to render image placeholders.

ANSIImageHandler.push

push(
    event: OutputEvent,
) → None

Render an image event as a textual placeholder.

Parameters

event
type: OutputEvent

Output event carrying encoded image data.

Raises

TypeError

If the event does not carry image data.