euporie.core.convert.datum
Convert display data between formats.
Functions
|
Get the current active (running) Application. |
|
Get or create an event loop for a given subsystem name. |
|
Returns a md5 hash object; optionally initialized with a string |
|
Run a coroutine synchronously from a sync context. |
Classes
|
Class for storing and converting display data. |
|
Abstract base class for generic types. |
|
|
Type variable. |
|
|
Mapping class that references values weakly. |
|
Alignment of the Window content. |
|
Class for finalization of weakrefable objects |
|
Return an iterator of overlapping pairs taken from the input iterator. |
alias of |
- class euporie.core.convert.datum.Datum(data: T, *args: Any, **kwargs: Any)
Bases:
Generic[T]Class for storing and converting display data.
- async cell_size_async() tuple[int, float]
Get the cell width and aspect ratio of the displayable data.
- Returns:
- A tuple of the data’s width in terminal columns and its aspect ratio, when
converted to a image.
- convert(to: str, cols: int | None = None, rows: int | None = None, fg: str | None = None, bg: str | None = None, bbox: DiInt | None = None, **kwargs: Any) Any
Convert between formats.
- async convert_async(to: str, cols: int | None = None, rows: int | None = None, fg: str | None = None, bg: str | None = None, bbox: DiInt | None = None, **kwargs: Any) Any
Perform conversion asynchronously, caching the result.
- classmethod get_size(key: str) tuple[Datum, Size] | None
Retrieve a
Datumand it’s size by its key.
- async pixel_size_async() tuple[int | None, int | None]
Get the dimensions of displayable data in pixels.
Foreground and background color are set at this point if they are available, as data conversion outputs are cached and reused.
- Returns:
- A tuple of the data’s width in terminal columns and its aspect ratio, when
converted to a image.