KgpImageNode
Namespace: Hex1b.Nodes
Assembly: Hex1b.dll
A node that renders KGP (Kitty Graphics Protocol) images if the terminal supports it, otherwise falls back to rendering a fallback node.
public sealed class KgpImageNode : Hex1bNodeInheritance
Object → Hex1bNode → KgpImageNode
Properties
Fallback
The fallback node to render if KGP is not supported.
Returns: Hex1bNode
public Hex1bNode? Fallback { get; set; }ImageData
The raw RGBA32 pixel data for the image.
Returns: Byte[]
public byte[] ImageData { get; set; }PixelHeight
Height of the source image in pixels.
Returns: Int32
public int PixelHeight { get; set; }PixelWidth
Width of the source image in pixels.
Returns: Int32
public int PixelWidth { get; set; }RequestedHeight
Requested height in character cells. If null, computed from pixel dimensions.
Returns: Nullable<Int32>
public int? RequestedHeight { get; set; }RequestedWidth
Requested width in character cells. If null, computed from pixel dimensions.
Returns: Nullable<Int32>
public int? RequestedWidth { get; set; }Stretch
How the image is scaled within its allocated cell area.
Returns: KgpImageStretch
public KgpImageStretch Stretch { get; set; }ZOrder
Z-ordering relative to text content.
Returns: KgpZOrder
public KgpZOrder ZOrder { get; set; }Methods
ArrangeCore(Rect)
Override this method to implement arranging logic for this node. The base implementation saves previous bounds, marks dirty on change, and sets bounds.
Parameters:
bounds(Rect):
protected override void ArrangeCore(Rect bounds)GetChildren()
Gets the direct children of this node for structural tree traversal. Container nodes should override this to return their children.
Returns: IEnumerable<Hex1bNode>
public override IEnumerable<Hex1bNode> GetChildren()GetFocusableNodes()
Gets all focusable nodes in this subtree (including this node if focusable).
Returns: IEnumerable<Hex1bNode>
public override IEnumerable<Hex1bNode> GetFocusableNodes()MeasureCore(Constraints)
Override this method to implement measuring logic for this node.
Parameters:
constraints(Constraints):
Returns: Size
protected override Size MeasureCore(Constraints constraints)Render(Hex1bRenderContext)
Renders the KGP image if the terminal supports it, otherwise renders the fallback content.
Parameters:
context(Hex1bRenderContext):
public override void Render(Hex1bRenderContext context)