Renders an image inside its allocated terminal region. More...
Public Member Functions | |
| ImageWidget () | |
| Object-initializer constructor. | |
| ImageWidget (byte[] pngData, TerminalCapabilities? capabilities=null) | |
| Positional constructor for Kitty / Auto rendering. | |
| ImageWidget (RgbaImageData rgbaData) | |
| Positional constructor for HalfBlock-only rendering (pre-decoded RGBA). | |
| void | Render (IRenderContext ctx) |
| Render this widget into the provided context.The context carries the allocated region, theme, and color profile. Implementations MUST NOT write outside ctx.Region. | |
Properties | |
| TerminalCapabilities? | Capabilities [get] |
| Terminal capabilities detected at startup. | |
| SizeConstraint | Height = SizeConstraint.Flex(1) [get] |
| Height constraint used by the layout engine. | |
| byte?[] | PngData [get] |
| Raw PNG bytes used for Kitty rendering and (in Auto mode) as the primary source. | |
| ImageRenderMode | RenderMode = ImageRenderMode.Auto [get] |
| Rendering strategy. | |
| RgbaImageData? | RgbaData [get] |
| Pre-decoded RGBA pixel data used for the half-block fallback renderer. | |
| Style | Style = Style.Default [get] |
| Visual style for this widget. Inherits from Theme if unset. | |
| SizeConstraint | Width = SizeConstraint.Flex(1) [get] |
| Width constraint used by the layout engine. | |
Renders an image inside its allocated terminal region.
Two render modes are available:
▀) with 24-bit foreground/background colours — two pixel rows per terminal cell. Requires RgbaData. Set RenderMode to ImageRenderMode.Auto (default) to let the widget choose: Kitty when Capabilities reports support and PngData is present; HalfBlock when RgbaData is present; otherwise no-op.
| ConsoleForge.Widgets.ImageWidget.ImageWidget | ( | byte[] | pngData, |
| TerminalCapabilities? | capabilities = null ) |
Positional constructor for Kitty / Auto rendering.
| pngData | Raw PNG bytes. The terminal handles decoding and scaling. |
| capabilities | Detected terminal capabilities. When null, ImageRenderMode.Auto will fall back to HalfBlock (or no-op if RgbaData is also absent). |
| ConsoleForge.Widgets.ImageWidget.ImageWidget | ( | RgbaImageData | rgbaData | ) |
Positional constructor for HalfBlock-only rendering (pre-decoded RGBA).
| rgbaData | Pre-decoded RGBA pixel data. |
|
get |
Terminal capabilities detected at startup.
Used by ImageRenderMode.Auto to decide between Kitty and HalfBlock. Inject via TerminalCapabilities.Detect at application start.
|
get |
Raw PNG bytes used for Kitty rendering and (in Auto mode) as the primary source.
The terminal reads image dimensions from the PNG header; no pixel pre-processing is required by the application.
|
get |
Rendering strategy.
Defaults to ImageRenderMode.Auto.
|
get |
Pre-decoded RGBA pixel data used for the half-block fallback renderer.
Required when RenderMode is ImageRenderMode.HalfBlock or when Auto mode cannot use Kitty.