Skip to content

SixelExtensions

Namespace: Hex1b

Assembly: Hex1b.dll

Extension methods for creating SixelWidget.

csharp
[Experimental("HEX1B_SIXEL", UrlFormat = "https://github.com/hex1b/hex1b/blob/main/docs/experimental/sixel.md")]
public static class SixelExtensions

Inheritance

ObjectSixelExtensions

Methods

Height(SixelWidget, int)

Sets the display height in terminal cells.

Parameters:

  • widget (SixelWidget): The Sixel widget to configure.
  • height (Int32): The display height in terminal cells.

Returns: SixelWidget

A new widget with the requested height.

csharp
public static SixelWidget Height(this SixelWidget widget, int height)

Sixel<TParent>(WidgetContext<TParent>, SixelPixelBuffer, Func<WidgetContext<SixelWidget>, Hex1bWidget>)

Creates a Sixel widget from structured RGBA pixels.

Parameters:

Returns: SixelWidget

A new Sixel widget at its natural pixel-to-cell size.

csharp
public static SixelWidget Sixel<TParent>(this WidgetContext<TParent> context, SixelPixelBuffer pixels, Func<WidgetContext<SixelWidget>, Hex1bWidget> builder) where TParent : Hex1bWidget

Sixel<TParent>(WidgetContext<TParent>, SixelPixelBuffer, Hex1bWidget)

Creates a Sixel widget from structured RGBA pixels.

Parameters:

  • context (WidgetContext<<TParent>>): The widget context.
  • pixels (SixelPixelBuffer): The pixels to encode and display.
  • fallback (Hex1bWidget): The widget displayed when Sixel is unavailable.

Returns: SixelWidget

A new Sixel widget at its natural pixel-to-cell size.

csharp
public static SixelWidget Sixel<TParent>(this WidgetContext<TParent> context, SixelPixelBuffer pixels, Hex1bWidget fallback) where TParent : Hex1bWidget

Sixel<TParent>(WidgetContext<TParent>, string, Func<WidgetContext<SixelWidget>, Hex1bWidget>, int?, int?)

Creates a SixelWidget with image data and a fallback widget builder.

Parameters:

Returns: SixelWidget

csharp
public static SixelWidget Sixel<TParent>(this WidgetContext<TParent> context, string imageData, Func<WidgetContext<SixelWidget>, Hex1bWidget> builder, int? width = null, int? height = null) where TParent : Hex1bWidget

Sixel<TParent>(WidgetContext<TParent>, string, Func<WidgetContext<VStackWidget>, Hex1bWidget[]>, int?, int?)

Creates a SixelWidget with image data and a VStack fallback.

Parameters:

Returns: SixelWidget

csharp
public static SixelWidget Sixel<TParent>(this WidgetContext<TParent> context, string imageData, Func<WidgetContext<VStackWidget>, Hex1bWidget[]> builder, int? width = null, int? height = null) where TParent : Hex1bWidget

Sixel<TParent>(WidgetContext<TParent>, string, Hex1bWidget, int?, int?)

Creates a SixelWidget with the specified image data and fallback widget.

Parameters:

  • context (WidgetContext<<TParent>>): The widget context.
  • imageData (String): The Sixel-encoded image data.
  • fallback (Hex1bWidget): A widget to display if Sixel is not supported.
  • width (Nullable<Int32>): Optional width in character cells.
  • height (Nullable<Int32>): Optional height in character cells.

Returns: SixelWidget

csharp
public static SixelWidget Sixel<TParent>(this WidgetContext<TParent> context, string imageData, Hex1bWidget fallback, int? width = null, int? height = null) where TParent : Hex1bWidget

Sixel<TParent>(WidgetContext<TParent>, string, string, int?, int?)

Creates a SixelWidget with the specified image data and a text fallback.

Parameters:

  • context (WidgetContext<<TParent>>): The widget context.
  • imageData (String): The Sixel-encoded image data.
  • fallbackText (String): Text to display if Sixel is not supported.
  • width (Nullable<Int32>): Optional width in character cells.
  • height (Nullable<Int32>): Optional height in character cells.

Returns: SixelWidget

csharp
public static SixelWidget Sixel<TParent>(this WidgetContext<TParent> context, string imageData, string fallbackText, int? width = null, int? height = null) where TParent : Hex1bWidget

Width(SixelWidget, int)

Sets the display width in terminal cells.

Parameters:

  • widget (SixelWidget): The Sixel widget to configure.
  • width (Int32): The display width in terminal cells.

Returns: SixelWidget

A new widget with the requested width.

csharp
public static SixelWidget Width(this SixelWidget widget, int width)

Released under the MIT License.