ISurfaceSource
Namespace: Hex1b.Surfaces
Assembly: Hex1b.dll
Common interface for any source that can provide terminal cells.
public interface ISurfaceSourceProperties
CellMetrics
Gets the cell metrics for this surface.
Returns: CellMetrics
CellMetrics CellMetrics { get; }HasKgp
Gets whether this surface contains any KGP (Kitty Graphics Protocol) images.
Returns: Boolean
bool HasKgp { get; }HasSixels
Gets whether this surface contains any sixel graphics.
Returns: Boolean
bool HasSixels { get; }Height
Gets the height of the surface in rows.
Returns: Int32
int Height { get; }Width
Gets the width of the surface in columns.
Returns: Int32
int Width { get; }Methods
GetCell(int, int)
Gets the cell at the specified position.
Parameters:
Returns: SurfaceCell
The cell at the specified position.
SurfaceCell GetCell(int x, int y)IsInBounds(int, int)
Checks if the specified position is within bounds.
Parameters:
Returns: Boolean
True if the position is within bounds, false otherwise.
bool IsInBounds(int x, int y)TryGetCell(int, int, out SurfaceCell)
Tries to get the cell at the specified position.
Parameters:
x(Int32): The column (0-based).y(Int32): The row (0-based).cell(SurfaceCell): The cell at the position, or default if out of bounds.
Returns: Boolean
True if the position is valid, false otherwise.
bool TryGetCell(int x, int y, out SurfaceCell cell)Remarks
This interface enables both (immediate, mutable grid) and (deferred, layered composition) to be used interchangeably in compositing operations.
Implementations may compute cells lazily (as in ) or return pre-stored values (as in ).