SixelExtensions
Namespace: Hex1b
Assembly: Hex1b.dll
Extension methods for creating SixelWidget.
[Experimental("HEX1B_SIXEL", UrlFormat = "https://github.com/hex1b/hex1b/blob/main/docs/experimental/sixel.md")]
public static class SixelExtensionsInheritance
Object → SixelExtensions
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.
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:
context(WidgetContext<<TParent>>): The widget context.pixels(SixelPixelBuffer): The pixels to encode and display.builder(Func<SixelWidget>, Hex1bWidget>): Builds the widget displayed when Sixel is unavailable.
Returns: SixelWidget
A new Sixel widget at its natural pixel-to-cell size.
public static SixelWidget Sixel<TParent>(this WidgetContext<TParent> context, SixelPixelBuffer pixels, Func<WidgetContext<SixelWidget>, Hex1bWidget> builder) where TParent : Hex1bWidgetSixel<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.
public static SixelWidget Sixel<TParent>(this WidgetContext<TParent> context, SixelPixelBuffer pixels, Hex1bWidget fallback) where TParent : Hex1bWidgetSixel<TParent>(WidgetContext<TParent>, string, Func<WidgetContext<SixelWidget>, Hex1bWidget>, int?, int?)
Creates a SixelWidget with image data and a fallback widget builder.
Parameters:
context(WidgetContext<<TParent>>): The widget context.imageData(String): The Sixel-encoded image data.builder(Func<SixelWidget>, Hex1bWidget>): Builder for the fallback widget.width(Nullable<Int32>): Optional width in character cells.height(Nullable<Int32>): Optional height in character cells.
Returns: SixelWidget
public static SixelWidget Sixel<TParent>(this WidgetContext<TParent> context, string imageData, Func<WidgetContext<SixelWidget>, Hex1bWidget> builder, int? width = null, int? height = null) where TParent : Hex1bWidgetSixel<TParent>(WidgetContext<TParent>, string, Func<WidgetContext<VStackWidget>, Hex1bWidget[]>, int?, int?)
Creates a SixelWidget with image data and a VStack fallback.
Parameters:
context(WidgetContext<<TParent>>): The widget context.imageData(String): The Sixel-encoded image data.builder(Func<VStackWidget>, Hex1bWidget[]>): Builder for the fallback widgets (wrapped in VStack).width(Nullable<Int32>): Optional width in character cells.height(Nullable<Int32>): Optional height in character cells.
Returns: SixelWidget
public static SixelWidget Sixel<TParent>(this WidgetContext<TParent> context, string imageData, Func<WidgetContext<VStackWidget>, Hex1bWidget[]> builder, int? width = null, int? height = null) where TParent : Hex1bWidgetSixel<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
public static SixelWidget Sixel<TParent>(this WidgetContext<TParent> context, string imageData, Hex1bWidget fallback, int? width = null, int? height = null) where TParent : Hex1bWidgetSixel<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
public static SixelWidget Sixel<TParent>(this WidgetContext<TParent> context, string imageData, string fallbackText, int? width = null, int? height = null) where TParent : Hex1bWidgetWidth(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.
public static SixelWidget Width(this SixelWidget widget, int width)