Skip to content

SixelData

Namespace: Hex1b

Assembly: Hex1b.dll

Immutable data containing Sixel graphics information.

csharp
public sealed class SixelData

Inheritance

ObjectSixelData

Properties

BackgroundMode

Gets whether unpainted pixels resolve to the captured background color or remain transparent.

Returns: SixelBackgroundMode

csharp
public SixelBackgroundMode BackgroundMode { get; }

CellMetrics

Gets the protocol cell metrics captured when this image was created.

Returns: SixelCellMetrics

csharp
public SixelCellMetrics CellMetrics { get; }

ContentHash

Gets the immutable image-resource identity used for deduplication.

Returns: Byte[]

csharp
public byte[] ContentHash { get; }

Diagnostics

Gets the explicit parser diagnostics explaining any downgraded or annotated outcome. Empty when is with nothing to report.

Returns: IReadOnlyList<SixelDiagnostic>

csharp
public IReadOnlyList<SixelDiagnostic> Diagnostics { get; }

Extents

Gets this image's logical/rendered/declared/data/painted extents and effective pixel aspect ratio.

Returns: SixelRasterExtents

csharp
public SixelRasterExtents Extents { get; }

HeightInCells

Gets the height of the Sixel image in cells.

Returns: Int32

csharp
public int HeightInCells { get; }

Outcome

Gets the authoritative parser outcome for this image's payload.

Returns: SixelParseOutcome

csharp
public SixelParseOutcome Outcome { get; }

Payload

Gets the complete framed DCS sequence used for rendering.

Returns: String

csharp
public string Payload { get; }

PixelHeight

Gets the vertical extent declared by DECGRA, or zero when none was declared.

Returns: Int32

csharp
public int PixelHeight { get; }

PixelWidth

Gets the horizontal extent declared by DECGRA, or zero when none was declared.

Returns: Int32

csharp
public int PixelWidth { get; }

RasterDiagnostics

Gets the explicit rasterizer diagnostics explaining a geometry-only outcome or other annotated raster result. Empty when is with nothing to report.

Returns: IReadOnlyList<SixelRasterDiagnostic>

csharp
public IReadOnlyList<SixelRasterDiagnostic> RasterDiagnostics { get; }

RasterStatus

Gets whether the authoritative rasterizer produced pixels for this image, or explicitly refused allocation (a geometry-only outcome).

Returns: SixelRasterStatus

csharp
public SixelRasterStatus RasterStatus { get; }

WidthInCells

Gets the width of the Sixel image in cells.

Returns: Int32

csharp
public int WidthInCells { get; }

Methods

GetCellSpan()

Gets the cell span for this Sixel image using the protocol cell metrics captured when the image was created.

Returns: ValueTuple<Int32, Int32>

The width and height in cells.

csharp
public (int Width, int Height) GetCellSpan()

GetCellSpan(CellMetrics)

Gets the cell span for this Sixel image using the protocol cell metrics captured when the image was created.

Parameters:

  • metrics (CellMetrics): Ignored. Sixel placement metrics are captured when the image is created.

Returns: ValueTuple<Int32, Int32>

The width and height in cells.

csharp
[Obsolete("Cell metrics are captured by SixelData. Use GetCellSpan().")]
public (int Width, int Height) GetCellSpan(CellMetrics metrics)

GetPixels()

Materializes the sixel payload as a dense pixel buffer. The result is cached when the owning live screen's retained-byte budget admits it. If that cache cannot fit, the returned buffer is not retained by the live terminal and a later call may materialize it again.

Returns: SixelPixelBuffer

The materialized pixel buffer, or null when the authoritative rasterizer produced a geometry-only result.

csharp
public SixelPixelBuffer? GetPixels()

Remarks

Sixel data is content-addressable. Identical payloads share the same instance only when their captured background, persistent palette, protocol cell metrics, and cell span are also equal. This deduplicates equivalent image resources without conflating placement contexts that would crop or damage the raster differently.

The raw DCS sequence is stored so it can be re-emitted during rendering. Declared pixel dimensions are parsed from the raster attributes in the payload.

Released under the MIT License.