ComputeContext
Namespace: Hex1b.Surfaces
Assembly: Hex1b.dll
Provides context for computing a cell value during layer resolution.
public readonly ref struct ComputeContextProperties
CellMetrics
Gets the cell metrics for pixel/cell conversion.
Returns: CellMetrics
public CellMetrics CellMetrics { get; }X
Gets the X position (column) of the cell being computed.
Returns: Int32
public int X { get; }Y
Gets the Y position (row) of the cell being computed.
Returns: Int32
public int Y { get; }Methods
GetAdjacent(int, int)
Gets a cell from an adjacent position on the same layer.
Parameters:
dx(Int32): The X offset from the current position.dy(Int32): The Y offset from the current position.
Returns: SurfaceCell
The cell at the adjacent position, or empty if out of bounds or cyclic.
public SurfaceCell GetAdjacent(int dx, int dy)GetAtLayer(int, int)
Gets a cell from an absolute position on the same layer.
Parameters:
Returns: SurfaceCell
The cell at the specified position, or empty if out of bounds or cyclic.
public SurfaceCell GetAtLayer(int x, int y)GetBelow()
Gets the resolved cell from all layers below the current layer at this position.
Returns: SurfaceCell
The composited cell from layers below.
public SurfaceCell GetBelow()GetBelowAt(int, int)
Gets the resolved cell from layers below at the specified position.
Parameters:
Returns: SurfaceCell
The composited cell from layers below at the specified position.
public SurfaceCell GetBelowAt(int x, int y)GetKgpBelow()
Gets KGP image information at this cell position from layers below.
Returns: KgpCellAccess
A KGP accessor for the image at this position, or default if none.
public KgpCellAccess GetKgpBelow()GetKgpBelowAt(int, int)
Gets KGP image information at a specific cell position from layers below.
Parameters:
Returns: KgpCellAccess
A KGP accessor for the image at the specified position, or default if none.
public KgpCellAccess GetKgpBelowAt(int x, int y)GetSixelBelow()
Gets access to sixel pixel data at this cell position from layers below.
Returns: SixelPixelAccess
A pixel accessor for the sixel at this position.
public SixelPixelAccess GetSixelBelow()GetSixelBelowAt(int, int)
Gets access to sixel pixel data at a specific cell position from layers below.
Parameters:
Returns: SixelPixelAccess
A pixel accessor for the sixel at the specified position.
public SixelPixelAccess GetSixelBelowAt(int x, int y)HasKgpBelow()
Checks if there is a KGP image at this position in layers below.
Returns: Boolean
True if a KGP image covers this cell position.
public bool HasKgpBelow()HasSixelBelow()
Checks if there is a sixel visible at this position in layers below.
Returns: Boolean
True if a sixel covers this cell position.
public bool HasSixelBelow()Remarks
This ref struct is passed to computed cell delegates during or . It provides access to: The position being computedCells from layers below the current layerAdjacent cells on the same layerSixel pixel data from layers belowKGP image data from layers below
The context includes cycle detection - if a computed cell queries another cell that is currently being computed (directly or indirectly), a fallback value is returned to prevent infinite recursion.