Class HalfBlockRenderer
- Namespace
- SharpConsoleUI.Imaging
- Assembly
- SharpConsoleUI.dll
Renders a PixelBuffer to Cell arrays using the half-block technique. Each cell represents 2 vertical pixels: fg = top pixel, bg = bottom pixel, using the upper half block character (U+2580).
public static class HalfBlockRenderer
- Inheritance
-
HalfBlockRenderer
- Inherited Members
Methods
Render(PixelBuffer, Color)
Renders a PixelBuffer to a 2D Cell array. Output height = ceil(image.Height / 2). Output width = image.Width.
public static Cell[,] Render(PixelBuffer image, Color windowBackground)
Parameters
imagePixelBufferThe pixel buffer to render.
windowBackgroundColorBackground color for odd-height last row bottom pixel.
Returns
- Cell[,]
RenderScaled(PixelBuffer, int, int, Color)
Renders a PixelBuffer scaled to the specified cell dimensions. The image is first resized to (cols, rows * 2) pixels, then rendered.
public static Cell[,] RenderScaled(PixelBuffer image, int cols, int rows, Color windowBackground)
Parameters
imagePixelBufferThe pixel buffer to render.
colsintTarget width in cells (characters).
rowsintTarget height in cells (character rows).
windowBackgroundColorBackground color for odd-height last row bottom pixel.
Returns
- Cell[,]