Table of Contents

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

image PixelBuffer

The pixel buffer to render.

windowBackground Color

Background 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

image PixelBuffer

The pixel buffer to render.

cols int

Target width in cells (characters).

rows int

Target height in cells (character rows).

windowBackground Color

Background color for odd-height last row bottom pixel.

Returns

Cell[,]